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 ((void *) (address) < (void *) (jmpbuf)[JB_GPR1]) 14 15 #ifdef __UCLIBC_HAS_THREADS_NATIVE__ 16 #include <stdint.h> 17 #include <unwind.h> 18 19 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ 20 _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj) 21 22 #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \ 23 ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_GPR1] - (_adj)) 24 #endif 25