sparc64: add basic support
[uclibc-ng.git] / libc / sysdeps / linux / arc / jmpbuf-unwind.h
blobd16506a465e24bbb80a70b7054ad91cdc7ff6eb3
1 /*
2 * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
4 * Licensed under LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
5 */
7 #include <setjmp.h>
8 #include <jmpbuf-offsets.h>
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[__JMP_BUF_SP]))
15 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
16 #include <stdint.h>
17 #include <unwind.h>
19 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
20 _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
22 #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
23 ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[__JMP_BUF_SP] - (_adj))
24 #endif