setjmp.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. typedef struct
  22. {
  23. /* Program counter. */
  24. void * __pc;
  25. /* Stack pointer. */
  26. void * __sp;
  27. /* Callee-saved registers s0 through s7. */
  28. int __regs[8];
  29. /* The frame pointer. */
  30. void * __fp;
  31. /* The global pointer. */
  32. void * __gp;
  33. /* Floating point status register. */
  34. int __fpc_csr;
  35. /* Callee-saved floating point registers. */
  36. double __fpregs[6];
  37. } __jmp_buf[1];
  38. #ifdef __USE_MISC
  39. /* Offset to the program counter in `jmp_buf'. */
  40. # define JB_PC 0
  41. #endif
  42. /* Test if longjmp to JMPBUF would unwind the frame
  43. containing a local variable at ADDRESS. */
  44. #define _JMPBUF_UNWINDS(jmpbuf, address) \
  45. ((void *) (address) < (void *) (jmpbuf)[0].__sp)
  46. #endif /* bits/setjmp.h */