Jeff Dike | 1d7173b | 2006-01-18 17:42:49 -0800 | [diff] [blame] | 1 | #ifndef __UML_LONGJMP_H |
| 2 | #define __UML_LONGJMP_H |
| 3 | |
| 4 | #include <setjmp.h> |
| 5 | #include "os.h" |
| 6 | |
| 7 | #define UML_SIGLONGJMP(buf, val) do { \ |
Jeff Dike | c83d463 | 2006-01-18 17:42:50 -0800 | [diff] [blame] | 8 | longjmp(*buf, val); \ |
Jeff Dike | 1d7173b | 2006-01-18 17:42:49 -0800 | [diff] [blame] | 9 | } while(0) |
| 10 | |
| 11 | #define UML_SIGSETJMP(buf, enable) ({ \ |
| 12 | int n; \ |
| 13 | enable = get_signals(); \ |
Jeff Dike | c83d463 | 2006-01-18 17:42:50 -0800 | [diff] [blame] | 14 | n = setjmp(*buf); \ |
Jeff Dike | 1d7173b | 2006-01-18 17:42:49 -0800 | [diff] [blame] | 15 | if(n != 0) \ |
| 16 | set_signals(enable); \ |
| 17 | n; }) |
| 18 | |
| 19 | #endif |