summaryrefslogtreecommitdiff
path: root/src/user/lib/include/setjmp.h
diff options
context:
space:
mode:
authordzwdz2022-08-29 17:44:19 +0200
committerdzwdz2022-08-29 17:44:19 +0200
commiteb22cd070c4d255b1069aae5b331845de2ed1b94 (patch)
treeadb97869a9e6a0853527ddd5aceaedf4a1ae17eb /src/user/lib/include/setjmp.h
parent4ae57a7fb13e68c5e6f1c1246a867555dbd986db (diff)
user/libc: setjmp
Diffstat (limited to 'src/user/lib/include/setjmp.h')
-rw-r--r--src/user/lib/include/setjmp.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/user/lib/include/setjmp.h b/src/user/lib/include/setjmp.h
index 51c7fd2..298939c 100644
--- a/src/user/lib/include/setjmp.h
+++ b/src/user/lib/include/setjmp.h
@@ -1,24 +1,17 @@
#pragma once
#include <user/lib/panic.h>
-typedef char jmp_buf[1];
+typedef uint64_t jmp_buf[8]; /* rbx, rsp, rbp, r12, r13, r14, r15, rip */
typedef char sigjmp_buf[1];
-static inline int setjmp(jmp_buf env) {
- (void)env;
- return 0;
-}
+int setjmp(jmp_buf env);
+_Noreturn void longjmp(jmp_buf env, int val);
static inline int sigsetjmp(sigjmp_buf env, int savemask) {
(void)env; (void)savemask;
return 0;
}
-static inline _Noreturn void longjmp(jmp_buf env, int val) {
- (void)env; (void)val;
- __libc_panic("unimplemented");
-}
-
static inline _Noreturn void siglongjmp(sigjmp_buf env, int val) {
(void)env; (void)val;
__libc_panic("unimplemented");