xref: /csrg-svn/sys/net/netisr.h (revision 33183)
123159Smckusick /*
229065Smckusick  * Copyright (c) 1980, 1986 Regents of the University of California.
3*33183Sbostic  * All rights reserved.
423159Smckusick  *
5*33183Sbostic  * Redistribution and use in source and binary forms are permitted
6*33183Sbostic  * provided that this notice is preserved and that due credit is given
7*33183Sbostic  * to the University of California at Berkeley. The name of the University
8*33183Sbostic  * may not be used to endorse or promote products derived from this
9*33183Sbostic  * software without specific prior written permission. This software
10*33183Sbostic  * is provided ``as is'' without express or implied warranty.
11*33183Sbostic  *
12*33183Sbostic  *	@(#)netisr.h	7.3 (Berkeley) 12/30/87
1323159Smckusick  */
148387Swnj 
158387Swnj /*
168387Swnj  * The networking code runs off software interrupts.
178387Swnj  *
188387Swnj  * You can switch into the network by doing splnet() and return by splx().
198387Swnj  * The software interrupt level for the network is higher than the software
208387Swnj  * level for the clock (so you can enter the network in routines called
218387Swnj  * at timeout time).
228387Swnj  */
2329922Skarels #if defined(vax) || defined(tahoe)
248387Swnj #define	setsoftnet()	mtpr(SIRR, 12)
258973Sroot #endif
268387Swnj 
278387Swnj /*
288387Swnj  * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
298387Swnj  * word which is used to de-multiplex a single software
308387Swnj  * interrupt used for scheduling the network code to calls
318387Swnj  * on the lowest level routine of each protocol.
328387Swnj  */
338387Swnj #define	NETISR_RAW	0		/* same as AF_UNSPEC */
348387Swnj #define	NETISR_IP	2		/* same as AF_INET */
3524146Skarels #define	NETISR_IMP	3		/* same as AF_IMPLINK */
368387Swnj #define	NETISR_NS	6		/* same as AF_NS */
378387Swnj 
388387Swnj #define	schednetisr(anisr)	{ netisr |= 1<<(anisr); setsoftnet(); }
398387Swnj 
408387Swnj #ifndef LOCORE
418387Swnj #ifdef KERNEL
428387Swnj int	netisr;				/* scheduling bits for network */
438387Swnj #endif
448387Swnj #endif
45