setjmp.h 1.7 KB

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