Warning, cross-references for /kernel/include/smp/apic-defs.h need to be fixed.
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef _APIC_DEFS_H_
0032 #define _APIC_DEFS_H_
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 #define APIC_BCAST_ID 0xFF
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 #define APIC_VERSION(x) ((x) & 0xFF)
0055 #define APIC_MAXREDIR(x) (((x) >> 16) & 0xFF)
0056
0057 #define APIC_ID(x) ((x) >> 24)
0058 #define APIC_VER_NEW 0x10
0059
0060 #define IOAPIC_REGSEL 0
0061 #define IOAPIC_RW 0x10
0062 #define IOAPIC_ID 0
0063 #define IOAPIC_VER 1
0064 #define IOAPIC_REDIR 0x10
0065
0066
0067 typedef enum {
0068 IOAPIC_DELIVERY_FIXED= 0x000,
0069 IOAPIC_DELIVERY_LOWEST_PRIORITY= 0x100,
0070
0071 IOAPIC_DELIVERY_SMI= 0x200,
0072 IOAPIC_DELIVERY_NMI= 0x400,
0073 IOAPIC_DELIVERY_INIT= 0x500,
0074 IOAPIC_DELIVERY_EXTINT= 0x700
0075 } IOAPIC_delivery_mode_t;
0076
0077
0078 typedef enum {
0079 IOAPIC_DESTINATION_PHYSICAL= 0x000,
0080 IOAPIC_DESTINATION_LOGICAL= 0x800
0081 } IOAPIC_destination_mode_t;
0082
0083
0084 typedef enum {
0085 IOAPIC_TRIGGER_EDGE= 0x0000,
0086 IOAPIC_TRIGGER_LEVEL= 0x8000
0087 } IOAPIC_trigger_mode_t;
0088
0089
0090 typedef enum {
0091 IOAPIC_POLARITY_HIGH= 0x0000,
0092 IOAPIC_POLARITY_LOW= 0x2000
0093 } IOAPIC_polarity_mode_t;
0094
0095
0096
0097 #define LAPIC_ID 0x20
0098 #define LAPIC_VER 0x30
0099 #define LAPIC_TPR 0x80
0100 #define LAPIC_APR 0x90
0101 #define LAPIC_PPR 0xA0
0102 #define LAPIC_EOI 0xB0
0103 #define LAPIC_LDR 0xD0
0104 #define LAPIC_DFR 0xE0
0105 #define LAPIC_SPIV 0xF0
0106 #define LAPIC_SPIV_ENABLE_APIC 0x100
0107 #define LAPIC_ISR 0x100
0108 #define LAPIC_TMR 0x180
0109 #define LAPIC_IRR 0x200
0110 #define LAPIC_ESR 0x280
0111 #define LAPIC_ICR 0x300
0112
0113
0114
0115
0116 #define LAPIC_ICR_DS_SELF 0x40000
0117 #define LAPIC_ICR_DS_ALLINC 0x80000
0118 #define LAPIC_ICR_DS_ALLEX 0xC0000
0119
0120
0121 #define LAPIC_ICR_TM_LEVEL 0x8000
0122
0123 #define LAPIC_ICR_LEVELASSERT 0x4000
0124
0125
0126
0127 #define LAPIC_ICR_STATUS_PEND 0x1000
0128 #define LAPIC_ICR_DM_LOGICAL 0x800
0129
0130
0131
0132 #define LAPIC_ICR_DM_LOWPRI 0x100
0133 #define LAPIC_ICR_DM_SMI 0x200
0134 #define LAPIC_ICR_DM_NMI 0x400
0135 #define LAPIC_ICR_DM_INIT 0x500
0136 #define LAPIC_ICR_DM_SIPI 0x600
0137
0138
0139 #define LAPIC_LVTT 0x320
0140 #define LAPIC_LVTPC 0x340
0141 #define LAPIC_LVT0 0x350
0142 #define LAPIC_LVT1 0x360
0143 #define LAPIC_LVTE 0x370
0144 #define LAPIC_TICR 0x380
0145 #define LAPIC_TCCR 0x390
0146 #define LAPIC_TDCR 0x3E0
0147
0148
0149 #endif
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160