Slimmer setjmps
[akaros.git] / kern / include / setjmp.h
1 // Kernel implementations for setjmp/longjmp.
2
3 #ifndef ROS_SETJMP_H
4 #define ROS_SETJMP_H
5
6 #include <arch/setjmp.h>
7
8 int slim_setjmp(struct jmpbuf *env) __attribute__((returns_twice));
9 void longjmp(struct jmpbuf *env, int val) __attribute__((noreturn));
10
11 #define setjmp(jb) ({bool err;                                                 \
12                     __ros_clobber_callee_regs();                               \
13                     err = slim_setjmp(jb);                                     \
14                     err;})
15
16 #endif /* !ROS_SETJMP_H */