xref: /original-bsd/sys/net/netisr.h (revision de3f5c4e)
1 /*
2  * Copyright (c) 1980, 1986, 1989 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)netisr.h	7.8 (Berkeley) 05/07/91
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 
35 #define	schednetisr(anisr)	{ netisr |= 1<<(anisr); setsoftnet(); }
36 
37 #ifdef i386
38 /* XXX Temporary -- soon to vanish - wfj */
39 #define	NETISR_SCLK	11		/* softclock */
40 #define	NETISR_AST	12		/* ast -- resched */
41 
42 #undef	schednetisr
43 #define	schednetisr(anisr)	{\
44 	if(netisr == 0) { \
45 		softem++; \
46 	} \
47 	netisr |= 1<<(anisr); \
48 }
49 #ifndef LOCORE
50 #ifdef KERNEL
51 int	softem;
52 #endif
53 #endif
54 #endif /* i386 */
55 
56 #ifndef LOCORE
57 #ifdef KERNEL
58 int	netisr;				/* scheduling bits for network */
59 #endif
60 #endif
61