Home | History | Annotate | Line # | Download | only in include
intr.h revision 1.2
      1  1.2    yamt /*	$NetBSD: intr.h,v 1.2 2006/12/21 15:55:23 yamt 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.1  cherry #define	IPL_NONE	0	/* XXX: Placeholder */
      9  1.1  cherry #define	IPL_BIO		0	/* XXX: Placeholder */
     10  1.1  cherry #define	IPL_NET		0	/* XXX: Placeholder */
     11  1.1  cherry #define	IPL_TTY		0	/* XXX: Placeholder */
     12  1.1  cherry #define	IPL_CLOCK	0	/* XXX: Placeholder */
     13  1.2    yamt #define	IPL_STATCLOCK	0	/* XXX: Placeholder */
     14  1.1  cherry #define	IPL_HIGH	0	/* XXX: Placeholder */
     15  1.1  cherry #define	IPL_SERIAL	0	/* XXX: Placeholder */
     16  1.2    yamt #define	IPL_SCHED	0	/* XXX: Placeholder */
     17  1.2    yamt #define	IPL_LOCK	0	/* XXX: Placeholder */
     18  1.2    yamt #define	IPL_VM		0	/* XXX: Placeholder */
     19  1.1  cherry 
     20  1.1  cherry #define IPL_SOFTCLOCK   0	/* XXX: Placeholder */
     21  1.1  cherry #define IPL_SOFTNET     0	/* XXX: Placeholder */
     22  1.1  cherry #define IPL_SOFTSERIAL  0	/* XXX: Placeholder */
     23  1.1  cherry 
     24  1.1  cherry static __inline int splraise(int dummy) { return 0; }
     25  1.1  cherry static __inline void spllower(int dummy) { }
     26  1.1  cherry 
     27  1.1  cherry /*
     28  1.1  cherry  * Hardware interrupt masks
     29  1.1  cherry  */
     30  1.1  cherry #define	splbio()	splraise(IPL_BIO)
     31  1.1  cherry #define	splnet()	splraise(IPL_NET)
     32  1.1  cherry #define	spltty()	splraise(IPL_TTY)
     33  1.1  cherry #define	splaudio()	splraise(IPL_AUDIO)
     34  1.1  cherry #define	splclock()	splraise(IPL_CLOCK)
     35  1.1  cherry #define	splstatclock()	splclock()
     36  1.1  cherry #define	splserial()	splraise(IPL_SERIAL)
     37  1.1  cherry #define splipi()	splraise(IPL_IPI)
     38  1.1  cherry 
     39  1.1  cherry 
     40  1.1  cherry /*
     41  1.1  cherry  * Miscellaneous
     42  1.1  cherry  */
     43  1.1  cherry #define	splvm()		splraise(IPL_VM)
     44  1.1  cherry #define	splhigh()	splraise(IPL_HIGH)
     45  1.1  cherry #define	spl0()		spllower(IPL_NONE)
     46  1.1  cherry #define	splsched()	splraise(IPL_SCHED)
     47  1.1  cherry #define spllock() 	splhigh()
     48  1.1  cherry #define	splx(x)		spllower(x)
     49  1.1  cherry 
     50  1.1  cherry /*
     51  1.1  cherry  * Software interrupt masks
     52  1.1  cherry  *
     53  1.1  cherry  * NOTE: spllowersoftclock() is used by hardclock() to lower the priority from
     54  1.1  cherry  * clock to softclock before it calls softclock().
     55  1.1  cherry  */
     56  1.1  cherry 
     57  1.1  cherry #define spllowersoftclock() spllower(IPL_SOFTCLOCK)
     58  1.1  cherry #define	splsoftclock() splraise(IPL_SOFTCLOCK)
     59  1.1  cherry #define	splsoftnet()	splraise(IPL_SOFTNET)
     60  1.1  cherry #define	splsoftserial()	splraise(IPL_SOFTSERIAL)
     61  1.1  cherry 
     62  1.2    yamt typedef int ipl_t;
     63  1.2    yamt typedef struct {
     64  1.2    yamt 	ipl_t _ipl;
     65  1.2    yamt } ipl_cookie_t;
     66  1.2    yamt 
     67  1.2    yamt static inline ipl_cookie_t
     68  1.2    yamt makeiplcookie(ipl_t ipl)
     69  1.2    yamt {
     70  1.2    yamt 
     71  1.2    yamt 	return (ipl_cookie_t){._ipl = ipl};
     72  1.2    yamt }
     73  1.2    yamt 
     74  1.2    yamt static inline int
     75  1.2    yamt splraiseipl(ipl_cookie_t icookie)
     76  1.2    yamt {
     77  1.2    yamt 
     78  1.2    yamt 	return splraise(icookie._ipl);
     79  1.2    yamt }
     80  1.2    yamt 
     81  1.1  cherry #endif /* ! _IA64_INTR_H_ */
     82