xref: /csrg-svn/sys/net/netisr.h (revision 34844)
123159Smckusick /*
229065Smckusick  * Copyright (c) 1980, 1986 Regents of the University of California.
333183Sbostic  * All rights reserved.
423159Smckusick  *
533183Sbostic  * Redistribution and use in source and binary forms are permitted
6*34844Sbostic  * provided that the above copyright notice and this paragraph are
7*34844Sbostic  * duplicated in all such forms and that any documentation,
8*34844Sbostic  * advertising materials, and other materials related to such
9*34844Sbostic  * distribution and use acknowledge that the software was developed
10*34844Sbostic  * by the University of California, Berkeley.  The name of the
11*34844Sbostic  * University may not be used to endorse or promote products derived
12*34844Sbostic  * from this software without specific prior written permission.
13*34844Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*34844Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*34844Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1633183Sbostic  *
17*34844Sbostic  *	@(#)netisr.h	7.4 (Berkeley) 06/27/88
1823159Smckusick  */
198387Swnj 
208387Swnj /*
218387Swnj  * The networking code runs off software interrupts.
228387Swnj  *
238387Swnj  * You can switch into the network by doing splnet() and return by splx().
248387Swnj  * The software interrupt level for the network is higher than the software
258387Swnj  * level for the clock (so you can enter the network in routines called
268387Swnj  * at timeout time).
278387Swnj  */
2829922Skarels #if defined(vax) || defined(tahoe)
298387Swnj #define	setsoftnet()	mtpr(SIRR, 12)
308973Sroot #endif
318387Swnj 
328387Swnj /*
338387Swnj  * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
348387Swnj  * word which is used to de-multiplex a single software
358387Swnj  * interrupt used for scheduling the network code to calls
368387Swnj  * on the lowest level routine of each protocol.
378387Swnj  */
388387Swnj #define	NETISR_RAW	0		/* same as AF_UNSPEC */
398387Swnj #define	NETISR_IP	2		/* same as AF_INET */
4024146Skarels #define	NETISR_IMP	3		/* same as AF_IMPLINK */
418387Swnj #define	NETISR_NS	6		/* same as AF_NS */
428387Swnj 
438387Swnj #define	schednetisr(anisr)	{ netisr |= 1<<(anisr); setsoftnet(); }
448387Swnj 
458387Swnj #ifndef LOCORE
468387Swnj #ifdef KERNEL
478387Swnj int	netisr;				/* scheduling bits for network */
488387Swnj #endif
498387Swnj #endif
50