1 /* $NetBSD: intr.h,v 1.3 2007/02/16 02:53:47 ad Exp $ */ 2 3 /* XXX: cherry: To Be fixed when we switch on interrupts. */ 4 5 #ifndef _IA64_INTR_H_ 6 #define _IA64_INTR_H_ 7 8 #define IPL_NONE 0 /* XXX: Placeholder */ 9 #define IPL_BIO 0 /* XXX: Placeholder */ 10 #define IPL_NET 0 /* XXX: Placeholder */ 11 #define IPL_TTY 0 /* XXX: Placeholder */ 12 #define IPL_CLOCK 0 /* XXX: Placeholder */ 13 #define IPL_STATCLOCK 0 /* XXX: Placeholder */ 14 #define IPL_HIGH 0 /* XXX: Placeholder */ 15 #define IPL_SERIAL 0 /* XXX: Placeholder */ 16 #define IPL_SCHED 0 /* XXX: Placeholder */ 17 #define IPL_LOCK 0 /* XXX: Placeholder */ 18 #define IPL_VM 0 /* XXX: Placeholder */ 19 20 #define IPL_SOFTCLOCK 0 /* XXX: Placeholder */ 21 #define IPL_SOFTNET 0 /* XXX: Placeholder */ 22 #define IPL_SOFTSERIAL 0 /* XXX: Placeholder */ 23 24 static __inline int splraise(int dummy) { return 0; } 25 static __inline void spllower(int dummy) { } 26 27 /* 28 * Hardware interrupt masks 29 */ 30 #define splbio() splraise(IPL_BIO) 31 #define splnet() splraise(IPL_NET) 32 #define spltty() splraise(IPL_TTY) 33 #define splaudio() splraise(IPL_AUDIO) 34 #define splclock() splraise(IPL_CLOCK) 35 #define splstatclock() splclock() 36 #define splserial() splraise(IPL_SERIAL) 37 #define splipi() splraise(IPL_IPI) 38 39 40 /* 41 * Miscellaneous 42 */ 43 #define splvm() splraise(IPL_VM) 44 #define splhigh() splraise(IPL_HIGH) 45 #define spl0() spllower(IPL_NONE) 46 #define splsched() splraise(IPL_SCHED) 47 #define spllock() splhigh() 48 #define splx(x) spllower(x) 49 50 /* 51 * Software interrupt masks 52 */ 53 54 #define splsoftclock() splraise(IPL_SOFTCLOCK) 55 #define splsoftnet() splraise(IPL_SOFTNET) 56 #define splsoftserial() splraise(IPL_SOFTSERIAL) 57 58 typedef int ipl_t; 59 typedef struct { 60 ipl_t _ipl; 61 } ipl_cookie_t; 62 63 static inline ipl_cookie_t 64 makeiplcookie(ipl_t ipl) 65 { 66 67 return (ipl_cookie_t){._ipl = ipl}; 68 } 69 70 static inline int 71 splraiseipl(ipl_cookie_t icookie) 72 { 73 74 return splraise(icookie._ipl); 75 } 76 77 #endif /* ! _IA64_INTR_H_ */ 78