Add default case to lua kernel code

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
This commit is contained in:
Matthew Macy 2019-10-16 18:36:16 -07:00 committed by Brian Behlendorf
parent 47d57dbccf
commit cf2eba666e
1 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,7 @@
#ifdef _KERNEL #ifdef _KERNEL
#ifdef __linux__
#if defined(__i386__) #if defined(__i386__)
#define JMP_BUF_CNT 6 #define JMP_BUF_CNT 6
#elif defined(__x86_64__) #elif defined(__x86_64__)
@ -85,6 +86,11 @@ void longjmp (label_t * buf) {
for (;;); for (;;);
} }
#endif #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 */ #else /* _KERNEL */