1 /* $NetBSD: intr.h,v 1.2 2006/12/21 15:55:23 yamt 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 * NOTE: spllowersoftclock() is used by hardclock() to lower the priority from 54 * clock to softclock before it calls softclock(). 55 */ 56 57 #define spllowersoftclock() spllower(IPL_SOFTCLOCK) 58 #define splsoftclock() splraise(IPL_SOFTCLOCK) 59 #define splsoftnet() splraise(IPL_SOFTNET) 60 #define splsoftserial() splraise(IPL_SOFTSERIAL) 61 62 typedef int ipl_t; 63 typedef struct { 64 ipl_t _ipl; 65 } ipl_cookie_t; 66 67 static inline ipl_cookie_t 68 makeiplcookie(ipl_t ipl) 69 { 70 71 return (ipl_cookie_t){._ipl = ipl}; 72 } 73 74 static inline int 75 splraiseipl(ipl_cookie_t icookie) 76 { 77 78 return splraise(icookie._ipl); 79 } 80 81 #endif /* ! _IA64_INTR_H_ */ 82