blob: 018b3819ab0bf3ea4fc3007a8240b6b7f99c8dca [file] [log] [blame]
Jeff Dike1d7173b2006-01-18 17:42:49 -08001#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 Dikec83d4632006-01-18 17:42:50 -08008 longjmp(*buf, val); \
Jeff Dike1d7173b2006-01-18 17:42:49 -08009} while(0)
10
11#define UML_SIGSETJMP(buf, enable) ({ \
12 int n; \
13 enable = get_signals(); \
Jeff Dikec83d4632006-01-18 17:42:50 -080014 n = setjmp(*buf); \
Jeff Dike1d7173b2006-01-18 17:42:49 -080015 if(n != 0) \
16 set_signals(enable); \
17 n; })
18
19#endif