Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1d7173ba JD |
2 | #ifndef __UML_LONGJMP_H |
3 | #define __UML_LONGJMP_H | |
4 | ||
37185b33 AV |
5 | #include <sysdep/archsetjmp.h> |
6 | #include <os.h> | |
1d7173ba | 7 | |
13c06be3 JD |
8 | extern int setjmp(jmp_buf); |
9 | extern void longjmp(jmp_buf, int); | |
10 | ||
ad28e029 | 11 | #define UML_LONGJMP(buf, val) do { \ |
c83d4635 | 12 | longjmp(*buf, val); \ |
1d7173ba JD |
13 | } while(0) |
14 | ||
a5df0d1a | 15 | #define UML_SETJMP(buf) ({ \ |
b5cdb579 PBG |
16 | int n; \ |
17 | volatile int enable; \ | |
1d7173ba | 18 | enable = get_signals(); \ |
c83d4635 | 19 | n = setjmp(*buf); \ |
1d7173ba JD |
20 | if(n != 0) \ |
21 | set_signals(enable); \ | |
22 | n; }) | |
23 | ||
24 | #endif |