xref: /netbsd-src/sys/arch/ia64/include/intr.h (revision 50728e7823a76d5bd1a7bfa3a4eac400269b1339)
1 /*	$NetBSD: intr.h,v 1.4 2008/03/20 09:09:20 kochi 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 #include <machine/intrdefs.h>
9 
10 static __inline int splraise(int dummy) { return 0; }
11 static __inline void spllower(int dummy) { }
12 
13 /*
14  * Miscellaneous
15  */
16 #define	splvm()		splraise(IPL_VM)
17 #define	splhigh()	splraise(IPL_HIGH)
18 #define	spl0()		spllower(IPL_NONE)
19 #define	splsched()	splraise(IPL_SCHED)
20 #define spllock() 	splhigh()
21 #define	splx(x)		spllower(x)
22 
23 /*
24  * Software interrupt masks
25  */
26 
27 #define	splsoftclock() splraise(IPL_SOFTCLOCK)
28 #define	splsoftnet()	splraise(IPL_SOFTNET)
29 #define	splsoftserial()	splraise(IPL_SOFTSERIAL)
30 
31 typedef int ipl_t;
32 typedef struct {
33 	ipl_t _ipl;
34 } ipl_cookie_t;
35 
36 static inline ipl_cookie_t
37 makeiplcookie(ipl_t ipl)
38 {
39 
40 	return (ipl_cookie_t){._ipl = ipl};
41 }
42 
43 static inline int
44 splraiseipl(ipl_cookie_t icookie)
45 {
46 
47 	return splraise(icookie._ipl);
48 }
49 
50 #endif /* ! _IA64_INTR_H_ */
51