setjmp.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* Define the machine-dependent type `jmp_buf'. Nios2 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. #ifndef _ASM
  22. typedef struct
  23. {
  24. /* Callee-saved registers r16 through r23. */
  25. unsigned long __regs[8];
  26. /* Program counter. */
  27. unsigned long __pc;
  28. /* Stack pointer. */
  29. unsigned long __sp;
  30. /* The frame pointer. */
  31. unsigned long __fp;
  32. /* The global pointer. */
  33. unsigned long __gp;
  34. /* floating point regs, if any */
  35. #if defined __HAVE_FPU__
  36. unsigned long __fpregs[64];
  37. #endif
  38. } __jmp_buf[1];
  39. #endif
  40. #define JB_REGS 0
  41. #define JB_PC 32
  42. #define JB_SP 36
  43. #define JB_FP 40
  44. #define JB_GP 44
  45. #define JB_FPREGS 48
  46. #if defined __HAVE_FPU__
  47. # define JB_SIZE 304
  48. #else
  49. # define JB_SIZE 48
  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)->__sp)
  55. #endif /* bits/setjmp.h */