Home | History | Annotate | Line # | Download | only in include
intr.h revision 1.4
      1  1.4   kochi /*	$NetBSD: intr.h,v 1.4 2008/03/20 09:09:20 kochi Exp $	*/
      2  1.1  cherry 
      3  1.1  cherry /* XXX: cherry: To Be fixed when we switch on interrupts. */
      4  1.1  cherry 
      5  1.1  cherry #ifndef _IA64_INTR_H_
      6  1.1  cherry #define _IA64_INTR_H_
      7  1.1  cherry 
      8  1.4   kochi #include <machine/intrdefs.h>
      9  1.1  cherry 
     10  1.1  cherry static __inline int splraise(int dummy) { return 0; }
     11  1.1  cherry static __inline void spllower(int dummy) { }
     12  1.1  cherry 
     13  1.1  cherry /*
     14  1.1  cherry  * Miscellaneous
     15  1.1  cherry  */
     16  1.1  cherry #define	splvm()		splraise(IPL_VM)
     17  1.1  cherry #define	splhigh()	splraise(IPL_HIGH)
     18  1.1  cherry #define	spl0()		spllower(IPL_NONE)
     19  1.1  cherry #define	splsched()	splraise(IPL_SCHED)
     20  1.1  cherry #define spllock() 	splhigh()
     21  1.1  cherry #define	splx(x)		spllower(x)
     22  1.1  cherry 
     23  1.1  cherry /*
     24  1.1  cherry  * Software interrupt masks
     25  1.1  cherry  */
     26  1.1  cherry 
     27  1.1  cherry #define	splsoftclock() splraise(IPL_SOFTCLOCK)
     28  1.1  cherry #define	splsoftnet()	splraise(IPL_SOFTNET)
     29  1.1  cherry #define	splsoftserial()	splraise(IPL_SOFTSERIAL)
     30  1.1  cherry 
     31  1.2    yamt typedef int ipl_t;
     32  1.2    yamt typedef struct {
     33  1.2    yamt 	ipl_t _ipl;
     34  1.2    yamt } ipl_cookie_t;
     35  1.2    yamt 
     36  1.2    yamt static inline ipl_cookie_t
     37  1.2    yamt makeiplcookie(ipl_t ipl)
     38  1.2    yamt {
     39  1.2    yamt 
     40  1.2    yamt 	return (ipl_cookie_t){._ipl = ipl};
     41  1.2    yamt }
     42  1.2    yamt 
     43  1.2    yamt static inline int
     44  1.2    yamt splraiseipl(ipl_cookie_t icookie)
     45  1.2    yamt {
     46  1.2    yamt 
     47  1.2    yamt 	return splraise(icookie._ipl);
     48  1.2    yamt }
     49  1.2    yamt 
     50  1.1  cherry #endif /* ! _IA64_INTR_H_ */
     51