blob: 4cc66d8c206dc7916f6bfd6d1843e54a70ead2b4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// non-local return
// exception handling, basically a stack of setjmp/longjmp buffers
#include <limits.h>
typedef struct _nlr_buf_t nlr_buf_t;
struct _nlr_buf_t {
// the entries here must all be machine word size
nlr_buf_t *prev;
void *ret_val;
#if defined(__i386__)
void *regs[6];
#elif defined(__x86_64__)
void *regs[8];
#elif defined(__thumb2__)
void *regs[10];
#else
#error Unknown arch in nlr.h
#endif
};
unsigned int nlr_push(nlr_buf_t *);
void nlr_pop(void);
void nlr_jump(void *val) __attribute__((noreturn));
|