Rather than keeping a separate mutex, condvar, and pserialize for each

module hook, we can share a common set of synchronization structures.
This cuts the amount of cacheline_aligned data for these structures by
50%.

Note that we still have a per-hook localcount, since we need to count
individual references.

As discussed with riastradh@

Welcome to 9.99.22 !
This commit is contained in:
pgoyette 2019-12-12 02:15:42 +00:00
parent 1b7d31b19d
commit 8a031a1d1e
48 changed files with 186 additions and 201 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.132 2019/11/27 09:16:58 rin Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.133 2019/12/12 02:15:42 pgoyette Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.132 2019/11/27 09:16:58 rin Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.133 2019/12/12 02:15:42 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -1030,10 +1030,10 @@ void
netbsd32_machdep_md_init(void)
{
MODULE_HOOK_SET(netbsd32_machine32_hook, "mach32", netbsd32_machine32);
MODULE_HOOK_SET(netbsd32_machine32_hook, netbsd32_machine32);
MODULE_HOOK_SET(netbsd32_reg_validate_hook,
"mcontext32from64_validate", cpu_mcontext32from64_validate);
MODULE_HOOK_SET(netbsd32_process_doxmmregs_hook, "xmm32",
cpu_mcontext32from64_validate);
MODULE_HOOK_SET(netbsd32_process_doxmmregs_hook,
netbsd32_process_doxmmregs);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep_16.c,v 1.4 2019/11/13 16:11:27 pgoyette Exp $ */
/* $NetBSD: netbsd32_machdep_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.4 2019/11/13 16:11:27 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -250,7 +250,7 @@ void
netbsd32_machdep_md_16_init(void)
{
MODULE_HOOK_SET(netbsd32_sendsig_hook, "nb32_16", netbsd32_sendsig_16);
MODULE_HOOK_SET(netbsd32_sendsig_hook, netbsd32_sendsig_16);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.19 2019/11/20 19:37:52 pgoyette Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.20 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.19 2019/11/20 19:37:52 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.20 2019/12/12 02:15:42 pgoyette Exp $");
#include "opt_compat_netbsd.h"
@ -328,7 +328,7 @@ void
netbsd32_machdep_md_init(void)
{
MODULE_HOOK_SET(netbsd32_machine32_hook, "mach32", netbsd32_machine32);
MODULE_HOOK_SET(netbsd32_machine32_hook, netbsd32_machine32);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep_16.c,v 1.4 2019/11/13 16:11:27 pgoyette Exp $ */
/* $NetBSD: netbsd32_machdep_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.4 2019/11/13 16:11:27 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
#include "opt_compat_netbsd.h"
@ -98,7 +98,7 @@ void
netbsd32_machdep_md_16_init(void)
{
MODULE_HOOK_SET(netbsd32_sendsig_hook, "nb32_16", netbsd32_sendsig_16);
MODULE_HOOK_SET(netbsd32_sendsig_hook, netbsd32_sendsig_16);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.114 2019/11/20 19:37:53 pgoyette Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.115 2019/12/12 02:15:42 pgoyette Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.114 2019/11/20 19:37:53 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.115 2019/12/12 02:15:42 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -1027,7 +1027,7 @@ void
netbsd32_machdep_md_init(void)
{
MODULE_HOOK_SET(netbsd32_machine32_hook, "mach32", netbsd32_machine32);
MODULE_HOOK_SET(netbsd32_machine32_hook, netbsd32_machine32);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep_16.c,v 1.3 2019/03/01 11:06:55 pgoyette Exp $ */
/* $NetBSD: netbsd32_machdep_16.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.3 2019/03/01 11:06:55 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -352,7 +352,7 @@ void
netbsd32_machdep_md_16_init(void)
{
MODULE_HOOK_SET(netbsd32_sendsig_hook, "nb32_16", netbsd32_sendsig_16);
MODULE_HOOK_SET(netbsd32_sendsig_hook, netbsd32_sendsig_16);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bio_30.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: bio_30.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $ */
/* $OpenBSD: bio.c,v 1.9 2007/03/20 02:35:55 marco Exp $ */
/*
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bio_30.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: bio_30.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -96,7 +96,7 @@ void
bio_30_init(void)
{
MODULE_HOOK_SET(compat_bio_30_hook, "bio_30", compat_30_bio);
MODULE_HOOK_SET(compat_bio_30_hook, compat_30_bio);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: ccd_60.c,v 1.10 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: ccd_60.c,v 1.11 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@ -26,7 +26,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ccd_60.c,v 1.10 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: ccd_60.c,v 1.11 2019/12/12 02:15:42 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -95,7 +95,7 @@ void
ccd_60_init(void)
{
MODULE_HOOK_SET(ccd_ioctl_60_hook, "ccd_60", compat_60_ccdioctl);
MODULE_HOOK_SET(ccd_ioctl_60_hook, compat_60_ccdioctl);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: clockctl_50.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: clockctl_50.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: clockctl_50.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: clockctl_50.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -130,8 +130,7 @@ void
clockctl_50_init(void)
{
MODULE_HOOK_SET(clockctl_ioctl_50_hook, "clk_50",
compat50_clockctlioctl);
MODULE_HOOK_SET(clockctl_ioctl_50_hook, compat50_clockctlioctl);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_sysv_50_mod.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: compat_sysv_50_mod.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: compat_sysv_50_mod.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: compat_sysv_50_mod.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -75,8 +75,7 @@ compat_sysv_50_modcmd(modcmd_t cmd, void *arg)
if (error != 0) {
break;
}
MODULE_HOOK_SET(sysvipc_sysctl_50_hook, "sysv50",
sysctl_kern_sysvipc50);
MODULE_HOOK_SET(sysvipc_sysctl_50_hook, sysctl_kern_sysvipc50);
break;
case MODULE_CMD_FINI:

View File

@ -1,4 +1,4 @@
/* $NetBSD: ieee80211_20.c,v 1.5 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: ieee80211_20.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@ -36,7 +36,7 @@
__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.35 2005/08/30 14:27:47 avatar Exp $");
#endif
#ifdef __NetBSD__
__KERNEL_RCSID(0, "$NetBSD: ieee80211_20.c,v 1.5 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: ieee80211_20.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $");
#endif
/*
@ -119,7 +119,7 @@ void
ieee80211_20_init(void)
{
MODULE_HOOK_SET(ieee80211_ioctl_20_hook, "ieee20", ieee80211_20_ioctl);
MODULE_HOOK_SET(ieee80211_ioctl_20_hook, ieee80211_20_ioctl);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: if43_20.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: if43_20.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if43_20.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: if43_20.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -83,7 +83,7 @@ void
if43_20_init(void)
{
MODULE_HOOK_SET(if43_cvtcmd_20_hook, "if4320", if43_cvtcmd_20);
MODULE_HOOK_SET(if43_cvtcmd_20_hook, if43_cvtcmd_20);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_43.c,v 1.23 2019/09/23 06:53:09 maxv Exp $ */
/* $NetBSD: if_43.c,v 1.24 2019/12/12 02:15:42 pgoyette Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1990, 1993
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.23 2019/09/23 06:53:09 maxv Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.24 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -299,8 +299,8 @@ int
if_43_init(void)
{
MODULE_HOOK_SET(if_cvtcmd_43_hook, "if_43", do_compat_cvtcmd);
MODULE_HOOK_SET(if_ifioctl_43_hook, "if_43", compat_ifioctl);
MODULE_HOOK_SET(if_cvtcmd_43_hook, do_compat_cvtcmd);
MODULE_HOOK_SET(if_ifioctl_43_hook, compat_ifioctl);
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_media_80.c,v 1.2 2019/09/26 01:28:27 christos Exp $ */
/* $NetBSD: if_media_80.c,v 1.3 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -177,10 +177,8 @@ void
ifmedia_80_init(void)
{
MODULE_HOOK_SET(ifmedia_80_pre_hook, "ifmedia80",
compat_ifmediareq_pre);
MODULE_HOOK_SET(ifmedia_80_post_hook, "ifmedia80",
compat_ifmediareq_post);
MODULE_HOOK_SET(ifmedia_80_pre_hook, compat_ifmediareq_pre);
MODULE_HOOK_SET(ifmedia_80_post_hook, compat_ifmediareq_post);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_spppsubr50.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: if_spppsubr50.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_spppsubr50.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_spppsubr50.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@ -158,7 +158,7 @@ void
if_spppsubr_50_init(void)
{
MODULE_HOOK_SET(sppp_params_50_hook, "sppp60", sppp_compat50_params);
MODULE_HOOK_SET(sppp_params_50_hook, sppp_compat50_params);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_mod_80.c,v 1.5 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: kern_mod_80.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_mod_80.c,v 1.5 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_mod_80.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -158,7 +158,7 @@ void
kern_mod_80_init(void)
{
MODULE_HOOK_SET(compat_modstat_80_hook, "mod_80",compat_80_modstat);
MODULE_HOOK_SET(compat_modstat_80_hook, compat_80_modstat);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sig_16.c,v 1.4 2019/11/10 13:28:06 pgoyette Exp $ */
/* $NetBSD: kern_sig_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_sig_16.c,v 1.4 2019/11/10 13:28:06 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_sig_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -156,8 +156,7 @@ kern_sig_16_init(void)
emul_netbsd.e_esigcode = esigcode;
emul_netbsd.e_sigobject = &emul_netbsd_object;
rw_exit(&exec_lock);
MODULE_HOOK_SET(sendsig_sigcontext_16_hook, "sndsig16",
sendsig_sigcontext);
MODULE_HOOK_SET(sendsig_sigcontext_16_hook, sendsig_sigcontext);
#endif
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_uipc_socket_50.c,v 1.3 2019/09/27 00:32:03 pgoyette Exp $ */
/* $NetBSD: kern_uipc_socket_50.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $ */
/*
* Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_uipc_socket_50.c,v 1.3 2019/09/27 00:32:03 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_uipc_socket_50.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -233,12 +233,9 @@ void
kern_uipc_socket_50_init(void)
{
MODULE_HOOK_SET(uipc_socket_50_setopt1_hook, "sockop_50",
uipc_socket_50_setopt1);
MODULE_HOOK_SET(uipc_socket_50_getopt1_hook, "sockop_50",
uipc_socket_50_getopt1);
MODULE_HOOK_SET(uipc_socket_50_sbts_hook, "sbts_50",
uipc_socket_50_sbts);
MODULE_HOOK_SET(uipc_socket_50_setopt1_hook, uipc_socket_50_setopt1);
MODULE_HOOK_SET(uipc_socket_50_getopt1_hook, uipc_socket_50_getopt1);
MODULE_HOOK_SET(uipc_socket_50_sbts_hook, uipc_socket_50_sbts);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: rndpseudo_50.c,v 1.5 2019/09/26 01:28:27 christos Exp $ */
/* $NetBSD: rndpseudo_50.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rndpseudo_50.c,v 1.5 2019/09/26 01:28:27 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rndpseudo_50.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -125,7 +125,7 @@ void
rndpseudo_50_init(void)
{
MODULE_HOOK_SET(rnd_ioctl_50_hook, "rnd_50", compat_50_rnd_ioctl);
MODULE_HOOK_SET(rnd_ioctl_50_hook, compat_50_rnd_ioctl);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtsock_14.c,v 1.8 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: rtsock_14.c,v 1.9 2019/12/12 02:15:42 pgoyette Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rtsock_14.c,v 1.8 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: rtsock_14.c,v 1.9 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -177,8 +177,8 @@ void
rtsock_14_init(void)
{
MODULE_HOOK_SET(rtsock_oifmsg_14_hook, "rts_14", compat_14_rt_oifmsg);
MODULE_HOOK_SET(rtsock_iflist_14_hook, "rts_14", compat_14_iflist);
MODULE_HOOK_SET(rtsock_oifmsg_14_hook, compat_14_rt_oifmsg);
MODULE_HOOK_SET(rtsock_iflist_14_hook, compat_14_iflist);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtsock_50.c,v 1.14 2019/10/04 05:48:11 msaitoh Exp $ */
/* $NetBSD: rtsock_50.c,v 1.15 2019/12/12 02:15:42 pgoyette Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.14 2019/10/04 05:48:11 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.15 2019/12/12 02:15:42 pgoyette Exp $");
#define COMPAT_RTSOCK /* Use the COMPATNAME/COMPATCALL macros and the
* various other compat definitions - see
@ -155,20 +155,17 @@ void
rtsock_50_init(void)
{
MODULE_HOOK_SET(rtsock_iflist_50_hook, "rts_50", compat_50_iflist);
MODULE_HOOK_SET(rtsock_oifmsg_50_hook, "rts_50", compat_50_rt_oifmsg);
MODULE_HOOK_SET(rtsock_rt_missmsg_50_hook, "rts_50",
compat_50_rt_missmsg);
MODULE_HOOK_SET(rtsock_rt_ifmsg_50_hook, "rts_50", compat_50_rt_ifmsg);
MODULE_HOOK_SET(rtsock_rt_addrmsg_rt_50_hook, "rts_50",
compat_50_rt_addrmsg_rt);
MODULE_HOOK_SET(rtsock_rt_addrmsg_src_50_hook, "rts_50",
MODULE_HOOK_SET(rtsock_iflist_50_hook, compat_50_iflist);
MODULE_HOOK_SET(rtsock_oifmsg_50_hook, compat_50_rt_oifmsg);
MODULE_HOOK_SET(rtsock_rt_missmsg_50_hook, compat_50_rt_missmsg);
MODULE_HOOK_SET(rtsock_rt_ifmsg_50_hook, compat_50_rt_ifmsg);
MODULE_HOOK_SET(rtsock_rt_addrmsg_rt_50_hook, compat_50_rt_addrmsg_rt);
MODULE_HOOK_SET(rtsock_rt_addrmsg_src_50_hook,
compat_50_rt_addrmsg_src);
MODULE_HOOK_SET(rtsock_rt_addrmsg_50_hook, "rts_50",
compat_50_rt_addrmsg);
MODULE_HOOK_SET(rtsock_rt_ifannouncemsg_50_hook, "rts_50",
MODULE_HOOK_SET(rtsock_rt_addrmsg_50_hook, compat_50_rt_addrmsg);
MODULE_HOOK_SET(rtsock_rt_ifannouncemsg_50_hook,
compat_50_rt_ifannouncemsg);
MODULE_HOOK_SET(rtsock_rt_ieee80211msg_50_hook, "rts_50",
MODULE_HOOK_SET(rtsock_rt_ieee80211msg_50_hook,
compat_50_rt_ieee80211msg);
sysctl_net_route_setup(&clog, PF_OROUTE, "ortable");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtsock_70.c,v 1.7 2019/04/29 08:31:29 pgoyette Exp $ */
/* $NetBSD: rtsock_70.c,v 1.8 2019/12/12 02:15:42 pgoyette Exp $ */
/*
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rtsock_70.c,v 1.7 2019/04/29 08:31:29 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: rtsock_70.c,v 1.8 2019/12/12 02:15:42 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -119,9 +119,8 @@ void
rtsock_70_init(void)
{
MODULE_HOOK_SET(rtsock_newaddr_70_hook, "rts_70",
compat_70_rt_newaddrmsg1);
MODULE_HOOK_SET(rtsock_iflist_70_hook, "rts_70", compat_70_iflist_addr);
MODULE_HOOK_SET(rtsock_newaddr_70_hook, compat_70_rt_newaddrmsg1);
MODULE_HOOK_SET(rtsock_iflist_70_hook, compat_70_iflist_addr);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysmon_power_40.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: sysmon_power_40.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2007 Juan Romero Pardines.
@ -62,7 +62,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sysmon_power_40.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: sysmon_power_40.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -96,8 +96,7 @@ void
sysmon_power_40_init(void)
{
MODULE_HOOK_SET(compat_sysmon_power_40_hook, "smon60",
compat_40_sysmon_power);
MODULE_HOOK_SET(compat_sysmon_power_40_hook, compat_40_sysmon_power);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty_43.c,v 1.34 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: tty_43.c,v 1.35 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.34 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.35 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -518,7 +518,7 @@ ttcompatsetlflags(struct tty *tp, struct termios *t)
int
kern_tty_43_init(void)
{
MODULE_HOOK_SET(tty_ttioctl_43_hook, "tty_43", compat_43_ttioctl);
MODULE_HOOK_SET(tty_ttioctl_43_hook, compat_43_ttioctl);
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty_60.c,v 1.8 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: tty_60.c,v 1.9 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tty_60.c,v 1.8 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: tty_60.c,v 1.9 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -123,8 +123,8 @@ void
kern_tty_60_init(void)
{
MODULE_HOOK_SET(tty_ttioctl_60_hook, "tty_60", compat_60_ttioctl);
MODULE_HOOK_SET(tty_ptmioctl_60_hook, "tty_60", compat_60_ptmioctl);
MODULE_HOOK_SET(tty_ttioctl_60_hook, compat_60_ttioctl);
MODULE_HOOK_SET(tty_ptmioctl_60_hook, compat_60_ptmioctl);
}
void

View File

@ -1,9 +1,9 @@
/* $NetBSD: uipc_syscalls_40.c,v 1.20 2019/04/23 07:45:06 msaitoh Exp $ */
/* $NetBSD: uipc_syscalls_40.c,v 1.21 2019/12/12 02:15:42 pgoyette Exp $ */
/* written by Pavel Cahyna, 2006. Public domain. */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.20 2019/04/23 07:45:06 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.21 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -168,7 +168,7 @@ void
uipc_syscalls_40_init(void)
{
MODULE_HOOK_SET(uipc_syscalls_40_hook, "uipc40", compat_ifconf);
MODULE_HOOK_SET(uipc_syscalls_40_hook, compat_ifconf);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_syscalls_50.c,v 1.8 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: uipc_syscalls_50.c,v 1.9 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -116,7 +116,7 @@ void
uipc_syscalls_50_init(void)
{
MODULE_HOOK_SET(uipc_syscalls_50_hook, "uipc50", compat_ifdatareq);
MODULE_HOOK_SET(uipc_syscalls_50_hook, compat_ifdatareq);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_usrreq_70.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: uipc_usrreq_70.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq_70.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq_70.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -77,8 +77,7 @@ void
uipc_usrreq_70_init(void)
{
MODULE_HOOK_SET(uipc_unp_70_hook, "unp_70",
compat_70_unp_addsockcred);
MODULE_HOOK_SET(uipc_unp_70_hook, compat_70_unp_addsockcred);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb_subr_30.c,v 1.5 2019/09/26 01:28:27 christos Exp $ */
/* $NetBSD: usb_subr_30.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: usb_subr_30.c,v 1.5 2019/09/26 01:28:27 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: usb_subr_30.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -233,9 +233,8 @@ void
usb_30_init(void)
{
MODULE_HOOK_SET(usb_subr_fill_30_hook, "usb_30",
usbd_fill_deviceinfo_old);
MODULE_HOOK_SET(usb_subr_copy_30_hook, "usb_30", usb_copy_to_old30);
MODULE_HOOK_SET(usb_subr_fill_30_hook, usbd_fill_deviceinfo_old);
MODULE_HOOK_SET(usb_subr_copy_30_hook, usb_copy_to_old30);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_syscalls_10.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: vfs_syscalls_10.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_10.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_10.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -55,7 +55,7 @@ real_sys_openat_10(struct pathbuf **pb)
void vfs_syscalls_10_init(void)
{
MODULE_HOOK_SET(vfs_openat_10_hook, "openat_10", real_sys_openat_10);
MODULE_HOOK_SET(vfs_openat_10_hook, real_sys_openat_10);
}
void vfs_syscalls_10_fini(void)

View File

@ -1,4 +1,4 @@
/* $NetBSD: vnd_30.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: vnd_30.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vnd_30.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: vnd_30.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -123,7 +123,7 @@ void
vnd_30_init(void)
{
MODULE_HOOK_SET(compat_vndioctl_30_hook, "vnd_30", compat_30_vndioctl);
MODULE_HOOK_SET(compat_vndioctl_30_hook, compat_30_vndioctl);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: vnd_50.c,v 1.4 2019/04/14 11:35:54 pgoyette Exp $ */
/* $NetBSD: vnd_50.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vnd_50.c,v 1.4 2019/04/14 11:35:54 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: vnd_50.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -122,7 +122,7 @@ void
vnd_50_init(void)
{
MODULE_HOOK_SET(compat_vndioctl_50_hook, "vnd_50", compat_50_vndioctl);
MODULE_HOOK_SET(compat_vndioctl_50_hook, compat_50_vndioctl);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_compat_50.c,v 1.41 2019/10/05 14:19:53 kamil Exp $ */
/* $NetBSD: netbsd32_compat_50.c,v 1.42 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.41 2019/10/05 14:19:53 kamil Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.42 2019/12/12 02:15:42 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -1058,7 +1058,7 @@ compat_netbsd32_50_modcmd(modcmd_t cmd, void *arg)
ret = syscall_establish(&emul_netbsd32,
compat_netbsd32_50_syscalls);
if (ret == 0)
MODULE_HOOK_SET(rnd_ioctl32_50_hook, "rnd32_50",
MODULE_HOOK_SET(rnd_ioctl32_50_hook,
compat32_50_rnd_ioctl);
return ret;

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_compat_80.c,v 1.5 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: netbsd32_compat_80.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.5 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $");
#include <sys/param.h>
#include <sys/dirent.h>
@ -183,8 +183,7 @@ compat_netbsd32_80_modcmd(modcmd_t cmd, void *arg)
switch (cmd) {
case MODULE_CMD_INIT:
MODULE_HOOK_SET(compat32_80_modctl_hook, "nb32_modctl_80",
netbsd32_80_modctl);
MODULE_HOOK_SET(compat32_80_modctl_hook, netbsd32_80_modctl);
return 0;
case MODULE_CMD_FINI:

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_kern_proc.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: netbsd32_kern_proc.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_kern_proc.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_kern_proc.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_kstack.h"
@ -139,9 +139,8 @@ netbsd32_kern_proc_32_init(void)
{
#if !defined(_RUMPSERVER)
MODULE_HOOK_SET(kern_proc32_copyin_hook, "kern_proc_32",
copyin_psstrings_32);
MODULE_HOOK_SET(kern_proc32_base_hook, "kern_proc_32", get_base32);
MODULE_HOOK_SET(kern_proc32_copyin_hook, copyin_psstrings_32);
MODULE_HOOK_SET(kern_proc32_base_hook, get_base32);
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos_mod.c,v 1.6 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: sunos_mod.c,v 1.7 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sunos_mod.c,v 1.6 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: sunos_mod.c,v 1.7 2019/12/12 02:15:42 pgoyette Exp $");
#include <sys/param.h>
#include <sys/module.h>
@ -74,8 +74,7 @@ compat_sunos_modcmd(modcmd_t cmd, void *arg)
switch (cmd) {
case MODULE_CMD_INIT:
MODULE_HOOK_SET(get_emul_sunos_hook, "sun_emul",
get_sunos_emul);
MODULE_HOOK_SET(get_emul_sunos_hook, get_sunos_emul);
return exec_add(&sunos_execsw, 1);
case MODULE_CMD_FINI:

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos32_mod.c,v 1.6 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: sunos32_mod.c,v 1.7 2019/12/12 02:15:42 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sunos32_mod.c,v 1.6 2019/03/01 11:06:56 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: sunos32_mod.c,v 1.7 2019/12/12 02:15:42 pgoyette Exp $");
#include <sys/param.h>
#include <sys/module.h>
@ -77,8 +77,7 @@ compat_sunos_modcmd(modcmd_t cmd, void *arg)
switch (cmd) {
case MODULE_CMD_INIT:
MODULE_HOOK_SET(get_emul_sunos_hook, "sun_emul",
get_sunos_emul);
MODULE_HOOK_SET(get_emul_sunos_hook, get_sunos_emul);
return exec_add(&sunos_execsw, 1);
case MODULE_CMD_FINI:

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_compat32.c,v 1.6 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: rf_compat32.c,v 1.7 2019/12/12 02:15:43 pgoyette Exp $ */
/*
* Copyright (c) 2017 Matthew R. Green
@ -166,7 +166,7 @@ static void
raidframe_netbsd32_init(void)
{
MODULE_HOOK_SET(raidframe_netbsd32_ioctl_hook, "raid32",
MODULE_HOOK_SET(raidframe_netbsd32_ioctl_hook,
raidframe_netbsd32_ioctl);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_compat50.c,v 1.11 2019/09/26 01:36:10 christos Exp $ */
/* $NetBSD: rf_compat50.c,v 1.12 2019/12/12 02:15:43 pgoyette Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -240,7 +240,7 @@ static void
raidframe_50_init(void)
{
MODULE_HOOK_SET(raidframe_ioctl_50_hook, "raid50", raidframe_ioctl_50);
MODULE_HOOK_SET(raidframe_ioctl_50_hook, raidframe_ioctl_50);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_compat80.c,v 1.13 2019/03/01 11:06:56 pgoyette Exp $ */
/* $NetBSD: rf_compat80.c,v 1.14 2019/12/12 02:15:43 pgoyette Exp $ */
/*
* Copyright (c) 2017 Matthew R. Green
@ -348,7 +348,7 @@ static void
raidframe_80_init(void)
{
MODULE_HOOK_SET(raidframe_ioctl_80_hook, "raid80", raidframe_ioctl_80);
MODULE_HOOK_SET(raidframe_ioctl_80_hook, raidframe_ioctl_80);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsevent_50.c,v 1.4 2019/03/01 11:06:57 pgoyette Exp $ */
/* $NetBSD: wsevent_50.c,v 1.5 2019/12/12 02:15:43 pgoyette Exp $ */
/*-
* Copyright (c) 2006, 2008 The NetBSD Foundation, Inc.
@ -104,7 +104,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wsevent_50.c,v 1.4 2019/03/01 11:06:57 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: wsevent_50.c,v 1.5 2019/12/12 02:15:43 pgoyette Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -148,7 +148,7 @@ void
wsevent_50_init(void)
{
MODULE_HOOK_SET(wscons_copyout_events_50_hook, "wsc_50",
MODULE_HOOK_SET(wscons_copyout_events_50_hook,
wsevent_copyout_events50);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_compat.c,v 1.7 2019/03/01 11:06:57 pgoyette Exp $ */
/* $NetBSD: puffs_compat.c,v 1.8 2019/12/12 02:15:43 pgoyette Exp $ */
/*
* Copyright (c) 2010 Antti Kantee. All Rights Reserved.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: puffs_compat.c,v 1.7 2019/03/01 11:06:57 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: puffs_compat.c,v 1.8 2019/12/12 02:15:43 pgoyette Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@ -439,8 +439,8 @@ puffs_compat_incoming(struct puffs_req *preq, struct puffs_req *creq)
void puffs_50_init(void)
{
MODULE_HOOK_SET(puffs_out_50_hook, "pffs50", puffs_compat_outgoing);
MODULE_HOOK_SET(puffs_in_50_hook, "pffs50", puffs_compat_incoming);
MODULE_HOOK_SET(puffs_out_50_hook, puffs_compat_outgoing);
MODULE_HOOK_SET(puffs_in_50_hook, puffs_compat_incoming);
}
void puffs_50_fini(void)

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_core.c,v 1.28 2019/11/20 19:37:53 pgoyette Exp $ */
/* $NetBSD: kern_core.c,v 1.29 2019/12/12 02:15:43 pgoyette Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.28 2019/11/20 19:37:53 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.29 2019/12/12 02:15:43 pgoyette Exp $");
#include <sys/param.h>
#include <sys/vnode.h>
@ -73,16 +73,13 @@ coredump_modcmd(modcmd_t cmd, void *arg)
switch (cmd) {
case MODULE_CMD_INIT:
MODULE_HOOK_SET(coredump_hook, "coredump", coredump);
MODULE_HOOK_SET(coredump_write_hook, "coredump",
coredump_write);
MODULE_HOOK_SET(coredump_offset_hook, "coredump",
coredump_offset);
MODULE_HOOK_SET(coredump_netbsd_hook, "coredump",
real_coredump_netbsd);
MODULE_HOOK_SET(uvm_coredump_walkmap_hook, "coredump",
MODULE_HOOK_SET(coredump_hook, coredump);
MODULE_HOOK_SET(coredump_write_hook, coredump_write);
MODULE_HOOK_SET(coredump_offset_hook, coredump_offset);
MODULE_HOOK_SET(coredump_netbsd_hook, real_coredump_netbsd);
MODULE_HOOK_SET(uvm_coredump_walkmap_hook,
uvm_coredump_walkmap);
MODULE_HOOK_SET(uvm_coredump_count_segs_hook, "coredump",
MODULE_HOOK_SET(uvm_coredump_count_segs_hook,
uvm_coredump_count_segs);
return 0;
case MODULE_CMD_FINI:

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_module.c,v 1.138 2019/08/08 18:08:41 pgoyette Exp $ */
/* $NetBSD: kern_module.c,v 1.139 2019/12/12 02:15:43 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.138 2019/08/08 18:08:41 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.139 2019/12/12 02:15:43 pgoyette Exp $");
#define _MODULE_INTERNAL
@ -127,6 +127,12 @@ static int sysctl_module_autotime(SYSCTLFN_PROTO);
static void module_callback_load(struct module *);
static void module_callback_unload(struct module *);
/* Locking/synchronization stuff for module hooks */
kmutex_t module_hook_mtx;
kcondvar_t module_hook_cv;
pserialize_t module_hook_psz;
#define MODULE_CLASS_MATCH(mi, modclass) \
((modclass) == MODULE_CLASS_ANY || (modclass) == (mi)->mi_class)
@ -444,6 +450,10 @@ module_init(void)
module_netbsd = module_newmodule(MODULE_SOURCE_KERNEL);
module_netbsd->mod_refcnt = 1;
module_netbsd->mod_info = &module_netbsd_modinfo;
mutex_init(&module_hook_mtx, MUTEX_DEFAULT, IPL_NONE);
cv_init(&module_hook_cv, "mod_hook");
module_hook_psz = pserialize_create();
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_vlan.c,v 1.148 2019/11/11 02:34:46 yamaguchi Exp $ */
/* $NetBSD: if_vlan.c,v 1.149 2019/12/12 02:15:43 pgoyette Exp $ */
/*
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.148 2019/11/11 02:34:46 yamaguchi Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.149 2019/12/12 02:15:43 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -280,7 +280,7 @@ vlaninit(void)
if_clone_attach(&vlan_cloner);
vlan_hash_init();
MODULE_HOOK_SET(if_vlan_vlan_input_hook, "vlan_inp", vlan_input);
MODULE_HOOK_SET(if_vlan_vlan_input_hook, vlan_input);
}
static int

View File

@ -1,4 +1,4 @@
/* $NetBSD: ocryptodev.c,v 1.13 2019/03/01 11:06:57 pgoyette Exp $ */
/* $NetBSD: ocryptodev.c,v 1.14 2019/12/12 02:15:43 pgoyette Exp $ */
/* $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $ */
/* $OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $ */
@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ocryptodev.c,v 1.13 2019/03/01 11:06:57 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: ocryptodev.c,v 1.14 2019/12/12 02:15:43 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -291,7 +291,7 @@ static void
crypto_50_init(void)
{
MODULE_HOOK_SET(ocryptof_50_hook, "cryp50", ocryptof_ioctl);
MODULE_HOOK_SET(ocryptof_50_hook, ocryptof_ioctl);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: module_hook.h,v 1.4 2019/12/03 13:48:25 pgoyette Exp $ */
/* $NetBSD: module_hook.h,v 1.5 2019/12/12 02:15:43 pgoyette Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@ -47,14 +47,15 @@
#define MODULE_HOOK(hook, type, args) \
extern struct hook ## _t { \
kmutex_t mtx; \
kcondvar_t cv; \
struct localcount lc; \
pserialize_t psz; \
bool hooked; \
type (*f)args; \
} hook __cacheline_aligned;
extern kmutex_t module_hook_mtx;
extern kcondvar_t module_hook_cv;
extern pserialize_t module_hook_psz;
/*
* We use pserialize_perform() to issue a memory barrier on the current
* CPU and on all other CPUs so that all prior memory operations on the
@ -66,19 +67,17 @@ extern struct hook ## _t { \
* work without any other memory barriers.
*/
#define MODULE_HOOK_SET(hook, waitchan, func) \
#define MODULE_HOOK_SET(hook, func) \
do { \
\
KASSERT(kernconfig_is_held()); \
KASSERT(!hook.hooked); \
\
hook.psz = pserialize_create(); \
mutex_init(&hook.mtx, MUTEX_DEFAULT, IPL_NONE); \
cv_init(&hook.cv, waitchan); \
localcount_init(&hook.lc); \
hook.f = func; \
\
/* Make sure it's initialized before anyone uses it */ \
pserialize_perform(hook.psz); \
pserialize_perform(module_hook_psz); \
\
/* Let them use it */ \
atomic_store_relaxed(&hook.hooked, true); \
@ -92,7 +91,7 @@ do { \
KASSERT(hook.f); \
\
/* Grab the mutex */ \
mutex_enter(&hook.mtx); \
mutex_enter(&module_hook_mtx); \
\
/* Prevent new localcount_acquire calls. */ \
atomic_store_relaxed(&hook.hooked, false); \
@ -101,17 +100,15 @@ do { \
* Wait for localcount_acquire calls already under way \
* to finish. \
*/ \
pserialize_perform(hook.psz); \
pserialize_perform(module_hook_psz); \
\
/* Wait for existing localcount references to drain. */\
localcount_drain(&hook.lc, &hook.cv, &hook.mtx); \
localcount_drain(&hook.lc, &module_hook_cv, \
&module_hook_mtx); \
\
/* Release the mutex and clean up all resources */ \
mutex_exit(&hook.mtx); \
mutex_exit(&module_hook_mtx); \
localcount_fini(&hook.lc); \
cv_destroy(&hook.cv); \
mutex_destroy(&hook.mtx); \
pserialize_destroy(hook.psz); \
} while /* CONSTCOND */ (0)
#define MODULE_HOOK_CALL(hook, args, default, retval) \
@ -128,8 +125,8 @@ do { \
\
if (__hooked) { \
retval = (*hook.f)args; \
localcount_release(&hook.lc, &hook.cv, \
&hook.mtx); \
localcount_release(&hook.lc, &module_hook_cv, \
&module_hook_mtx); \
} else { \
retval = default; \
} \
@ -149,8 +146,8 @@ do { \
\
if (__hooked) { \
(*hook.f)args; \
localcount_release(&hook.lc, &hook.cv, \
&hook.mtx); \
localcount_release(&hook.lc, &module_hook_cv, \
&module_hook_mtx); \
} else { \
default; \
} \

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.622 2019/12/08 13:19:59 mlelstv Exp $ */
/* $NetBSD: param.h,v 1.623 2019/12/12 02:15:43 pgoyette Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@ -67,7 +67,7 @@
* 2.99.9 (299000900)
*/
#define __NetBSD_Version__ 999002100 /* NetBSD 9.99.21 */
#define __NetBSD_Version__ 999002200 /* NetBSD 9.99.22 */
#define __NetBSD_Prereq__(M,m,p) (((((M) * 100000000) + \
(m) * 1000000) + (p) * 100) <= __NetBSD_Version__)