Home | History | Annotate | Line # | Download | only in include
intr.h revision 1.6
      1  1.6     scole /*	$NetBSD: intr.h,v 1.6 2017/04/08 18:02:21 scole 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.5  kiyohara 
     51  1.5  kiyohara /*
     52  1.5  kiyohara  * Layout of the Processor Interrupt Block.
     53  1.5  kiyohara  */
     54  1.5  kiyohara struct ia64_interrupt_block
     55  1.5  kiyohara {
     56  1.5  kiyohara 	uint64_t ib_ipi[0x20000];	/* 1Mb of IPI interrupts */
     57  1.5  kiyohara 	uint8_t ib_reserved1[0xe0000];
     58  1.5  kiyohara 	uint8_t ib_inta;		/* Generate INTA cycle */
     59  1.5  kiyohara 	uint8_t ib_reserved2[7];
     60  1.5  kiyohara 	uint8_t ib_xtp;			/* XTP cycle */
     61  1.5  kiyohara 	uint8_t ib_reserved3[7];
     62  1.5  kiyohara 	uint8_t ib_reserved4[0x1fff0];
     63  1.5  kiyohara };
     64  1.5  kiyohara 
     65  1.5  kiyohara extern uint64_t ia64_lapic_address;
     66  1.5  kiyohara 
     67  1.5  kiyohara #define IA64_INTERRUPT_BLOCK \
     68  1.5  kiyohara 	(struct ia64_interrupt_block *)IA64_PHYS_TO_RR6(ia64_lapic_address)
     69  1.5  kiyohara 
     70  1.5  kiyohara void *intr_establish(int, int, int, int (*)(void *), void *);
     71  1.5  kiyohara void intr_disestablish(void *);
     72  1.6     scole void ia64_handle_intr(void *);
     73  1.5  kiyohara 
     74  1.1    cherry #endif /* ! _IA64_INTR_H_ */
     75