Index: sys/compat/common/kern_sig_16.c =================================================================== RCS file: /cvsroot/src/sys/compat/common/kern_sig_16.c,v retrieving revision 1.8 diff -p -u -r1.8 kern_sig_16.c --- sys/compat/common/kern_sig_16.c 2 Dec 2021 04:26:09 -0000 1.8 +++ sys/compat/common/kern_sig_16.c 2 Nov 2024 20:35:32 -0000 @@ -93,8 +93,17 @@ __KERNEL_RCSID(0, "$NetBSD: kern_sig_16. #include -#if !defined(__amd64__) || defined(COMPAT_NETBSD32) -#define COMPAT_SIGCONTEXT +#ifdef COMPAT_NETBSD32 +# ifndef __aarch64__ +# define COMPAT_SIGCONTEXT +# endif +#else /* COMPAT_NETBSD32 */ +# if !defined(__amd64__) && !defined(__aarch64__) +# define COMPAT_SIGCONTEXT +# endif +#endif /* COMPAT_NETBSD32 */ + +#ifdef COMPAT_SIGCONTEXT extern char sigcode[], esigcode[]; struct uvm_object *emul_netbsd_object; #endif Index: sys/compat/netbsd32/netbsd32_compat_16.c =================================================================== RCS file: /cvsroot/src/sys/compat/netbsd32/netbsd32_compat_16.c,v retrieving revision 1.4.4.1 diff -p -u -r1.4.4.1 netbsd32_compat_16.c --- sys/compat/netbsd32/netbsd32_compat_16.c 26 Oct 2024 15:56:31 -0000 1.4.4.1 +++ sys/compat/netbsd32/netbsd32_compat_16.c 2 Nov 2024 20:35:32 -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.53.4.1 diff -p -u -r1.53.4.1 netbsd32_signal.c --- sys/compat/netbsd32/netbsd32_signal.c 26 Oct 2024 15:56:31 -0000 1.53.4.1 +++ sys/compat/netbsd32/netbsd32_signal.c 2 Nov 2024 20:35:32 -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 */