setjmp.S 970 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * setjmp.S atp. Sept. 2001
  3. * Jan-Benedict Glaw <jbglaw@lug-owl.de> 2006
  4. *
  5. * Save regs and info needed for a longjmp
  6. */
  7. .globl __sigsetjmp
  8. .align 4
  9. __sigsetjmp:
  10. .word 0x0000 /* We look after reg saving here - this */
  11. /* must match longjmp. */
  12. movl 0x4(%ap), %r0 /* Our scratch reg */
  13. /* kenn would probably use movq here. :-) */
  14. movl %r1, 0x14(%r0) /* save regs */
  15. movl %r2, 0x18(%r0)
  16. movl %r3, 0x1c(%r0)
  17. movl %r4, 0x20(%r0)
  18. movl %r5, 0x24(%r0)
  19. movl %r6, 0x28(%r0)
  20. movl %r7, 0x2c(%r0)
  21. movl %r8, 0x30(%r0)
  22. movl %r9, 0x34(%r0)
  23. movl %r10, 0x38(%r0)
  24. movl %r11, 0x3c(%r0)
  25. /* Now save our call frame */
  26. movl (%fp), (%r0) /* Condition handler (for VMS emulation) */
  27. movl 0x4(%fp), 0x4(%r0) /* psw */
  28. movl 0x8(%fp), 0x8(%r0) /* ap */
  29. movl 0xc(%fp), 0xc(%r0) /* fp */
  30. movl 0x10(%fp), 0x10(%r0) /* pc */
  31. /* Call the sigjmp save routine */
  32. pushl 8(%ap)
  33. pushl %r0
  34. calls $2, __sigjmp_save
  35. /* Done */
  36. ret