setjmp.h 787 B

1234567891011121314151617181920212223242526272829303132
  1. /* Copyright (C) 2004, Yoshinori Sato <ysato@users.sourceforge.jp> */
  2. /* Define the machine-dependent type `jmp_buf'. H8/300 version. */
  3. #ifndef _BITS_SETJMP_H
  4. #define _BITS_SETJMP_H 1
  5. #if !defined _SETJMP_H && !defined _PTHREAD_H
  6. # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
  7. #endif
  8. #ifndef _ASM
  9. typedef struct
  10. {
  11. unsigned long __regs[4]; /* save er4 - er7(sp) */
  12. unsigned long __pc; /* the return address */
  13. } __jmp_buf[1];
  14. #endif /* _ASM */
  15. #define JB_REGS 0
  16. #define JB_PC 16
  17. #define JB_SIZE 20
  18. /* Test if longjmp to JMPBUF would unwind the frame
  19. containing a local variable at ADDRESS. */
  20. #define _JMPBUF_UNWINDS(jmpbuf, address) \
  21. ((void *) (address) < (void *) (jmpbuf)->__regs[3])
  22. #endif /* bits/setjmp.h */