Deleted Added
full compact
uipc_domain.c (10080) uipc_domain.c (10358)
1/*
2 * Copyright (c) 1982, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93
1/*
2 * Copyright (c) 1982, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)uipc_domain.c 8.2 (Berkeley) 10/18/93
34 * $Id: uipc_domain.c,v 1.6 1995/05/11 00:16:44 wollman Exp $
34 * $Id: uipc_domain.c,v 1.7 1995/08/16 16:13:21 bde Exp $
35 */
36
37#include <sys/param.h>
38#include <sys/socket.h>
39#include <sys/protosw.h>
40#include <sys/domain.h>
41#include <sys/mbuf.h>
42#include <sys/time.h>
43#include <sys/kernel.h>
44#include <sys/systm.h>
45#include <sys/proc.h>
46#include <vm/vm.h>
47#include <sys/sysctl.h>
48
35 */
36
37#include <sys/param.h>
38#include <sys/socket.h>
39#include <sys/protosw.h>
40#include <sys/domain.h>
41#include <sys/mbuf.h>
42#include <sys/time.h>
43#include <sys/kernel.h>
44#include <sys/systm.h>
45#include <sys/proc.h>
46#include <vm/vm.h>
47#include <sys/sysctl.h>
48
49/*
50 * System initialization
51 *
52 * Note: domain initialization wants to take place on a per domain basis
53 * as a result of traversing a linker set. Most likely, each domain
54 * want to call a registration function rather than being handled here
55 * in domaininit(). Probably this will look like:
56 *
57 * SYSINIT(unique, SI_SUB_PROTO_DOMAI, SI_ORDER_ANY, domain_add, (caddr_t)xxx)
58 *
59 * Where 'xxx' is replaced by the address of a parameter struct to be
60 * passed to the doamin_add() function.
61 */
62
63static int x_save_spl; /* used by kludge*/
64static void kludge_splimp __P((caddr_t));
65static void kludge_splx __P((caddr_t));
66static void domaininit __P((caddr_t));
67SYSINIT(splimp, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, kludge_splimp, (caddr_t)&x_save_spl)
68SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL)
69SYSINIT(splx, SI_SUB_PROTO_END, SI_ORDER_FIRST, kludge_splx, (caddr_t)&x_save_spl)
70
71
49void pffasttimo __P((void *));
50void pfslowtimo __P((void *));
51
52struct domain *domains;
53
54#define ADDDOMAIN(x) { \
55 __CONCAT(x,domain.dom_next) = domains; \
56 domains = &__CONCAT(x,domain); \
57}
58
59extern struct linker_set domain_set;
60
72void pffasttimo __P((void *));
73void pfslowtimo __P((void *));
74
75struct domain *domains;
76
77#define ADDDOMAIN(x) { \
78 __CONCAT(x,domain.dom_next) = domains; \
79 domains = &__CONCAT(x,domain); \
80}
81
82extern struct linker_set domain_set;
83
61void
62domaininit()
84/* ARGSUSED*/
85static void
86domaininit( udata)
87caddr_t udata; /* not used*/
63{
64 register struct domain *dp, **dpp;
65 register struct protosw *pr;
66
67 /*
68 * NB - local domain is always present.
69 */
70 ADDDOMAIN(local);

--- 20 unchanged lines hidden (view full) ---

91 if (max_linkhdr < 16) /* XXX */
92 max_linkhdr = 16;
93 max_hdr = max_linkhdr + max_protohdr;
94 max_datalen = MHLEN - max_hdr;
95 timeout(pffasttimo, (void *)0, 1);
96 timeout(pfslowtimo, (void *)0, 1);
97}
98
88{
89 register struct domain *dp, **dpp;
90 register struct protosw *pr;
91
92 /*
93 * NB - local domain is always present.
94 */
95 ADDDOMAIN(local);

--- 20 unchanged lines hidden (view full) ---

116 if (max_linkhdr < 16) /* XXX */
117 max_linkhdr = 16;
118 max_hdr = max_linkhdr + max_protohdr;
119 max_datalen = MHLEN - max_hdr;
120 timeout(pffasttimo, (void *)0, 1);
121 timeout(pfslowtimo, (void *)0, 1);
122}
123
124
125/*
126 * The following two operations are kludge code. Most likely, they should
127 * be done as a "domainpreinit()" for the first function and then rolled
128 * in as the last act of "domaininit()" for the second.
129 *
130 * In point of fact, it is questionable why other initialization prior
131 * to this does not also take place at splimp by default.
132 */
133static void
134kludge_splimp( udata)
135caddr_t udata;
136{
137 int *savesplp = (int *)udata;
138
139 *savesplp = splimp();
140}
141
142static void
143kludge_splx( udata)
144caddr_t udata;
145{
146 int *savesplp = (int *)udata;
147
148 splx( *savesplp);
149}
150
151
152
99struct protosw *
100pffindtype(family, type)
101 int family, type;
102{
103 register struct domain *dp;
104 register struct protosw *pr;
105
106 for (dp = domains; dp; dp = dp->dom_next)

--- 115 unchanged lines hidden ---
153struct protosw *
154pffindtype(family, type)
155 int family, type;
156{
157 register struct domain *dp;
158 register struct protosw *pr;
159
160 for (dp = domains; dp; dp = dp->dom_next)

--- 115 unchanged lines hidden ---