summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/vax/__longjmp.S
diff options
context:
space:
mode:
author"Jan-Benedict Glaw" <jbglaw@lug-owl.de>2006-01-27 21:20:28 +0000
committer"Jan-Benedict Glaw" <jbglaw@lug-owl.de>2006-01-27 21:20:28 +0000
commit0934f142036f12292711770d353f1c01ab718db7 (patch)
treebad0873c1bbd8c81ec70180d6ca4e4006d01fa62 /libc/sysdeps/linux/vax/__longjmp.S
parent9f341620c14e959d333fb26d8ec5e9f9dc5209d6 (diff)
First round of VAX patches. This isn't complete right now, there are for
sure still bugs (properly hidden, of course), a libm is completely missing (I've got one that implements some basic stuff, but that's really not ready for checking in...) I've also got a list of other things that need touch-ups, but that's mostly minor stuff that'll be done during the next days.
Diffstat (limited to 'libc/sysdeps/linux/vax/__longjmp.S')
-rw-r--r--libc/sysdeps/linux/vax/__longjmp.S43
1 files changed, 43 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/vax/__longjmp.S b/libc/sysdeps/linux/vax/__longjmp.S
new file mode 100644
index 000000000..a48581fa9
--- /dev/null
+++ b/libc/sysdeps/linux/vax/__longjmp.S
@@ -0,0 +1,43 @@
+#include <features.h>
+
+# longjmp.S atp sept 2001
+# restore regs and info and jmp back to a previous setjmp
+
+.globl __longjmp
+.align 4
+__longjmp:
+ .word 0x0040 # this matches setjmp and PLT
+ movl 0x4(%ap), %r0 # our scratch reg
+# movl $0, %r0
+# movl (%r0), %r0
+ # we are going to modify our stack frame
+ # to the same as that of the setjmp we called earlier
+ movl (%r0), (%fp) # cond handler
+ movl 0x4(%r0), 0x4(%fp) # psw
+ movl 0x8(%r0), 0x8(%fp) # ap
+ movl 0xc(%r0), 0xc(%fp) # fp
+ movl 0x10(%r0), 0x10(%fp) # pc
+
+ # restore the regs
+ movl 0x14(%r0), %r1
+ movl 0x18(%r0), %r2
+ movl 0x1c(%r0), %r3
+ movl 0x20(%r0), %r4
+ movl 0x24(%r0), %r5
+ movl 0x28(%r0), %r6
+ movl 0x2c(%r0), %r7
+ movl 0x30(%r0), %r8
+ movl 0x34(%r0), %r9
+ movl 0x38(%r0), %r10
+ movl 0x3c(%r0), %r11
+
+ # check val and set to 1 if set to zero
+ movl 0x8(%ap), %r0
+ tstl %r0
+ bneq exit_ok
+ movl $0x1, %r0
+exit_ok:
+ ret
+.size __longjmp,.-__longjmp
+libc_hidden_def(__longjmp)
+