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