xref: /original-bsd/sys/net/netisr.h (revision 3705696b)
1 /*
2  * Copyright (c) 1980, 1986, 1989, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)netisr.h	8.1 (Berkeley) 06/10/93
8  */
9 
10 /*
11  * The networking code runs off software interrupts.
12  *
13  * You can switch into the network by doing splnet() and return by splx().
14  * The software interrupt level for the network is higher than the software
15  * level for the clock (so you can enter the network in routines called
16  * at timeout time).
17  */
18 #if defined(vax) || defined(tahoe)
19 #define	setsoftnet()	mtpr(SIRR, 12)
20 #endif
21 
22 /*
23  * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
24  * word which is used to de-multiplex a single software
25  * interrupt used for scheduling the network code to calls
26  * on the lowest level routine of each protocol.
27  */
28 #define	NETISR_RAW	0		/* same as AF_UNSPEC */
29 #define	NETISR_IP	2		/* same as AF_INET */
30 #define	NETISR_IMP	3		/* same as AF_IMPLINK */
31 #define	NETISR_NS	6		/* same as AF_NS */
32 #define	NETISR_ISO	7		/* same as AF_ISO */
33 #define	NETISR_CCITT	10		/* same as AF_CCITT */
34 #define	NETISR_ARP	18		/* same as AF_LINK */
35 
36 #define	schednetisr(anisr)	{ netisr |= 1<<(anisr); setsoftnet(); }
37 
38 #ifdef i386
39 /* XXX Temporary -- soon to vanish - wfj */
40 #define	NETISR_SCLK	11		/* softclock */
41 #define	NETISR_AST	12		/* ast -- resched */
42 
43 #undef	schednetisr
44 #define	schednetisr(anisr)	{\
45 	if(netisr == 0) { \
46 		softem++; \
47 	} \
48 	netisr |= 1<<(anisr); \
49 }
50 #ifndef LOCORE
51 #ifdef KERNEL
52 int	softem;
53 #endif
54 #endif
55 #endif /* i386 */
56 
57 #ifndef LOCORE
58 #ifdef KERNEL
59 int	netisr;				/* scheduling bits for network */
60 #endif
61 #endif
62