setjmp.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* Copyright (C) 1997,1999,2000 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. #ifndef _SETJMP_H
  16. # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
  17. #endif
  18. #include <bits/wordsize.h>
  19. #if __WORDSIZE == 64
  20. #ifndef _ASM
  21. typedef struct __sparc64_jmp_buf
  22. {
  23. struct __sparc64_jmp_buf *uc_link;
  24. unsigned long uc_flags;
  25. unsigned long uc_sigmask;
  26. struct __sparc64_jmp_buf_mcontext
  27. {
  28. unsigned long mc_gregs[19];
  29. unsigned long mc_fp;
  30. unsigned long mc_i7;
  31. struct __sparc64_jmp_buf_fpu
  32. {
  33. union
  34. {
  35. unsigned int sregs[32];
  36. unsigned long dregs[32];
  37. long double qregs[16];
  38. } mcfpu_fpregs;
  39. unsigned long mcfpu_fprs;
  40. unsigned long mcfpu_gsr;
  41. void *mcfpu_fq;
  42. unsigned char mcfpu_qcnt;
  43. unsigned char mcfpu_qentsz;
  44. unsigned char mcfpu_enab;
  45. } mc_fpregs;
  46. } uc_mcontext;
  47. } __jmp_buf[1];
  48. #endif
  49. /* Test if longjmp to JMPBUF would unwind the frame
  50. containing a local variable at ADDRESS. */
  51. #define _JMPBUF_UNWINDS(jmpbuf, address) \
  52. ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp)
  53. #else
  54. #if defined __USE_MISC || defined _ASM
  55. # define JB_SP 0
  56. # define JB_FP 1
  57. # define JB_PC 2
  58. #endif
  59. #ifndef _ASM
  60. typedef int __jmp_buf[3];
  61. #endif
  62. /* Test if longjmp to JMPBUF would unwind the frame
  63. containing a local variable at ADDRESS. */
  64. #define _JMPBUF_UNWINDS(jmpbuf, address) \
  65. ((int) (address) < (jmpbuf)[JB_SP])
  66. #endif