setjmp.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Define the machine-dependent type `jmp_buf'. MIPS version.
  2. Copyright (C) 1992,93,95,97,2000 Free Software Foundation, Inc.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public License as
  5. published by the Free Software Foundation; either version 2 of the
  6. 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. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with the GNU C Library; see the file COPYING.LIB. If not,
  13. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. Boston, MA 02111-1307, USA. */
  15. #ifndef _SETJMP_H
  16. # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
  17. #endif
  18. typedef struct
  19. {
  20. /* Program counter. */
  21. void * __pc;
  22. /* Stack pointer. */
  23. void * __sp;
  24. /* Callee-saved registers s0 through s7. */
  25. int __regs[8];
  26. /* The frame pointer. */
  27. void * __fp;
  28. /* The global pointer. */
  29. void * __gp;
  30. /* Floating point status register. */
  31. int __fpc_csr;
  32. /* Callee-saved floating point registers. */
  33. double __fpregs[6];
  34. } __jmp_buf[1];
  35. #ifdef __USE_MISC
  36. /* Offset to the program counter in `jmp_buf'. */
  37. # define JB_PC 0
  38. #endif
  39. /* Test if longjmp to JMPBUF would unwind the frame
  40. containing a local variable at ADDRESS. */
  41. #define _JMPBUF_UNWINDS(jmpbuf, address) \
  42. ((void *) (address) < (jmpbuf)[0].__sp)