]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/vax/__longjmp.S
update
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libc / sysdeps / linux / vax / __longjmp.S
1 #include <features.h>
2
3 /*
4  * longjmp.S    atp sept 2001
5  *              Jan-Benedict Glaw <jbglaw@lug-owl.de> 2006
6  *
7  * Restore regs and info and jmp back to a previous setjmp
8  */
9
10 .globl  __longjmp
11 .align  4
12 __longjmp:
13         .word   0x0040          /* This matches setjmp and PLT  */
14         movl    0x4(%ap), %r0   /* Our scratch reg              */
15 /*      movl    $0, %r0                                         */
16 /*      movl    (%r0), %r0                                      */
17         /* We are going to modify our stack frame               */
18         /* to the same as that of the setjmp we called earlier  */
19         movl    (%r0), (%fp)            /* cond handler         */
20         movl    0x4(%r0), 0x4(%fp)      /* psw                  */
21         movl    0x8(%r0), 0x8(%fp)      /* ap                   */
22         movl    0xc(%r0), 0xc(%fp)      /* fp                   */
23         movl    0x10(%r0), 0x10(%fp)    /* pc                   */
24
25         /* Restore the regs                                     */
26         movl    0x14(%r0), %r1
27         movl    0x18(%r0), %r2
28         movl    0x1c(%r0), %r3
29         movl    0x20(%r0), %r4
30         movl    0x24(%r0), %r5
31         movl    0x28(%r0), %r6
32         movl    0x2c(%r0), %r7
33         movl    0x30(%r0), %r8
34         movl    0x34(%r0), %r9
35         movl    0x38(%r0), %r10
36         movl    0x3c(%r0), %r11
37
38         /* Check val and set to 1 if set to zero                */
39         movl    0x8(%ap), %r0
40         tstl    %r0
41         bneq    exit_ok
42         movl    $0x1, %r0
43 exit_ok:
44         ret
45 .size __longjmp,.-__longjmp
46 libc_hidden_def(__longjmp)
47