1/*
2Copyright (c) 1990 The Regents of the University of California.
3All rights reserved.
4
5Redistribution and use in source and binary forms are permitted
6provided that the above copyright notice and this paragraph are
7duplicated in all such forms and that any documentation,
8and/or other materials related to such
9distribution and use acknowledge that the software was developed
10by the University of California, Berkeley.  The name of the
11University may not be used to endorse or promote products derived
12from this software without specific prior written permission.
13THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16 */
17	.file "setjmp.S"
18
19	.section .text
20	.align 1
21	.global _setjmp
22#ifdef __AM33__
23#ifdef __AM33_2__
24	.am33_2
25#else
26	.am33
27#endif
28#endif
29_setjmp:
30        mov d0,a0
31        mov d2,(0,a0)
32        mov d3,(4,a0)
33	mov mdr,d1
34	mov d1,(8,a0)
35        mov a2,(12,a0)
36        mov a3,(16,a0)
37	mov sp,a1
38	mov a1,(20,a0)
39#ifdef __AM33__
40	add 24,a0
41	mov r4,(a0+)
42	mov r5,(a0+)
43	mov r6,(a0+)
44	mov r7,(a0+)
45#ifdef __AM33_2__
46	fmov fs4,(a0+)
47	fmov fs5,(a0+)
48	fmov fs6,(a0+)
49	fmov fs7,(a0+)
50	fmov fs8,(a0+)
51	fmov fs9,(a0+)
52	fmov fs10,(a0+)
53	fmov fs11,(a0+)
54	fmov fs12,(a0+)
55	fmov fs13,(a0+)
56	fmov fs14,(a0+)
57	fmov fs15,(a0+)
58	fmov fs16,(a0+)
59	fmov fs17,(a0+)
60	fmov fs18,(a0+)
61	fmov fs19,(a0+)
62#endif
63#endif
64        sub d0,d0
65	rets
66
67	.global _longjmp
68_longjmp:
69	mov d0,a0
70	mov (8,a0),d2
71	mov d2,mdr
72        mov (0,a0),d2
73        mov (4,a0),d3
74        mov (12,a0),a2
75        mov (16,a0),a3
76	mov (20,a0),a1
77	mov a1,sp
78#ifdef __AM33__
79	add 24,a0
80	mov (a0+),r4
81	mov (a0+),r5
82	mov (a0+),r6
83	mov (a0+),r7
84#ifdef __AM33_2__
85	fmov (a0+),fs4
86	fmov (a0+),fs5
87	fmov (a0+),fs6
88	fmov (a0+),fs7
89	fmov (a0+),fs8
90	fmov (a0+),fs9
91	fmov (a0+),fs10
92	fmov (a0+),fs11
93	fmov (a0+),fs12
94	fmov (a0+),fs13
95	fmov (a0+),fs14
96	fmov (a0+),fs15
97	fmov (a0+),fs16
98	fmov (a0+),fs17
99	fmov (a0+),fs18
100	fmov (a0+),fs19
101#endif
102#endif
103	cmp 0,d1
104	bne L1
105	mov 1,d1
106L1:
107	mov d1,d0
108	retf [],0
109