2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
9 /******************************************************************************
14 int setjmp (jmp_buf env);
17 Save the current context so that you can return to it later.
20 env - The context/environment is saved here for later restoring
23 0 if it returns from setjmp() and 1 when it returns from longjmp().
34 ... this code is executed after setjmp() returns ...
36 // This is no good example on how to use this function
37 // You should not do that
45 ... this code is executed if you call longjmp(env) ...
57 ******************************************************************************/
59 #include "aros/m68k/asm.h"
65 .set FirstArg, 4 /* Skip Return-Adress */
70 /* New version adapted from libnix instead of ixemul.
71 * Note the slightly different register save order.
73 move.
l 4(%sp
),%a0
/* get address of jmp_buf */
74 move.
l (%sp
),(%a0
)+ /* store return address */
75 movem.
l %d2-
%d7
/%a2-
%a6
/%sp
,(%a0
) /* store all registers except scratch */
76 moveq.
l #0,%d0 /* return 0 */
80 The jmp_buf is filled as follows (d0/d1/a0/a1 are not saved):
82 _jmp_buf offset contents