Date: Sat, 1 Nov 2014 22:36:41 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273953 - in head/sys: dev/hwpmc kern sys Message-ID: <201411012236.sA1Mafe2089791@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sat Nov 1 22:36:40 2014 New Revision: 273953 URL: https://svnweb.freebsd.org/changeset/base/273953 Log: Fix up module unload for syscall_module_handler consumers. After r273707 it was registering syscalls as static. This fixes hwpmc module unload. Reported by: markj Modified: head/sys/dev/hwpmc/hwpmc_mod.c head/sys/kern/kern_syscalls.c head/sys/sys/sysent.h Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat Nov 1 22:00:46 2014 (r273952) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat Nov 1 22:36:40 2014 (r273953) @@ -320,7 +320,8 @@ static struct syscall_module_data pmc_sy NULL, &pmc_syscall_num, &pmc_sysent, - { 0, NULL } + { 0, NULL }, + SY_THR_STATIC_KLD, }; static moduledata_t pmc_mod = { Modified: head/sys/kern/kern_syscalls.c ============================================================================== --- head/sys/kern/kern_syscalls.c Sat Nov 1 22:00:46 2014 (r273952) +++ head/sys/kern/kern_syscalls.c Sat Nov 1 22:36:40 2014 (r273953) @@ -160,7 +160,7 @@ syscall_module_handler(struct module *mo switch (what) { case MOD_LOAD: error = syscall_register(data->offset, data->new_sysent, - &data->old_sysent, SY_THR_STATIC_KLD); + &data->old_sysent, data->flags); if (error) { /* Leave a mark so we know to safely unload below. */ data->offset = NULL; Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Sat Nov 1 22:00:46 2014 (r273952) +++ head/sys/sys/sysent.h Sat Nov 1 22:36:40 2014 (r273953) @@ -175,6 +175,7 @@ struct syscall_module_data { int *offset; /* offset into sysent */ struct sysent *new_sysent; /* new sysent */ struct sysent old_sysent; /* old sysent */ + int flags; /* flags for syscall_register */ }; #define MAKE_SYSENT(syscallname) \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411012236.sA1Mafe2089791>