_setjmp.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .globl _setjmp
  2. .align 4
  3. _setjmp:
  4. .word 0x0040
  5. /* push an empty word onto the stack */
  6. pushl $0
  7. /* now copy handler, psw, ap, fp and pc on the stack up one word */
  8. movl 4(%sp), (%sp) /* copy handler */
  9. movl 8(%sp), 4(%sp) /* psw */
  10. movl 12(%sp), 8(%sp) /* ap */
  11. movl 16(%sp), 12(%sp) /* fp */
  12. movl 20(%sp), 16(%sp) /* pc */
  13. movl 24(%sp), 20(%sp) /* r6 from register mask */
  14. movl $2, 24(%sp) /* set the number of arguments to 2 */
  15. movl 32(%sp), 28(%sp) /* copy the jmp_buf */
  16. movl $1, 32(%sp) /* put the 1 on the stack */
  17. addl3 $24, %sp, %ap
  18. movl %sp, %fp
  19. moval __sigsetjmp, %r0
  20. addl2 $2, %r0
  21. pushl %r0
  22. rsb
  23. .globl setjmp
  24. .align 4
  25. setjmp:
  26. .word 0x0040
  27. pushl $0
  28. /* now copy handler, psw, ap, fp and pc on the stack up one word */
  29. movl 4(%sp), (%sp)
  30. movl 8(%sp), 4(%sp)
  31. movl 12(%sp), 8(%sp)
  32. movl 16(%sp), 12(%sp)
  33. movl 20(%sp), 16(%sp)
  34. movl 24(%sp), 20(%sp) /* r6 from register mask */
  35. movl $2, 24(%sp) /* set the number of arguments to 2 */
  36. movl 32(%sp), 28(%sp) /* copy the jmp_buf */
  37. movl $0, 32(%sp) /* put the 0 on the stack */
  38. addl3 $24, %sp, %ap
  39. movl %sp, %fp
  40. moval __sigsetjmp, %r0
  41. addl2 $2, %r0
  42. pushl %r0
  43. rsb