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#include "m68kasm.h"
18
19.global SYM (setjmp)
20.type	SYM (setjmp), @function
21.global SYM (longjmp)
22.type	SYM (longjmp), @function
23
24SYM (setjmp):
25	moveal sp@(4),a0
26	movel sp@(0),a0@(12)
27	movel sp,a0@(8)
28	moveml d2-d7/a2-a6,a0@(20)
29	clrl d0
30	rts
31	.size	SYM(setjmp), . - SYM(setjmp)
32
33SYM (longjmp):
34	moveal sp@(4),a0
35	movel sp@(8),d0
36	bne 1f
37	movel &1,d0
381:
39	moveml a0@(20),d2-d7/a2-a6
40	moveal a0@(8),sp
41	movel a0@(12),sp@
42	rts
43	.size	SYM(longjmp), . - SYM(longjmp)
44
45#ifdef M68881
46.global SYM (setjmp_68881)
47.type	SYM (setjmp_68881), @function
48.global SYM (longjmp_68881)
49.type	SYM (longjmp_68881), @function
50
51SYM (setjmp_68881):
52	moveal sp@(4),a0
53	movel sp@(0),a0@(12)
54	movel sp,a0@(8)
55	moveml d2-d7/a2-a6,a0@(20)
56	fmovemx fp2-fp7,a0@(64)
57	clrl d0
58	rts
59	.size	SYM(setjmp_68881), . - SYM(setjmp_68881)
60
61SYM (longjmp_68881):
62	moveal sp@(4),a0
63	fmovemx a0@(64),fp2-fp7
64	movel sp@(8),d0
65	bne 1f
66	movel &1,d0
671:
68	moveml a0@(20),d2-d7/a2-a6
69	moveal a0@(8),sp
70	movel a0@(12),sp@
71	rts
72	.size	SYM(longjmp_68881), . - SYM(longjmp_68881)
73#endif
74
75#if defined(__linux__) && defined(__ELF__)
76	.section .note.GNU-stack,"",%progbits
77#endif
78
79