diff options
Diffstat (limited to 'usr/klibc/arch/m68k/setjmp.S')
-rw-r--r-- | usr/klibc/arch/m68k/setjmp.S | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/usr/klibc/arch/m68k/setjmp.S b/usr/klibc/arch/m68k/setjmp.S new file mode 100644 index 0000000..1b3591e --- /dev/null +++ b/usr/klibc/arch/m68k/setjmp.S @@ -0,0 +1,43 @@ +# +# arch/m68k/setjmp.S +# +# setjmp/longjmp for the m68k architecture +# + +# +# The jmp_buf is assumed to contain the following, in order: +# %d2..%d7 +# %a2..%a7 +# return address +# + + .text + .align 2 + .globl setjmp + .type setjmp, @function +setjmp: + move.l (%sp)+, %d0 | Return address + movea.l (%sp), %a0 | Buffer address + | Postincrement mode is not permitted here... + movem.l %d2-%d7/%a2-%a7, (%a0) + move.l %d0, 48(%a0) | Return address + move.l %d0, -(%sp) | Restore return address + clr.l %d0 | Return value + movea.l %d0, %a0 | Redundant return... + rts + + .size setjmp,.-setjmp + + .text + .align 2 + .globl longjmp + .type longjmp, @function +longjmp: + move.l 4(%sp), %a0 | Buffer address + move.l 8(%sp), %d0 | Return value + movem.l (%a0)+, %d2-%d7/%a2-%a7 + movea.l (%a0), %a1 + movea.l %d0, %a0 | Redundant return... + jmp.l (%a1) + + .size longjmp,.-longjmp |