setjmp.S 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * libc/sysdeps/linux/microblaze/setjmp.S -- `setjmp' for microblaze
  3. *
  4. * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
  5. * Copyright (C) 2001,2002 NEC Corporation
  6. * Copyright (C) 2001,2002 Miles Bader <miles@gnu.org>
  7. *
  8. * This file is subject to the terms and conditions of the GNU Lesser
  9. * General Public License. See the file COPYING.LIB in the main
  10. * directory of this archive for more details.
  11. *
  12. * Written by Miles Bader <miles@gnu.org>
  13. */
  14. #define _SETJMP_H
  15. #define _ASM
  16. #include <bits/setjmp.h>
  17. #include <clinkage.h>
  18. .text
  19. C_ENTRY(setjmp):
  20. addi r6, r0, 1 /* Save the signal mask. */
  21. braid C_SYMBOL_NAME(__sigsetjmp)
  22. nop
  23. .globl C_SYMBOL_NAME(_setjmp)
  24. C_SYMBOL_NAME(_setjmp):
  25. add r6, r0, r0 /* Don't save the signal mask. */
  26. .globl C_SYMBOL_NAME(__sigsetjmp)
  27. C_SYMBOL_NAME(__sigsetjmp):
  28. /* Save registers relative to r5 (arg0)*/
  29. swi r1, r5, 0 /* stack pointer */
  30. swi r15, r5, 4 /* link register */
  31. swi r18, r5, 8 /* assembler temp */
  32. swi r19, r5, 12 /* now call-preserved regs */
  33. swi r20, r5, 16
  34. swi r21, r5, 20
  35. swi r22, r5, 24
  36. swi r23, r5, 28
  37. swi r24, r5, 32
  38. swi r25, r5, 36
  39. swi r26, r5, 40
  40. swi r27, r5, 44
  41. swi r28, r5, 48
  42. swi r29, r5, 52
  43. swi r30, r5, 56
  44. /* Make a tail call to __sigjmp_save; it takes the same args. */
  45. braid C_SYMBOL_NAME(__sigjmp_save)
  46. nop
  47. C_END(setjmp)