1 1.9 bouyer /* $NetBSD: intr.h,v 1.9 2025/05/20 10:19:14 bouyer 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.9 bouyer #define splsoftbio() splraise(IPL_SOFTBIO) 28 1.1 cherry #define splsoftclock() splraise(IPL_SOFTCLOCK) 29 1.1 cherry #define splsoftnet() splraise(IPL_SOFTNET) 30 1.1 cherry #define splsoftserial() splraise(IPL_SOFTSERIAL) 31 1.1 cherry 32 1.2 yamt typedef int ipl_t; 33 1.2 yamt typedef struct { 34 1.2 yamt ipl_t _ipl; 35 1.2 yamt } ipl_cookie_t; 36 1.2 yamt 37 1.2 yamt static inline ipl_cookie_t 38 1.2 yamt makeiplcookie(ipl_t ipl) 39 1.2 yamt { 40 1.2 yamt 41 1.2 yamt return (ipl_cookie_t){._ipl = ipl}; 42 1.2 yamt } 43 1.2 yamt 44 1.2 yamt static inline int 45 1.2 yamt splraiseipl(ipl_cookie_t icookie) 46 1.2 yamt { 47 1.2 yamt 48 1.2 yamt return splraise(icookie._ipl); 49 1.2 yamt } 50 1.2 yamt 51 1.5 kiyohara 52 1.5 kiyohara /* 53 1.5 kiyohara * Layout of the Processor Interrupt Block. 54 1.5 kiyohara */ 55 1.5 kiyohara struct ia64_interrupt_block 56 1.5 kiyohara { 57 1.5 kiyohara uint64_t ib_ipi[0x20000]; /* 1Mb of IPI interrupts */ 58 1.5 kiyohara uint8_t ib_reserved1[0xe0000]; 59 1.5 kiyohara uint8_t ib_inta; /* Generate INTA cycle */ 60 1.5 kiyohara uint8_t ib_reserved2[7]; 61 1.5 kiyohara uint8_t ib_xtp; /* XTP cycle */ 62 1.5 kiyohara uint8_t ib_reserved3[7]; 63 1.5 kiyohara uint8_t ib_reserved4[0x1fff0]; 64 1.5 kiyohara }; 65 1.5 kiyohara 66 1.5 kiyohara extern uint64_t ia64_lapic_address; 67 1.5 kiyohara 68 1.5 kiyohara #define IA64_INTERRUPT_BLOCK \ 69 1.5 kiyohara (struct ia64_interrupt_block *)IA64_PHYS_TO_RR6(ia64_lapic_address) 70 1.5 kiyohara 71 1.7 scole /* XXX acpi */ 72 1.7 scole typedef uint64_t intr_handle_t; 73 1.7 scole const char *intr_string(intr_handle_t, char *, size_t); 74 1.7 scole 75 1.5 kiyohara void *intr_establish(int, int, int, int (*)(void *), void *); 76 1.8 jmcneill void *intr_establish_xname(int, int, int, int (*)(void *), void *, const char *); 77 1.5 kiyohara void intr_disestablish(void *); 78 1.6 scole void ia64_handle_intr(void *); 79 1.5 kiyohara 80 1.1 cherry #endif /* ! _IA64_INTR_H_ */ 81