intrdefs.h revision 1.11 1 1.11 ad /* $NetBSD: intrdefs.h,v 1.11 2007/12/03 15:34:27 ad 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.9 ad #define IPL_SOFTCLOCK 0x1 /* timeouts */
9 1.11 ad #define IPL_SOFTBIO 0x2 /* block I/O passdown */
10 1.9 ad #define IPL_SOFTNET 0x3 /* protocol stacks */
11 1.11 ad #define IPL_SOFTSERIAL 0x4 /* serial passdown */
12 1.11 ad #define IPL_VM 0x5 /* low I/O, memory allocation */
13 1.11 ad #define IPL_SCHED 0x6 /* medium I/O, scheduler, clock */
14 1.11 ad #define IPL_HIGH 0x7 /* high I/O, statclock, IPIs */
15 1.9 ad #define NIPL 8
16 1.1 fvdl
17 1.1 fvdl /* Interrupt sharing types. */
18 1.1 fvdl #define IST_NONE 0 /* none */
19 1.1 fvdl #define IST_PULSE 1 /* pulsed */
20 1.1 fvdl #define IST_EDGE 2 /* edge-triggered */
21 1.1 fvdl #define IST_LEVEL 3 /* level-triggered */
22 1.1 fvdl
23 1.1 fvdl /*
24 1.9 ad * Local APIC masks and software interrupt masks, in order
25 1.9 ad * of priority. Must not conflict with SIR_* below.
26 1.1 fvdl */
27 1.1 fvdl #define LIR_IPI 31
28 1.1 fvdl #define LIR_TIMER 30
29 1.1 fvdl
30 1.9 ad /*
31 1.9 ad * XXX These should be lowest numbered, but right now would
32 1.9 ad * conflict with the legacy IRQs. Their current position
33 1.9 ad * means that soft interrupt take priority over hardware
34 1.9 ad * interrupts when lowering the priority level!
35 1.9 ad */
36 1.9 ad #define SIR_SERIAL 29
37 1.1 fvdl #define SIR_NET 28
38 1.9 ad #define SIR_BIO 27
39 1.9 ad #define SIR_CLOCK 26
40 1.1 fvdl
41 1.1 fvdl /*
42 1.1 fvdl * Maximum # of interrupt sources per CPU. 32 to fit in one word.
43 1.1 fvdl * ioapics can theoretically produce more, but it's not likely to
44 1.1 fvdl * happen. For multiple ioapics, things can be routed to different
45 1.1 fvdl * CPUs.
46 1.1 fvdl */
47 1.1 fvdl #define MAX_INTR_SOURCES 32
48 1.1 fvdl #define NUM_LEGACY_IRQS 16
49 1.1 fvdl
50 1.1 fvdl /*
51 1.1 fvdl * Low and high boundaries between which interrupt gates will
52 1.1 fvdl * be allocated in the IDT.
53 1.1 fvdl */
54 1.1 fvdl #define IDT_INTR_LOW (0x20 + NUM_LEGACY_IRQS)
55 1.1 fvdl #define IDT_INTR_HIGH 0xef
56 1.1 fvdl
57 1.1 fvdl #define X86_IPI_HALT 0x00000001
58 1.1 fvdl #define X86_IPI_MICROSET 0x00000002
59 1.1 fvdl #define X86_IPI_FLUSH_FPU 0x00000004
60 1.1 fvdl #define X86_IPI_SYNCH_FPU 0x00000008
61 1.9 ad #define X86_IPI_MTRR 0x00000010
62 1.9 ad #define X86_IPI_GDT 0x00000020
63 1.9 ad #define X86_IPI_WRITE_MSR 0x00000040
64 1.1 fvdl
65 1.9 ad #define X86_NIPI 7
66 1.1 fvdl
67 1.1 fvdl #define X86_IPI_NAMES { "halt IPI", "timeset IPI", "FPU flush IPI", \
68 1.9 ad "FPU synch IPI", "MTRR update IPI", \
69 1.9 ad "GDT update IPI", "MSR write IPI" }
70 1.2 fvdl
71 1.2 fvdl #define IREENT_MAGIC 0x18041969
72 1.1 fvdl
73 1.4 yamt #endif /* _X86_INTRDEFS_H_ */
74