Home | History | Annotate | Line # | Download | only in include
intr.h revision 1.5
      1 /*	$NetBSD: intr.h,v 1.5 2000/04/28 15:55:52 soren Exp $	*/
      2 
      3 #define	IPL_NONE	0	/* Disable only this interrupt. */
      4 #define	IPL_BIO		1	/* Disable block I/O interrupts. */
      5 #define	IPL_NET		2	/* Disable network interrupts. */
      6 #define	IPL_TTY		3	/* Disable terminal interrupts. */
      7 #define	IPL_IMP		4	/* Memory allocation */
      8 #define	IPL_CLOCK	5	/* Disable clock interrupts. */
      9 #define	IPL_STATCLOCK	6	/* Disable profiling interrupts. */
     10 #define	IPL_HIGH	7	/* Disable all interrupts. */
     11 #define NIPL		8
     12 
     13 /* Interrupt sharing types. */
     14 #define IST_NONE	0	/* none */
     15 #define IST_PULSE	1	/* pulsed */
     16 #define IST_EDGE	2	/* edge-triggered */
     17 #define IST_LEVEL	3	/* level-triggered */
     18 
     19 /* Soft interrupt masks. */
     20 #define SIR_CLOCK	31
     21 #define SIR_NET		30
     22 #define SIR_CLOCKMASK	((1 << SIR_CLOCK))
     23 #define SIR_NETMASK	((1 << SIR_NET) | SIR_CLOCKMASK)
     24 #define SIR_ALLMASK	(SIR_CLOCKMASK | SIR_NETMASK)
     25 
     26 #ifdef _KERNEL
     27 #ifndef _LOCORE
     28 
     29 #include <mips/cpuregs.h>
     30 
     31 extern int		_splraise(int);
     32 extern int		_spllower(int);
     33 extern int		_splset(int);
     34 extern int		_splget(void);
     35 extern void		_splnone(void);
     36 extern void		_setsoftintr(int);
     37 extern void		_clrsoftintr(int);
     38 
     39 #define setsoftclock()	_setsoftintr(MIPS_SOFT_INT_MASK_0)
     40 #define setsoftnet()	_setsoftintr(MIPS_SOFT_INT_MASK_1)
     41 #define clearsoftclock() _clrsoftintr(MIPS_SOFT_INT_MASK_0)
     42 #define clearsoftnet()	_clrsoftintr(MIPS_SOFT_INT_MASK_1)
     43 
     44 #define splhigh()       _splraise(MIPS_INT_MASK)
     45 #define spl0()          (void)_spllower(0)
     46 #define splx(s)         (void)_splset(s)
     47 #define SPLSOFT		MIPS_SOFT_INT_MASK_0 | MIPS_SOFT_INT_MASK_1
     48 #define SPLBIO		SPLSOFT | MIPS_INT_MASK_4
     49 #define SPLNET		SPLBIO | MIPS_INT_MASK_1 | MIPS_INT_MASK_2
     50 #define SPLTTY		SPLNET | MIPS_INT_MASK_3
     51 #define SPLCLOCK	SPLTTY | MIPS_INT_MASK_0 | MIPS_INT_MASK_5
     52 #define splbio()        _splraise(SPLBIO)
     53 #define splnet()        _splraise(SPLNET)
     54 #define spltty()        _splraise(SPLTTY)
     55 #define splclock()      _splraise(SPLCLOCK)
     56 #define splimp()	splclock()
     57 #define splstatclock()  splclock()
     58 #define splsoftclock()	_splraise(MIPS_SOFT_INT_MASK_0)
     59 #define splsoftnet()	_splraise(MIPS_SOFT_INT_MASK_0|MIPS_SOFT_INT_MASK_1)
     60 #define spllowersoftclock() _spllower(MIPS_SOFT_INT_MASK_0)
     61 
     62 extern unsigned int	intrcnt[];
     63 #define SOFTCLOCK_INTR	0
     64 #define SOFTNET_INTR	1
     65 
     66 extern void *	cpu_intr_establish(int, int, int (*)(void *), void *);
     67 extern void *	icu_intr_establish(int, int, int, int (*)(void *), void *);
     68 
     69 #endif /* !_LOCORE */
     70 #endif /* _LOCORE */
     71