From ffe0b4102e0be2a64a091976ded9653109f05e1e Mon Sep 17 00:00:00 2001 From: pgoyette Date: Fri, 10 Aug 2018 21:44:58 +0000 Subject: Allow syscall_establish() to install new syscalls when the existing entry-point is either sys_nomodule or sys_nosys. Update the makesyscalls.sh script to create a const array of bits to allow syscall_disestablish() to properly restore the original entry-point. Update all the initializers of struct emul to initialize the pointer to the bit array struct emul. XXX Regen of all files created by makesyscalls.sh will come soon, XXX followed by a kernel version bump (since struct emul is being XXX modified). This commit should address PR kern/45781 and also removes the need for the work-around for that PR in file sys/arch/usermode/modules/syscallemu/syscallemu.c --- sys/compat/linux/common/linux_exec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/compat/linux/common/linux_exec.c') diff --git a/sys/compat/linux/common/linux_exec.c b/sys/compat/linux/common/linux_exec.c index 3e0eb52bfa8..5c841cfc9e5 100644 --- a/sys/compat/linux/common/linux_exec.c +++ b/sys/compat/linux/common/linux_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec.c,v 1.119 2018/05/06 13:40:51 kamil Exp $ */ +/* $NetBSD: linux_exec.c,v 1.120 2018/08/10 21:44:58 pgoyette Exp $ */ /*- * Copyright (c) 1994, 1995, 1998, 2000, 2007, 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.119 2018/05/06 13:40:51 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.120 2018/08/10 21:44:58 pgoyette Exp $"); #include #include @@ -70,6 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.119 2018/05/06 13:40:51 kamil Exp $ #include extern struct sysent linux_sysent[]; +extern const uint32_t linux_sysent_nomodbits[]; extern const char * const linux_syscallnames[]; extern char linux_sigcode[], linux_esigcode[]; @@ -89,6 +90,7 @@ struct emul emul_linux = { .e_nsysent = LINUX_SYS_NSYSENT, #endif .e_sysent = linux_sysent, + .e_nomodbits = linux_sysent_nomodbits, .e_syscallnames = linux_syscallnames, .e_sendsig = linux_sendsig, .e_trapsignal = linux_trapsignal, -- cgit