]> granicus.if.org Git - zfs/commitdiff
Add default case to lua kernel code
authorMatthew Macy <mmacy@freebsd.org>
Thu, 17 Oct 2019 01:36:16 +0000 (18:36 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 17 Oct 2019 01:36:15 +0000 (18:36 -0700)
Some platforms, e.g. FreeBSD, support user space setjmp
semantics in kernel.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9450

module/lua/ldo.c

index 59d0b6a2c298846f6bf242e87ca2736a44da44e2..3b0ece171c58e87788955a7faa515be283b3d253 100644 (file)
@@ -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 */