svn commit: r273953 - in head/sys: dev/hwpmc kern sys

Mateusz Guzik mjg at FreeBSD.org
Sat Nov 1 22:36:42 UTC 2014


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


More information about the svn-src-all mailing list