1 /*
2  * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
3  *
4  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
5  */
6 
7 #include <setjmp.h>
8 #include <jmpbuf-offsets.h>
9 
10 /* Test if longjmp to JMPBUF would unwind the frame
11    containing a local variable at ADDRESS.  */
12 #define _JMPBUF_UNWINDS(jmpbuf, address) \
13   ((int) (address) < (jmpbuf)[JB_SP])
14 
15 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
16 #include <setjmp.h>
17 #include <stdint.h>
18 #include <unwind.h>
19 
20 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
21   _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
22 
23 #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
24   ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
25 #endif
26