setjmp.h 805 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (C) 2004-2005 Atmel Corporation
  3. *
  4. * This file is subject to the terms and conditions of the GNU Lesser General
  5. * Public License. See the file "COPYING.LIB" in the main directory of this
  6. * archive for more details.
  7. */
  8. #ifndef _BITS_SETJMP_H
  9. #define _BITS_SETJMP_H 1
  10. #if !defined _SETJMP_H && !defined _PTHREAD_H
  11. # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
  12. #endif
  13. #ifndef _ASM
  14. /*
  15. * The jump buffer contains r0-r7, sr, sp and lr. Other registers are
  16. * not saved.
  17. */
  18. typedef int __jmp_buf[11];
  19. #endif
  20. #define __JMP_BUF_SP 4
  21. /* Test if longjmp to JMPBUF would unwind the frame containing a local
  22. variable at ADDRESS. */
  23. #define _JMPBUF_UNWINDS(jmpbuf, address) \
  24. ((void *)(address) < (void *)(jmpbuf[__JMP_BUF_SP]))
  25. #endif /* _BITS_SETJMP_H */