setjmp.S 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* $OpenBSD: setjmp.S,v 1.1 2013/10/28 22:13:13 miod Exp $ */
  2. /*
  3. * Mach Operating System
  4. * Copyright (c) 1993-1992 Carnegie Mellon University
  5. * Copyright (c) 1991 OMRON Corporation
  6. * Copyright (c) 1996 Nivas Madhur
  7. * Copyright (c) 1998 Steve Murphree, Jr.
  8. * All Rights Reserved.
  9. *
  10. * Permission to use, copy, modify and distribute this software and its
  11. * documentation is hereby granted, provided that both the copyright
  12. * notice and this permission notice appear in all copies of the
  13. * software, derivative works or modified versions, and any portions
  14. * thereof, and that both notices appear in supporting documentation.
  15. *
  16. * CARNEGIE MELLON AND OMRON ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  17. * CONDITION. CARNEGIE MELLON AND OMRON DISCLAIM ANY LIABILITY OF ANY KIND
  18. * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  19. *
  20. * Carnegie Mellon requests users of this software to return to
  21. *
  22. * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
  23. * School of Computer Science
  24. * Carnegie Mellon University
  25. * Pittsburgh PA 15213-3890
  26. *
  27. * any improvements or extensions that they make and grant Carnegie the
  28. * rights to redistribute these changes.
  29. */
  30. #include <machine/asm.h>
  31. /* int setjmp(label_t *); */
  32. ENTRY(setjmp)
  33. st %r1, %r2, 0
  34. st %r14, %r2, 4
  35. st %r15, %r2, 2*4
  36. st %r16, %r2, 3*4
  37. st %r17, %r2, 4*4
  38. st %r18, %r2, 5*4
  39. st %r19, %r2, 6*4
  40. st %r20, %r2, 7*4
  41. st %r21, %r2, 8*4
  42. st %r22, %r2, 9*4
  43. st %r23, %r2, 10*4
  44. st %r24, %r2, 11*4
  45. st %r25, %r2, 12*4
  46. st %r26, %r2, 13*4
  47. st %r27, %r2, 14*4
  48. st %r28, %r2, 15*4
  49. st %r29, %r2, 16*4
  50. st %r30, %r2, 17*4
  51. st %r31, %r2, 18*4
  52. jmp.n %r1
  53. or %r2, %r0, %r0
  54. /* void longjmp(label_t*); */
  55. ENTRY(longjmp)
  56. ld %r1, %r2, 0
  57. ld %r14, %r2, 4
  58. ld %r15, %r2, 2*4
  59. ld %r16, %r2, 3*4
  60. ld %r17, %r2, 4*4
  61. ld %r18, %r2, 5*4
  62. ld %r19, %r2, 6*4
  63. ld %r20, %r2, 7*4
  64. ld %r21, %r2, 8*4
  65. ld %r22, %r2, 9*4
  66. ld %r23, %r2, 10*4
  67. ld %r24, %r2, 11*4
  68. ld %r25, %r2, 12*4
  69. ld %r26, %r2, 13*4
  70. ld %r27, %r2, 14*4
  71. ld %r28, %r2, 15*4
  72. ld %r29, %r2, 16*4
  73. ld %r30, %r2, 17*4
  74. ld %r31, %r2, 18*4
  75. jmp.n %r1
  76. or %r2, %r0, 1