1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-27 16:39:08 +00:00

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
This commit is contained in:
Mateusz Guzik 2014-11-01 22:36:40 +00:00
parent 4c8d4de868
commit cdcf242896
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273953
3 changed files with 4 additions and 2 deletions

View File

@ -320,7 +320,8 @@ static struct syscall_module_data pmc_syscall_mod = {
NULL,
&pmc_syscall_num,
&pmc_sysent,
{ 0, NULL }
{ 0, NULL },
SY_THR_STATIC_KLD,
};
static moduledata_t pmc_mod = {

View File

@ -160,7 +160,7 @@ syscall_module_handler(struct module *mod, int what, void *arg)
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;

View File

@ -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) \