intrdefs.h revision 1.24 1 1.24 bouyer /* $NetBSD: intrdefs.h,v 1.24 2020/04/25 15:26:18 bouyer Exp $ */
2 1.1 fvdl
3 1.4 yamt #ifndef _X86_INTRDEFS_H_
4 1.4 yamt #define _X86_INTRDEFS_H_
5 1.1 fvdl
6 1.11 ad /* Interrupt priority levels. */
7 1.1 fvdl #define IPL_NONE 0x0 /* nothing */
8 1.13 ad #define IPL_PREEMPT 0x1 /* fake, to prevent recursive preemptions */
9 1.13 ad #define IPL_SOFTCLOCK 0x2 /* timeouts */
10 1.13 ad #define IPL_SOFTBIO 0x3 /* block I/O passdown */
11 1.13 ad #define IPL_SOFTNET 0x4 /* protocol stacks */
12 1.13 ad #define IPL_SOFTSERIAL 0x5 /* serial passdown */
13 1.13 ad #define IPL_VM 0x6 /* low I/O, memory allocation */
14 1.13 ad #define IPL_SCHED 0x7 /* medium I/O, scheduler, clock */
15 1.13 ad #define IPL_HIGH 0x8 /* high I/O, statclock, IPIs */
16 1.13 ad #define NIPL 9
17 1.1 fvdl
18 1.1 fvdl /* Interrupt sharing types. */
19 1.1 fvdl #define IST_NONE 0 /* none */
20 1.1 fvdl #define IST_PULSE 1 /* pulsed */
21 1.1 fvdl #define IST_EDGE 2 /* edge-triggered */
22 1.1 fvdl #define IST_LEVEL 3 /* level-triggered */
23 1.1 fvdl
24 1.1 fvdl /*
25 1.9 ad * Local APIC masks and software interrupt masks, in order
26 1.9 ad * of priority. Must not conflict with SIR_* below.
27 1.1 fvdl */
28 1.1 fvdl #define LIR_IPI 31
29 1.1 fvdl #define LIR_TIMER 30
30 1.22 nonaka #define LIR_HV 29
31 1.1 fvdl
32 1.9 ad /*
33 1.9 ad * XXX These should be lowest numbered, but right now would
34 1.9 ad * conflict with the legacy IRQs. Their current position
35 1.9 ad * means that soft interrupt take priority over hardware
36 1.9 ad * interrupts when lowering the priority level!
37 1.9 ad */
38 1.22 nonaka #define SIR_SERIAL 28
39 1.22 nonaka #define SIR_NET 27
40 1.22 nonaka #define SIR_BIO 26
41 1.22 nonaka #define SIR_CLOCK 25
42 1.22 nonaka #define SIR_PREEMPT 24
43 1.24 bouyer #define SIR_XENIPL_HIGH 23
44 1.24 bouyer #define SIR_XENIPL_SCHED 22
45 1.24 bouyer #define SIR_XENIPL_VM 21
46 1.24 bouyer
47 1.24 bouyer #define XEN_IPL2SIR(ipl) ((ipl) + (SIR_XENIPL_VM - IPL_VM))
48 1.1 fvdl
49 1.1 fvdl /*
50 1.1 fvdl * Maximum # of interrupt sources per CPU. 32 to fit in one word.
51 1.1 fvdl * ioapics can theoretically produce more, but it's not likely to
52 1.1 fvdl * happen. For multiple ioapics, things can be routed to different
53 1.1 fvdl * CPUs.
54 1.1 fvdl */
55 1.1 fvdl #define MAX_INTR_SOURCES 32
56 1.1 fvdl #define NUM_LEGACY_IRQS 16
57 1.1 fvdl
58 1.1 fvdl /*
59 1.1 fvdl * Low and high boundaries between which interrupt gates will
60 1.1 fvdl * be allocated in the IDT.
61 1.1 fvdl */
62 1.1 fvdl #define IDT_INTR_LOW (0x20 + NUM_LEGACY_IRQS)
63 1.1 fvdl #define IDT_INTR_HIGH 0xef
64 1.1 fvdl
65 1.21 cherry #ifndef XENPV
66 1.17 cherry
67 1.1 fvdl #define X86_IPI_HALT 0x00000001
68 1.23 ad #define X86_IPI_AST 0x00000002
69 1.20 rmind #define X86_IPI_GENERIC 0x00000004
70 1.19 christos #define X86_IPI_SYNCH_FPU 0x00000008
71 1.9 ad #define X86_IPI_MTRR 0x00000010
72 1.9 ad #define X86_IPI_GDT 0x00000020
73 1.16 rmind #define X86_IPI_XCALL 0x00000040
74 1.12 joerg #define X86_IPI_ACPI_CPU_SLEEP 0x00000080
75 1.13 ad #define X86_IPI_KPREEMPT 0x00000100
76 1.1 fvdl
77 1.13 ad #define X86_NIPI 9
78 1.1 fvdl
79 1.23 ad #define X86_IPI_NAMES { "halt IPI", "AST IPI", "generic IPI", \
80 1.9 ad "FPU synch IPI", "MTRR update IPI", \
81 1.16 rmind "GDT update IPI", "xcall IPI", \
82 1.13 ad "ACPI CPU sleep IPI", "kpreempt IPI" }
83 1.21 cherry #endif /* XENPV */
84 1.2 fvdl
85 1.2 fvdl #define IREENT_MAGIC 0x18041969
86 1.1 fvdl
87 1.4 yamt #endif /* _X86_INTRDEFS_H_ */
88