setjmp.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* Define the machine-dependent type `jmp_buf'. MIPS version.
  2. Copyright (C) 1992,93,95,97,2000 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  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. #include <sgidefs.h>
  22. typedef struct
  23. {
  24. /* Program counter. */
  25. void * __pc;
  26. /* Stack pointer. */
  27. void * __sp;
  28. /* Callee-saved registers s0 through s7. */
  29. #if _MIPS_SIM == _MIPS_SIM_ABI32
  30. int __regs[8];
  31. #else
  32. long long __regs[8];
  33. #endif
  34. /* The frame pointer. */
  35. void * __fp;
  36. /* The global pointer. */
  37. void * __gp;
  38. /* Floating point status register. */
  39. int __fpc_csr;
  40. /* Callee-saved floating point registers. */
  41. #if _MIPS_SIM == _MIPS_SIM_ABI64
  42. double __fpregs[8];
  43. #else /* N32 || O32 */
  44. double __fpregs[6];
  45. #endif /* N32 || O32 */
  46. } __jmp_buf[1];
  47. #ifdef __USE_MISC
  48. /* Offset to the program counter in `jmp_buf'. */
  49. # define JB_PC 0
  50. #endif
  51. /* Test if longjmp to JMPBUF would unwind the frame
  52. containing a local variable at ADDRESS. */
  53. #define _JMPBUF_UNWINDS(jmpbuf, address) \
  54. ((void *) (address) < (void *) (jmpbuf)[0].__sp)
  55. #endif /* bits/setjmp.h */