make.tmpl: add missing compiler attribute to build_progs
[AROS.git] / arch / m68k-all / posixc / vfork_longjmp.s
blob42a07dbcb402b352a1044b57ee59c94284d9b91f
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: longjmp for vfork(), m68k version
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] 64 padding
29 #include "aros/m68k/asm.h"
31 .text
32 .balign 4
33 .global AROS_CDEFNAME(vfork_longjmp)
34 .type AROS_CDEFNAME(vfork_longjmp),%function
36 AROS_CDEFNAME(vfork_longjmp):
37 /* New version adapted from libnix instead of ixemul.
38 * Note the slightly different register save order.
40 addq.l #4,%sp /* returns to other address */
41 move.l %sp@+,%a0 /* get address of jmp_buf */
42 move.l %sp@+,%d0 /* get return code */
43 #if DEBUG
44 cmp.l #(DEBUG_MAGIC+1),%a0@(4 * 15)
45 beq 0f
46 trap #1
48 #endif
49 movem.l (%a0),%d1-%d7/%a2-%a6/%sp /* restore all registers except scratch */
50 move.l %d1,%a0 /* set return address */
51 jmp %a0@