diff options
Diffstat (limited to 'lib/libc/arch/m68k/gen/setjmp.S')
-rw-r--r-- | lib/libc/arch/m68k/gen/setjmp.S | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/lib/libc/arch/m68k/gen/setjmp.S b/lib/libc/arch/m68k/gen/setjmp.S index 01ab2b39d76..161acadf949 100644 --- a/lib/libc/arch/m68k/gen/setjmp.S +++ b/lib/libc/arch/m68k/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.5 2011/11/22 21:13:30 guenther Exp $ */ +/* $OpenBSD: setjmp.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -46,40 +46,41 @@ #include "DEFS.h" ENTRY(setjmp) - subl #12,sp /* space for sigaltstack args/rvals */ - clrl sp@ /* don't change it... */ - movl sp,sp@(4) /* ...but return the current val */ - jbsr _sigaltstack /* note: flags returned in sp@(8) */ - clrl sp@ /* don't change mask, just return */ - jbsr _sigblock /* old value */ - movl sp@(8),d1 /* old flags value */ - andl #1,d1 /* extract onstack flag */ - addl #12,sp - movl sp@(4),a0 /* save area pointer */ - movl d1,a0@+ /* save old onstack value */ - movl d0,a0@+ /* save old signal mask */ - lea sp@(4),a1 /* adjust saved SP since we won't rts */ - movl a1,a0@+ /* save old SP */ - movl a6,a0@+ /* save old FP */ - clrl a0@+ /* no AP */ - movl sp@,a0@+ /* save old PC */ - clrl a0@+ /* clean PS */ - moveml #0x3CFC,a0@ /* save remaining non-scratch regs */ - clrl d0 /* return 0 */ + subl #12,%sp /* space for sigaltstack args/rvals */ + clrl %sp@ /* don't change it... */ + movl %sp,%sp@(4) /* ...but return the current val */ + jbsr PIC_PLT(_C_LABEL(sigaltstack)) + /* note: flags returned in %sp@(8) */ + clrl %sp@ /* don't change mask, just return old value */ + jbsr PIC_PLT(_C_LABEL(sigblock)) + movl %sp@(8),%d1 /* old flags value */ + andl #1,%d1 /* extract onstack flag */ + addl #12,%sp + movl %sp@(4),%a0 /* save area pointer */ + movl %d1,%a0@+ /* save old onstack value */ + movl %d0,%a0@+ /* save old signal mask */ + lea %sp@(4),%a1 /* adjust saved SP since we won't rts */ + movl %a1,%a0@+ /* save old SP */ + movl %a6,%a0@+ /* save old FP */ + clrl %a0@+ /* no AP */ + movl %sp@,%a0@+ /* save old PC */ + clrl %a0@+ /* clean PS */ + moveml #0x3CFC,%a0@ /* save remaining non-scratch regs */ + clrl %d0 /* return 0 */ rts ENTRY(longjmp) - movl sp@(4),a0 /* save area pointer */ - tstl a0@(8) /* ensure non-zero SP */ + movl %sp@(4),%a0 /* save area pointer */ + tstl %a0@(8) /* ensure non-zero SP */ jeq botch /* oops! */ - movl sp@(8),d0 /* grab return value */ + movl %sp@(8),%d0 /* grab return value */ jne ok /* non-zero ok */ - moveq #1,d0 /* else make non-zero */ + moveq #1,%d0 /* else make non-zero */ ok: - moveml a0@(28),#0x3CFC /* restore non-scratch regs */ - movl a0,sp@- /* let sigreturn */ - jbsr _sigreturn /* finish for us */ + moveml %a0@(28),#0x3CFC/* restore non-scratch regs */ + movl %a0,%sp@- /* let sigreturn finish for us */ + jbsr PIC_PLT(_C_LABEL(sigreturn)) botch: - jbsr _longjmperror + jbsr PIC_PLT(_C_LABEL(longjmperror)) stop #0 |