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