jmpbuf-unwind.h 698 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright (C) 2017 Hangzhou C-SKY Microsystems co.,ltd.
  3. *
  4. * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB
  5. * in this tarball.
  6. */
  7. #include <setjmp.h>
  8. #include <stdint.h>
  9. #include <unwind.h>
  10. /* Test if longjmp to JMPBUF would unwind the frame
  11. containing a local variable at ADDRESS. */
  12. #define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
  13. ((void *) (address) < (void *) demangle (jmpbuf[0].__sp))
  14. #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
  15. _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
  16. #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
  17. ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf[0].__sp) - (_adj))