intr.h revision 1.8 1 1.8 jmcneill /* $NetBSD: intr.h,v 1.8 2018/11/16 19:46:52 jmcneill 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.7 scole /* XXX acpi */
71 1.7 scole typedef uint64_t intr_handle_t;
72 1.7 scole const char *intr_string(intr_handle_t, char *, size_t);
73 1.7 scole
74 1.5 kiyohara void *intr_establish(int, int, int, int (*)(void *), void *);
75 1.8 jmcneill void *intr_establish_xname(int, int, int, int (*)(void *), void *, const char *);
76 1.5 kiyohara void intr_disestablish(void *);
77 1.6 scole void ia64_handle_intr(void *);
78 1.5 kiyohara
79 1.1 cherry #endif /* ! _IA64_INTR_H_ */
80