Index: sys/compat/netbsd32/netbsd32_compat_16.c =================================================================== RCS file: /cvsroot/src/sys/compat/netbsd32/netbsd32_compat_16.c,v retrieving revision 1.6 diff -p -u -r1.6 netbsd32_compat_16.c --- sys/compat/netbsd32/netbsd32_compat_16.c 18 Aug 2024 18:42:57 -0000 1.6 +++ sys/compat/netbsd32/netbsd32_compat_16.c 28 Oct 2024 21:18:36 -0000 @@ -48,23 +48,39 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_com struct uvm_object *emul_netbsd32_object; +#if defined(__amd64__) || defined(__arm__) || defined(__mips__) || defined(__sparc64__) +#define __HAVE_MD_NETBSD32_SIGRETURN14 +#endif + +#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) || defined(__riscv__) +#define __HAVE_MD_NETBSD32_SIGCODE +#endif + + +#ifdef __HAVE_MD_NETBSD32_SIGRETURN14 static const struct syscall_package netbsd32_kern_sig_16_syscalls[] = { - /* compat_16_netbs32___sigreturn14 is in MD code! */ + /* compat_16_netbsd32___sigreturn14 is in MD code! */ { NETBSD32_SYS_compat_16_netbsd32___sigreturn14, 0, (sy_call_t *)compat_16_netbsd32___sigreturn14 }, { 0, 0, NULL } }; +#endif static int compat_netbsd32_16_init(void) { +#if defined(__HAVE_MD_NETBSD32_SIGRETURN14) || defined(__HAVE_MD_NETBSD32_SIGCODE) int error; +#endif +#ifdef __HAVE_MD_NETBSD32_SIGRETURN14 error = syscall_establish(&emul_netbsd32, netbsd32_kern_sig_16_syscalls); if (error) return error; +#endif +#ifdef __HAVE_MD_NETBSD32_SIGCODE rw_enter(&exec_lock, RW_WRITER); emul_netbsd32.e_sigcode = netbsd32_sigcode; emul_netbsd32.e_esigcode = netbsd32_esigcode; @@ -79,15 +95,19 @@ compat_netbsd32_16_init(void) if (error) return error; netbsd32_machdep_md_16_init(); +#endif return 0; } static int compat_netbsd32_16_fini(void) { +#if defined(__HAVE_MD_NETBSD32_SIGRETURN14) proc_t *p; int error; +#endif +#ifdef __HAVE_MD_NETBSD32_SIGRETURN14 error = syscall_disestablish(&emul_netbsd32, netbsd32_kern_sig_16_syscalls); if (error) @@ -110,7 +130,9 @@ compat_netbsd32_16_fini(void) netbsd32_kern_sig_16_syscalls); return EBUSY; } +#endif +#ifdef __HAVE_MD_NETBSD32_SIGCODE rw_enter(&exec_lock, RW_WRITER); exec_sigcode_free(&emul_netbsd); emul_netbsd32.e_sigcode = NULL; @@ -118,6 +140,7 @@ compat_netbsd32_16_fini(void) emul_netbsd32.e_sigobject = NULL; rw_exit(&exec_lock); netbsd32_machdep_md_16_fini(); +#endif return 0; } Index: sys/compat/netbsd32/netbsd32_signal.c =================================================================== RCS file: /cvsroot/src/sys/compat/netbsd32/netbsd32_signal.c,v retrieving revision 1.54 diff -p -u -r1.54 netbsd32_signal.c --- sys/compat/netbsd32/netbsd32_signal.c 29 Apr 2024 14:56:01 -0000 1.54 +++ sys/compat/netbsd32/netbsd32_signal.c 28 Oct 2024 21:18:36 -0000 @@ -214,8 +214,8 @@ netbsd32___sigaction_sigtramp(struct lwp if (!sigcontext_valid) { return EINVAL; } -#else /* ! __HAVE_STRUCT_SIGCONTEXT */ - return EINVAL; +// #else /* ! __HAVE_STRUCT_SIGCONTEXT */ +// return EINVAL; #endif /* __HAVE_STRUCT_SIGCONTEXT */ } #endif /* __HAVE_MD_NETBSD32_SENDSIG */