setjmp.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (C) 2013, Imagination Technologies Ltd.
  3. *
  4. * Licensed under LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
  5. */
  6. /* Define the machine-dependent type `jmp_buf' */
  7. #ifndef _BITS_SETJMP_H
  8. #define _BITS_SETJMP_H 1
  9. #if !defined _SETJMP_H && !defined _PTHREAD_H
  10. # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
  11. #endif
  12. /*
  13. jmp_buf[0] - A0StP
  14. jmp_buf[1] - A1GbP
  15. jmp_buf[2] - A0FrP
  16. jmp_buf[3] - A1LbP
  17. jmp_buf[4] - D0FrT
  18. jmp_buf[5] - D1RtP
  19. jmp_buf[6] - D0.5
  20. jmp_buf[7] - D1.5
  21. jmp_buf[8] - D0.6
  22. jmp_buf[9] - D1.6
  23. jmp_buf[10] - D0.7
  24. jmp_buf[11] - D1.7
  25. */
  26. #define _JBLEN 24
  27. #if defined (__USE_MISC) || defined (_ASM)
  28. #define JB_SP 0
  29. #endif
  30. #ifndef _ASM
  31. typedef int __jmp_buf[_JBLEN] __attribute__((aligned (8)));
  32. #endif
  33. /* Test if longjmp to JMPBUF would unwind the frame
  34. containing a local variable at ADDRESS. */
  35. #define _JMPBUF_UNWINDS(jmpbuf, address) \
  36. ((void *) (address) > (void *) (jmpbuf)[JB_SP])
  37. #endif /* bits/setjmp.h */