diff options
Diffstat (limited to 'sys/kern/uipc_domain.c')
-rw-r--r-- | sys/kern/uipc_domain.c | 55 |
1 files changed, 19 insertions, 36 deletions
diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 88322d5..dd0602e 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -59,17 +59,12 @@ __FBSDID("$FreeBSD$"); */ static void domaininit(void *); -SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL); +SYSINIT(domain, SI_SUB_PROTO_DOMAININIT, SI_ORDER_ANY, domaininit, NULL); static void domainfinalize(void *); SYSINIT(domainfin, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST, domainfinalize, NULL); -static vnet_attach_fn net_init_domain; -#ifdef VIMAGE -static vnet_detach_fn net_detach_domain; -#endif - static struct callout pffast_callout; static struct callout pfslow_callout; @@ -106,15 +101,6 @@ struct pr_usrreqs nousrreqs = { .pru_sopoll = pru_sopoll_notsupp, }; -#ifdef VIMAGE -vnet_modinfo_t vnet_domain_modinfo = { - .vmi_id = VNET_MOD_DOMAIN, - .vmi_name = "domain", - .vmi_iattach = net_init_domain, - .vmi_idetach = net_detach_domain, -}; -#endif - static void protosw_init(struct protosw *pr) { @@ -174,10 +160,10 @@ protosw_init(struct protosw *pr) * Note: you cant unload it again because a socket may be using it. * XXX can't fail at this time. */ -static int -net_init_domain(const void *arg) +void +domain_init(void *arg) { - const struct domain *dp = arg; + struct domain *dp = arg; struct protosw *pr; if (dp->dom_init) @@ -191,17 +177,21 @@ net_init_domain(const void *arg) max_datalen = MHLEN - max_hdr; if (max_datalen < 1) panic("%s: max_datalen < 1", __func__); - return (0); } #ifdef VIMAGE -/* - * Detach / free a domain instance. - */ -static int -net_detach_domain(const void *arg) +void +vnet_domain_init(void *arg) +{ + + /* Virtualized case is no different -- call init functions. */ + domain_init(arg); +} + +void +vnet_domain_uninit(void *arg) { - const struct domain *dp = arg; + struct domain *dp = arg; struct protosw *pr; for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) @@ -209,8 +199,6 @@ net_detach_domain(const void *arg) (*pr->pr_destroy)(); if (dp->dom_destroy) (*dp->dom_destroy)(); - - return (0); } #endif @@ -220,7 +208,7 @@ net_detach_domain(const void *arg) * XXX can't fail at this time. */ void -net_add_domain(void *data) +domain_add(void *data) { struct domain *dp; @@ -234,24 +222,19 @@ net_add_domain(void *data) dp->dom_name)); #ifndef INVARIANTS if (domain_init_status < 1) - printf("WARNING: attempt to net_add_domain(%s) before " + printf("WARNING: attempt to domain_add(%s) before " "domaininit()\n", dp->dom_name); #endif #ifdef notyet KASSERT(domain_init_status < 2, - ("attempt to net_add_domain(%s) after domainfinalize()", + ("attempt to domain_add(%s) after domainfinalize()", dp->dom_name)); #else if (domain_init_status >= 2) - printf("WARNING: attempt to net_add_domain(%s) after " + printf("WARNING: attempt to domain_add(%s) after " "domainfinalize()\n", dp->dom_name); #endif mtx_unlock(&dom_mtx); -#ifdef VIMAGE - vnet_mod_register_multi(&vnet_domain_modinfo, dp, dp->dom_name); -#else - net_init_domain(dp); -#endif } static void |