Bit ops
[akaros.git] / kern / include / setjmp.h
index c6c612e..2fb30b5 100644 (file)
@@ -5,7 +5,17 @@
 
 #include <arch/setjmp.h>
 
-int setjmp(struct jmpbuf *env) __attribute__((returns_twice));
-void longjmp(struct jmpbuf *env, void * val) __attribute__((noreturn));
+int slim_setjmp(struct jmpbuf *env) __attribute__((returns_twice));
+void longjmp(struct jmpbuf *env, int val) __attribute__((noreturn));
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+
+#define setjmp(jb) ({bool err;                                                 \
+                    __ros_clobber_callee_regs();                               \
+                    err = slim_setjmp(jb);                                     \
+                    err;})
+
+#pragma GCC diagnostic pop
 
 #endif /* !ROS_SETJMP_H */