aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-10-16 18:36:16 -0700
committerBrian Behlendorf <[email protected]>2019-10-16 18:36:15 -0700
commitcf2eba666e6b959a9705de27c0203a2aad93c7b9 (patch)
tree557ac3521b346fd8245e82ef93b7b6c145bb8931 /module
parent47d57dbccf5693b327342ec045b66bcf5a47e655 (diff)
Add default case to lua kernel code
Some platforms, e.g. FreeBSD, support user space setjmp semantics in kernel. Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9450
Diffstat (limited to 'module')
-rw-r--r--module/lua/ldo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/module/lua/ldo.c b/module/lua/ldo.c
index 59d0b6a2c..3b0ece171 100644
--- a/module/lua/ldo.c
+++ b/module/lua/ldo.c
@@ -46,6 +46,7 @@
#ifdef _KERNEL
+#ifdef __linux__
#if defined(__i386__)
#define JMP_BUF_CNT 6
#elif defined(__x86_64__)
@@ -85,6 +86,11 @@ void longjmp (label_t * buf) {
for (;;);
}
#endif
+#else
+#define LUAI_THROW(L,c) longjmp((c)->b, 1)
+#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a }
+#define luai_jmpbuf jmp_buf
+#endif
#else /* _KERNEL */