make.tmpl: add missing compiler attribute to build_progs
[AROS.git] / arch / m68k-all / posixc / sigsetjmp.s
blob1fc0806263d13e26a1bef359feda1fdb0e60cd99
1 /*
2 Copyright © 2015, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: sigsetjmp
6 Lang: english
8 The jmp_buf is filled as follows (d0/d1/a0/a1 are not saved):
10 _jmp_buf offset contents
11 [0] 0 old pc
12 [1] 4 d2
13 [2] 8 d3
14 [3] 12 d4
15 [4] 16 d5
16 [5] 20 d6
17 [6] 24 d7
18 [7] 28 a2
19 [8] 32 a3
20 [9] 36 a4
21 [10] 40 a5
22 [11] 44 a6
23 [12] 48 old sp
24 [13] 52 padding
25 [14] 56 padding
26 [15] 60 DEBUG_MAGIC
29 #include "aros/m68k/asm.h"
31 .text
32 .balign 4
33 .global AROS_CDEFNAME(sigsetjmp)
34 .type AROS_CDEFNAME(sigsetjmp),%function
36 AROS_CDEFNAME(sigsetjmp):
37 /* New version adapted from libnix instead of ixemul.
38 * Note the slightly different register save order.
40 move.l %sp@(0*4),%d1 /* store return address */
41 move.l %sp@(1*4),%a0 /* get address of jmp_buf */
42 lea.l %sp@(1*4),%a1
43 move.l %a1,%a0@(4 * 12)
44 movem.l %d1-%d7/%a2-%a6,(%a0) /* store all registers except scratch and sp*/
45 #if DEBUG
46 move.l #DEBUG_MAGIC,%a0@(4 * 15)
47 #endif
48 moveq.l #0,%d0 /* return 0 */
49 rts