]> git.saurik.com Git - apple/xnu.git/blob - bsd/net/netisr.c
2ae5be8eb967d12751bfdceb3f02708eb7fac6fc
[apple/xnu.git] / bsd / net / netisr.c
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * Mach Operating System
24 * Copyright (c) 1987 Carnegie-Mellon University
25 * All rights reserved. The CMU software License Agreement specifies
26 * the terms and conditions for use and redistribution.
27 */
28
29 /* HISTORY
30 * 18-May-90 Avadis Tevanian (avie) at NeXT
31 * Changed to use sensible priorities (higher numbers -> higher pri).
32 *
33 * 1-Feb-88 David Golub (dbg) at Carnegie-Mellon University
34 * Goofed... netisr thread must run at splnet, because the routines
35 * it calls expect to be called from the softnet interrupt (at
36 * splnet).
37 *
38 * 19-Nov-87 David Golub (dbg) at Carnegie-Mellon University
39 * Created.
40 *
41 */
42
43 /*
44 * netisr.c
45 *
46 * Kernel thread for network code.
47 */
48
49
50 #include <meta_features.h>
51 #include <machine/spl.h>
52 #include <net/netisr.h>
53
54 #include <kern/thread.h>
55 #include <kern/processor.h>
56
57 volatile int netisr;
58
59
60 void run_netisr(void)
61 {
62 spl_t spl = splnet();
63
64 while (netisr != 0) {
65 #ifdef NIMP
66 #if NIMP > 0
67 if (netisr & (1<<NETISR_IMP)){
68 netisr &= ~(1<<NETISR_IMP);
69 impintr();
70 }
71 #endif /* NIMP > 0 */
72 #endif /* NIMP */
73
74 #if INET
75 if (netisr & (1<<NETISR_IP)){
76 void ipintr(void);
77
78 netisr &= ~(1<<NETISR_IP);
79 ipintr();
80 }
81 if (netisr & (1<<NETISR_ARP)) {
82 void arpintr(void);
83
84 netisr &= ~(1<<NETISR_ARP);
85 arpintr();
86 }
87 #endif /* INET */
88
89 #if INET6
90 if (netisr & (1<<NETISR_IPV6)){
91 void ip6intr(void);
92
93 netisr &= ~(1<<NETISR_IPV6);
94 ip6intr();
95 }
96 #endif /* INET6 */
97
98 #if ISO
99 if (netisr & (1<<NETISR_ISO)) {
100 netisr &= ~(1<<NETISR_ISO);
101 isointr();
102 }
103 #endif /* ISO */
104
105 #if CCITT
106 if (netisr & (1<<NETISR_CCITT)) {
107 netisr &= ~(1<<NETISR_CCITT);
108 ccittintr();
109 }
110 #endif /* CCITT */
111
112 #if NS
113 if (netisr & (1<<NETISR_NS)){
114 netisr &= ~(1<<NETISR_NS);
115 nsintr();
116 }
117 #endif /* NS */
118
119 #if NETAT
120 if (netisr & (1<<NETISR_APPLETALK)){
121 void atalkintr(void);
122
123 netisr &= ~(1<<NETISR_APPLETALK);
124 atalkintr();
125 }
126 #endif /* NETAT */
127 }
128
129 splx(spl);
130
131 return;
132 }
133