__longjmp.S 1.1 KB

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