diff options
Diffstat (limited to 'drivers/acpi/tables.c')
-rw-r--r-- | drivers/acpi/tables.c | 109 |
1 files changed, 55 insertions, 54 deletions
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 962ff29fbf07..ba4cb200314a 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -43,90 +43,92 @@ static char *mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" }; | |||
43 | 43 | ||
44 | static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata; | 44 | static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata; |
45 | 45 | ||
46 | void acpi_table_print_madt_entry(acpi_table_entry_header * header) | 46 | void acpi_table_print_madt_entry(struct acpi_subtable_header * header) |
47 | { | 47 | { |
48 | if (!header) | 48 | if (!header) |
49 | return; | 49 | return; |
50 | 50 | ||
51 | switch (header->type) { | 51 | switch (header->type) { |
52 | 52 | ||
53 | case ACPI_MADT_LAPIC: | 53 | case ACPI_MADT_TYPE_LOCAL_APIC: |
54 | { | 54 | { |
55 | struct acpi_table_lapic *p = | 55 | struct acpi_madt_local_apic *p = |
56 | (struct acpi_table_lapic *)header; | 56 | (struct acpi_madt_local_apic *)header; |
57 | printk(KERN_INFO PREFIX | 57 | printk(KERN_INFO PREFIX |
58 | "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", | 58 | "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", |
59 | p->acpi_id, p->id, | 59 | p->processor_id, p->id, |
60 | p->flags.enabled ? "enabled" : "disabled"); | 60 | (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); |
61 | } | 61 | } |
62 | break; | 62 | break; |
63 | 63 | ||
64 | case ACPI_MADT_IOAPIC: | 64 | case ACPI_MADT_TYPE_IO_APIC: |
65 | { | 65 | { |
66 | struct acpi_table_ioapic *p = | 66 | struct acpi_madt_io_apic *p = |
67 | (struct acpi_table_ioapic *)header; | 67 | (struct acpi_madt_io_apic *)header; |
68 | printk(KERN_INFO PREFIX | 68 | printk(KERN_INFO PREFIX |
69 | "IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", | 69 | "IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", |
70 | p->id, p->address, p->global_irq_base); | 70 | p->id, p->address, p->global_irq_base); |
71 | } | 71 | } |
72 | break; | 72 | break; |
73 | 73 | ||
74 | case ACPI_MADT_INT_SRC_OVR: | 74 | case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE: |
75 | { | 75 | { |
76 | struct acpi_table_int_src_ovr *p = | 76 | struct acpi_madt_interrupt_override *p = |
77 | (struct acpi_table_int_src_ovr *)header; | 77 | (struct acpi_madt_interrupt_override *)header; |
78 | printk(KERN_INFO PREFIX | 78 | printk(KERN_INFO PREFIX |
79 | "INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n", | 79 | "INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n", |
80 | p->bus, p->bus_irq, p->global_irq, | 80 | p->bus, p->source_irq, p->global_irq, |
81 | mps_inti_flags_polarity[p->flags.polarity], | 81 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], |
82 | mps_inti_flags_trigger[p->flags.trigger]); | 82 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2]); |
83 | if (p->flags.reserved) | 83 | if (p->inti_flags & |
84 | ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)) | ||
84 | printk(KERN_INFO PREFIX | 85 | printk(KERN_INFO PREFIX |
85 | "INT_SRC_OVR unexpected reserved flags: 0x%x\n", | 86 | "INT_SRC_OVR unexpected reserved flags: 0x%x\n", |
86 | p->flags.reserved); | 87 | p->inti_flags & |
88 | ~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK)); | ||
87 | 89 | ||
88 | } | 90 | } |
89 | break; | 91 | break; |
90 | 92 | ||
91 | case ACPI_MADT_NMI_SRC: | 93 | case ACPI_MADT_TYPE_NMI_SOURCE: |
92 | { | 94 | { |
93 | struct acpi_table_nmi_src *p = | 95 | struct acpi_madt_nmi_source *p = |
94 | (struct acpi_table_nmi_src *)header; | 96 | (struct acpi_madt_nmi_source *)header; |
95 | printk(KERN_INFO PREFIX | 97 | printk(KERN_INFO PREFIX |
96 | "NMI_SRC (%s %s global_irq %d)\n", | 98 | "NMI_SRC (%s %s global_irq %d)\n", |
97 | mps_inti_flags_polarity[p->flags.polarity], | 99 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], |
98 | mps_inti_flags_trigger[p->flags.trigger], | 100 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], |
99 | p->global_irq); | 101 | p->global_irq); |
100 | } | 102 | } |
101 | break; | 103 | break; |
102 | 104 | ||
103 | case ACPI_MADT_LAPIC_NMI: | 105 | case ACPI_MADT_TYPE_LOCAL_APIC_NMI: |
104 | { | 106 | { |
105 | struct acpi_table_lapic_nmi *p = | 107 | struct acpi_madt_local_apic_nmi *p = |
106 | (struct acpi_table_lapic_nmi *)header; | 108 | (struct acpi_madt_local_apic_nmi *)header; |
107 | printk(KERN_INFO PREFIX | 109 | printk(KERN_INFO PREFIX |
108 | "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n", | 110 | "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n", |
109 | p->acpi_id, | 111 | p->processor_id, |
110 | mps_inti_flags_polarity[p->flags.polarity], | 112 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK ], |
111 | mps_inti_flags_trigger[p->flags.trigger], | 113 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], |
112 | p->lint); | 114 | p->lint); |
113 | } | 115 | } |
114 | break; | 116 | break; |
115 | 117 | ||
116 | case ACPI_MADT_LAPIC_ADDR_OVR: | 118 | case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: |
117 | { | 119 | { |
118 | struct acpi_table_lapic_addr_ovr *p = | 120 | struct acpi_madt_local_apic_override *p = |
119 | (struct acpi_table_lapic_addr_ovr *)header; | 121 | (struct acpi_madt_local_apic_override *)header; |
120 | printk(KERN_INFO PREFIX | 122 | printk(KERN_INFO PREFIX |
121 | "LAPIC_ADDR_OVR (address[%p])\n", | 123 | "LAPIC_ADDR_OVR (address[%p])\n", |
122 | (void *)(unsigned long)p->address); | 124 | (void *)(unsigned long)p->address); |
123 | } | 125 | } |
124 | break; | 126 | break; |
125 | 127 | ||
126 | case ACPI_MADT_IOSAPIC: | 128 | case ACPI_MADT_TYPE_IO_SAPIC: |
127 | { | 129 | { |
128 | struct acpi_table_iosapic *p = | 130 | struct acpi_madt_io_sapic *p = |
129 | (struct acpi_table_iosapic *)header; | 131 | (struct acpi_madt_io_sapic *)header; |
130 | printk(KERN_INFO PREFIX | 132 | printk(KERN_INFO PREFIX |
131 | "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", | 133 | "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", |
132 | p->id, (void *)(unsigned long)p->address, | 134 | p->id, (void *)(unsigned long)p->address, |
@@ -134,26 +136,26 @@ void acpi_table_print_madt_entry(acpi_table_entry_header * header) | |||
134 | } | 136 | } |
135 | break; | 137 | break; |
136 | 138 | ||
137 | case ACPI_MADT_LSAPIC: | 139 | case ACPI_MADT_TYPE_LOCAL_SAPIC: |
138 | { | 140 | { |
139 | struct acpi_table_lsapic *p = | 141 | struct acpi_madt_local_sapic *p = |
140 | (struct acpi_table_lsapic *)header; | 142 | (struct acpi_madt_local_sapic *)header; |
141 | printk(KERN_INFO PREFIX | 143 | printk(KERN_INFO PREFIX |
142 | "LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", | 144 | "LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", |
143 | p->acpi_id, p->id, p->eid, | 145 | p->processor_id, p->id, p->eid, |
144 | p->flags.enabled ? "enabled" : "disabled"); | 146 | (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); |
145 | } | 147 | } |
146 | break; | 148 | break; |
147 | 149 | ||
148 | case ACPI_MADT_PLAT_INT_SRC: | 150 | case ACPI_MADT_TYPE_INTERRUPT_SOURCE: |
149 | { | 151 | { |
150 | struct acpi_table_plat_int_src *p = | 152 | struct acpi_madt_interrupt_source *p = |
151 | (struct acpi_table_plat_int_src *)header; | 153 | (struct acpi_madt_interrupt_source *)header; |
152 | printk(KERN_INFO PREFIX | 154 | printk(KERN_INFO PREFIX |
153 | "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", | 155 | "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", |
154 | mps_inti_flags_polarity[p->flags.polarity], | 156 | mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], |
155 | mps_inti_flags_trigger[p->flags.trigger], | 157 | mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2], |
156 | p->type, p->id, p->eid, p->iosapic_vector, | 158 | p->type, p->id, p->eid, p->io_sapic_vector, |
157 | p->global_irq); | 159 | p->global_irq); |
158 | } | 160 | } |
159 | break; | 161 | break; |
@@ -175,7 +177,7 @@ acpi_table_parse_madt_family(char *id, | |||
175 | unsigned int max_entries) | 177 | unsigned int max_entries) |
176 | { | 178 | { |
177 | struct acpi_table_header *madt = NULL; | 179 | struct acpi_table_header *madt = NULL; |
178 | acpi_table_entry_header *entry; | 180 | struct acpi_subtable_header *entry; |
179 | unsigned int count = 0; | 181 | unsigned int count = 0; |
180 | unsigned long madt_end; | 182 | unsigned long madt_end; |
181 | 183 | ||
@@ -183,7 +185,6 @@ acpi_table_parse_madt_family(char *id, | |||
183 | return -EINVAL; | 185 | return -EINVAL; |
184 | 186 | ||
185 | /* Locate the MADT (if exists). There should only be one. */ | 187 | /* Locate the MADT (if exists). There should only be one. */ |
186 | |||
187 | acpi_get_table(id, 0, &madt); | 188 | acpi_get_table(id, 0, &madt); |
188 | 189 | ||
189 | if (!madt) { | 190 | if (!madt) { |
@@ -195,17 +196,17 @@ acpi_table_parse_madt_family(char *id, | |||
195 | 196 | ||
196 | /* Parse all entries looking for a match. */ | 197 | /* Parse all entries looking for a match. */ |
197 | 198 | ||
198 | entry = (acpi_table_entry_header *) | 199 | entry = (struct acpi_subtable_header *) |
199 | ((unsigned long)madt + madt_size); | 200 | ((unsigned long)madt + madt_size); |
200 | 201 | ||
201 | while (((unsigned long)entry) + sizeof(acpi_table_entry_header) < | 202 | while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) < |
202 | madt_end) { | 203 | madt_end) { |
203 | if (entry->type == entry_id | 204 | if (entry->type == entry_id |
204 | && (!max_entries || count++ < max_entries)) | 205 | && (!max_entries || count++ < max_entries)) |
205 | if (handler(entry, madt_end)) | 206 | if (handler(entry, madt_end)) |
206 | return -EINVAL; | 207 | return -EINVAL; |
207 | 208 | ||
208 | entry = (acpi_table_entry_header *) | 209 | entry = (struct acpi_subtable_header *) |
209 | ((unsigned long)entry + entry->length); | 210 | ((unsigned long)entry + entry->length); |
210 | } | 211 | } |
211 | if (max_entries && count > max_entries) { | 212 | if (max_entries && count > max_entries) { |
@@ -217,10 +218,10 @@ acpi_table_parse_madt_family(char *id, | |||
217 | } | 218 | } |
218 | 219 | ||
219 | int __init | 220 | int __init |
220 | acpi_table_parse_madt(enum acpi_madt_entry_id id, | 221 | acpi_table_parse_madt(enum acpi_madt_type id, |
221 | acpi_madt_entry_handler handler, unsigned int max_entries) | 222 | acpi_madt_entry_handler handler, unsigned int max_entries) |
222 | { | 223 | { |
223 | return acpi_table_parse_madt_family("APIC", | 224 | return acpi_table_parse_madt_family(ACPI_SIG_MADT, |
224 | sizeof(struct acpi_table_madt), id, | 225 | sizeof(struct acpi_table_madt), id, |
225 | handler, max_entries); | 226 | handler, max_entries); |
226 | } | 227 | } |
@@ -228,7 +229,6 @@ acpi_table_parse_madt(enum acpi_madt_entry_id id, | |||
228 | int __init acpi_table_parse(char *id, acpi_table_handler handler) | 229 | int __init acpi_table_parse(char *id, acpi_table_handler handler) |
229 | { | 230 | { |
230 | struct acpi_table_header *table = NULL; | 231 | struct acpi_table_header *table = NULL; |
231 | |||
232 | if (!handler) | 232 | if (!handler) |
233 | return -EINVAL; | 233 | return -EINVAL; |
234 | 234 | ||
@@ -245,10 +245,11 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler) | |||
245 | * | 245 | * |
246 | * find RSDP, find and checksum SDT/XSDT. | 246 | * find RSDP, find and checksum SDT/XSDT. |
247 | * checksum all tables, print SDT/XSDT | 247 | * checksum all tables, print SDT/XSDT |
248 | * | 248 | * |
249 | * result: sdt_entry[] is initialized | 249 | * result: sdt_entry[] is initialized |
250 | */ | 250 | */ |
251 | 251 | ||
252 | |||
252 | int __init acpi_table_init(void) | 253 | int __init acpi_table_init(void) |
253 | { | 254 | { |
254 | acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); | 255 | acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); |