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:
parent
4c8d4de868
commit
cdcf242896
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273953
@ -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 = {
|
||||
|
@ -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;
|
||||
|
@ -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) \
|
||||
|
Loading…
Reference in New Issue
Block a user