setjmp.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. /* Define the machine-dependent type `jmp_buf'. Nios version. */
  16. #ifndef _BITS_SETJMP_H
  17. #define _BITS_SETJMP_H 1
  18. #if !defined _SETJMP_H && !defined _PTHREAD_H
  19. # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
  20. #endif
  21. #ifndef _ASM
  22. #include <signal.h>
  23. typedef struct
  24. {
  25. /* There are eight 4-byte local registers saved. */
  26. long int __lregs[8];
  27. /* There are six 4-byte input registers saved. */
  28. long int __iregs[6];
  29. /* The SP, return address to caller (also for longjmp)
  30. and return address of caller are saved. */
  31. int *__sp;
  32. int *__jmpret;
  33. int *__callersret;
  34. } __jmp_buf[1];
  35. /* Test if longjmp to JMPBUF would unwind the frame
  36. containing a local variable at ADDRESS. */
  37. #define _JMPBUF_UNWINDS(jmpbuf, address) \
  38. ((void *) (address) < (void *) (jmpbuf)->__sp)
  39. #else /* _ASM */
  40. #define jmpbuf_l0 0x00
  41. #define jmpbuf_l1 0x01
  42. #define jmpbuf_l2 0x02
  43. #define jmpbuf_l3 0x03
  44. #define jmpbuf_l4 0x04
  45. #define jmpbuf_l5 0x05
  46. #define jmpbuf_l6 0x06
  47. #define jmpbuf_l7 0x07
  48. #define jmpbuf_i0 0x08
  49. #define jmpbuf_i1 0x09
  50. #define jmpbuf_i2 0x0a
  51. #define jmpbuf_i3 0x0b
  52. #define jmpbuf_i4 0x0c
  53. #define jmpbuf_i5 0x0d
  54. #define jmpbuf_sp 0x0e
  55. #define jmpbuf_jmpret 0x0f
  56. #define jmpbuf_callersret 0x10
  57. #endif /* _ASM */
  58. #endif /* bits/setjmp.h */