aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-04-07 05:15:40 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-07 05:15:40 -0400
commit5e34437840d33554f69380584311743b39e8fbeb (patch)
treee081135619ee146af5efb9ee883afca950df5757 /drivers/acpi/tables.c
parent77d05632baee21b1cef8730d7c06aa69601e4dca (diff)
parentd508afb437daee7cf07da085b635c44a4ebf9b38 (diff)
Merge branch 'linus' into core/softlockup
Conflicts: kernel/sysctl.c
Diffstat (limited to 'drivers/acpi/tables.c')
-rw-r--r--drivers/acpi/tables.c50
1 files changed, 44 insertions, 6 deletions
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index a8852952fac4..646d39c031ca 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -62,6 +62,18 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
62 } 62 }
63 break; 63 break;
64 64
65 case ACPI_MADT_TYPE_LOCAL_X2APIC:
66 {
67 struct acpi_madt_local_x2apic *p =
68 (struct acpi_madt_local_x2apic *)header;
69 printk(KERN_INFO PREFIX
70 "X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n",
71 p->local_apic_id, p->uid,
72 (p->lapic_flags & ACPI_MADT_ENABLED) ?
73 "enabled" : "disabled");
74 }
75 break;
76
65 case ACPI_MADT_TYPE_IO_APIC: 77 case ACPI_MADT_TYPE_IO_APIC:
66 { 78 {
67 struct acpi_madt_io_apic *p = 79 struct acpi_madt_io_apic *p =
@@ -116,6 +128,24 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
116 } 128 }
117 break; 129 break;
118 130
131 case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
132 {
133 u16 polarity, trigger;
134 struct acpi_madt_local_x2apic_nmi *p =
135 (struct acpi_madt_local_x2apic_nmi *)header;
136
137 polarity = p->inti_flags & ACPI_MADT_POLARITY_MASK;
138 trigger = (p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2;
139
140 printk(KERN_INFO PREFIX
141 "X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n",
142 p->uid,
143 mps_inti_flags_polarity[polarity],
144 mps_inti_flags_trigger[trigger],
145 p->lint);
146 }
147 break;
148
119 case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: 149 case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
120 { 150 {
121 struct acpi_madt_local_apic_override *p = 151 struct acpi_madt_local_apic_override *p =
@@ -181,14 +211,15 @@ acpi_table_parse_entries(char *id,
181 struct acpi_subtable_header *entry; 211 struct acpi_subtable_header *entry;
182 unsigned int count = 0; 212 unsigned int count = 0;
183 unsigned long table_end; 213 unsigned long table_end;
214 acpi_size tbl_size;
184 215
185 if (!handler) 216 if (!handler)
186 return -EINVAL; 217 return -EINVAL;
187 218
188 if (strncmp(id, ACPI_SIG_MADT, 4) == 0) 219 if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
189 acpi_get_table(id, acpi_apic_instance, &table_header); 220 acpi_get_table_with_size(id, acpi_apic_instance, &table_header, &tbl_size);
190 else 221 else
191 acpi_get_table(id, 0, &table_header); 222 acpi_get_table_with_size(id, 0, &table_header, &tbl_size);
192 223
193 if (!table_header) { 224 if (!table_header) {
194 printk(KERN_WARNING PREFIX "%4.4s not present\n", id); 225 printk(KERN_WARNING PREFIX "%4.4s not present\n", id);
@@ -206,8 +237,10 @@ acpi_table_parse_entries(char *id,
206 table_end) { 237 table_end) {
207 if (entry->type == entry_id 238 if (entry->type == entry_id
208 && (!max_entries || count++ < max_entries)) 239 && (!max_entries || count++ < max_entries))
209 if (handler(entry, table_end)) 240 if (handler(entry, table_end)) {
241 early_acpi_os_unmap_memory((char *)table_header, tbl_size);
210 return -EINVAL; 242 return -EINVAL;
243 }
211 244
212 entry = (struct acpi_subtable_header *) 245 entry = (struct acpi_subtable_header *)
213 ((unsigned long)entry + entry->length); 246 ((unsigned long)entry + entry->length);
@@ -217,6 +250,7 @@ acpi_table_parse_entries(char *id,
217 "%i found\n", id, entry_id, count - max_entries, count); 250 "%i found\n", id, entry_id, count - max_entries, count);
218 } 251 }
219 252
253 early_acpi_os_unmap_memory((char *)table_header, tbl_size);
220 return count; 254 return count;
221} 255}
222 256
@@ -241,17 +275,19 @@ acpi_table_parse_madt(enum acpi_madt_type id,
241int __init acpi_table_parse(char *id, acpi_table_handler handler) 275int __init acpi_table_parse(char *id, acpi_table_handler handler)
242{ 276{
243 struct acpi_table_header *table = NULL; 277 struct acpi_table_header *table = NULL;
278 acpi_size tbl_size;
244 279
245 if (!handler) 280 if (!handler)
246 return -EINVAL; 281 return -EINVAL;
247 282
248 if (strncmp(id, ACPI_SIG_MADT, 4) == 0) 283 if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
249 acpi_get_table(id, acpi_apic_instance, &table); 284 acpi_get_table_with_size(id, acpi_apic_instance, &table, &tbl_size);
250 else 285 else
251 acpi_get_table(id, 0, &table); 286 acpi_get_table_with_size(id, 0, &table, &tbl_size);
252 287
253 if (table) { 288 if (table) {
254 handler(table); 289 handler(table);
290 early_acpi_os_unmap_memory(table, tbl_size);
255 return 0; 291 return 0;
256 } else 292 } else
257 return 1; 293 return 1;
@@ -265,8 +301,9 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
265static void __init check_multiple_madt(void) 301static void __init check_multiple_madt(void)
266{ 302{
267 struct acpi_table_header *table = NULL; 303 struct acpi_table_header *table = NULL;
304 acpi_size tbl_size;
268 305
269 acpi_get_table(ACPI_SIG_MADT, 2, &table); 306 acpi_get_table_with_size(ACPI_SIG_MADT, 2, &table, &tbl_size);
270 if (table) { 307 if (table) {
271 printk(KERN_WARNING PREFIX 308 printk(KERN_WARNING PREFIX
272 "BIOS bug: multiple APIC/MADT found," 309 "BIOS bug: multiple APIC/MADT found,"
@@ -275,6 +312,7 @@ static void __init check_multiple_madt(void)
275 "If \"acpi_apic_instance=%d\" works better, " 312 "If \"acpi_apic_instance=%d\" works better, "
276 "notify linux-acpi@vger.kernel.org\n", 313 "notify linux-acpi@vger.kernel.org\n",
277 acpi_apic_instance ? 0 : 2); 314 acpi_apic_instance ? 0 : 2);
315 early_acpi_os_unmap_memory(table, tbl_size);
278 316
279 } else 317 } else
280 acpi_apic_instance = 0; 318 acpi_apic_instance = 0;