Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame^] | 1 | #ifndef _UCONTEXT_H |
| 2 | #define _UCONTEXT_H |
| 3 | #ifdef __cplusplus |
| 4 | extern "C" { |
| 5 | #endif |
| 6 | |
| 7 | #include <signal.h> |
| 8 | |
| 9 | struct __fpstate { |
| 10 | unsigned long __x[7]; |
| 11 | unsigned char __y[80]; |
| 12 | unsigned long __z; |
| 13 | }; |
| 14 | |
| 15 | typedef struct { |
| 16 | unsigned long __gregs[19]; |
| 17 | void *__fpregs; |
| 18 | unsigned long __oldmask, __cr2; |
| 19 | } mcontext_t; |
| 20 | |
| 21 | typedef struct __ucontext { |
| 22 | unsigned long uc_flags; |
| 23 | struct __ucontext *uc_link; |
| 24 | stack_t uc_stack; |
| 25 | mcontext_t uc_mcontext; |
| 26 | sigset_t uc_sigmask; |
| 27 | struct __fpstate __fpregs_mem; |
| 28 | } ucontext_t; |
| 29 | |
| 30 | int getcontext(ucontext_t *); |
| 31 | void makecontext(ucontext_t *, void (*)(void), int, ...); |
| 32 | int setcontext(const ucontext_t *); |
| 33 | int swapcontext(ucontext_t *, const ucontext_t *); |
| 34 | |
| 35 | #ifdef __cplusplus |
| 36 | } |
| 37 | #endif |
| 38 | #endif |