summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/vax/_setjmp.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/_setjmp.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/_setjmp.S')
-rw-r--r--libc/sysdeps/linux/vax/_setjmp.S54
1 files changed, 54 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/vax/_setjmp.S b/libc/sysdeps/linux/vax/_setjmp.S
new file mode 100644
index 000000000..17d3160d8
--- /dev/null
+++ b/libc/sysdeps/linux/vax/_setjmp.S
@@ -0,0 +1,54 @@
+
+.globl _setjmp
+.align 4
+_setjmp:
+ .word 0x0040
+
+ /* push an empty word onto the stack */
+ pushl $0
+
+ /* now copy handler, psw, ap, fp and pc on the stack up one word */
+ movl 4(%sp), (%sp) /* copy handler */
+ movl 8(%sp), 4(%sp) /* psw */
+ movl 12(%sp), 8(%sp) /* ap */
+ movl 16(%sp), 12(%sp) /* fp */
+ movl 20(%sp), 16(%sp) /* pc */
+ movl 24(%sp), 20(%sp) /* r6 from register mask */
+
+ movl $2, 24(%sp) /* set the number of arguments to 2 */
+ movl 32(%sp), 28(%sp) /* copy the jmp_buf */
+ movl $1, 32(%sp) /* put the 1 on the stack */
+
+ addl3 $24, %sp, %ap
+ movl %sp, %fp
+
+ moval __sigsetjmp, %r0
+ addl2 $2, %r0
+ pushl %r0
+ rsb
+
+.globl setjmp
+.align 4
+setjmp:
+ .word 0x0040
+ pushl $0
+
+ /* now copy handler, psw, ap, fp and pc on the stack up one word */
+ movl 4(%sp), (%sp)
+ movl 8(%sp), 4(%sp)
+ movl 12(%sp), 8(%sp)
+ movl 16(%sp), 12(%sp)
+ movl 20(%sp), 16(%sp)
+ movl 24(%sp), 20(%sp) /* r6 from register mask */
+
+ movl $2, 24(%sp) /* set the number of arguments to 2 */
+ movl 32(%sp), 28(%sp) /* copy the jmp_buf */
+ movl $0, 32(%sp) /* put the 0 on the stack */
+
+ addl3 $24, %sp, %ap
+ movl %sp, %fp
+
+ moval __sigsetjmp, %r0
+ addl2 $2, %r0
+ pushl %r0
+ rsb