diff options
Diffstat (limited to 'drivers/acpi/tables.c')
-rw-r--r-- | drivers/acpi/tables.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index ffa30c9fccbf..5bb143151169 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -74,6 +74,7 @@ static unsigned long sdt_pa; /* Physical Address */ | |||
74 | static unsigned long sdt_count; /* Table count */ | 74 | static unsigned long sdt_count; /* Table count */ |
75 | 75 | ||
76 | static struct acpi_table_sdt sdt_entry[ACPI_MAX_TABLES] __initdata; | 76 | static struct acpi_table_sdt sdt_entry[ACPI_MAX_TABLES] __initdata; |
77 | static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata; | ||
77 | 78 | ||
78 | void acpi_table_print(struct acpi_table_header *header, unsigned long phys_addr) | 79 | void acpi_table_print(struct acpi_table_header *header, unsigned long phys_addr) |
79 | { | 80 | { |
@@ -284,12 +285,12 @@ acpi_get_table_header_early(enum acpi_table_id id, | |||
284 | struct fadt_descriptor *fadt = | 285 | struct fadt_descriptor *fadt = |
285 | (struct fadt_descriptor *)*header; | 286 | (struct fadt_descriptor *)*header; |
286 | 287 | ||
287 | if (fadt->revision == 3 && fadt->Xdsdt) { | 288 | if (fadt->header.revision == 3 && fadt->Xdsdt) { |
288 | *header = (void *)__acpi_map_table(fadt->Xdsdt, | 289 | *header = (void *)__acpi_map_table(fadt->Xdsdt, |
289 | sizeof(struct | 290 | sizeof(struct |
290 | acpi_table_header)); | 291 | acpi_table_header)); |
291 | } else if (fadt->V1_dsdt) { | 292 | } else if (fadt->dsdt) { |
292 | *header = (void *)__acpi_map_table(fadt->V1_dsdt, | 293 | *header = (void *)__acpi_map_table(fadt->dsdt, |
293 | sizeof(struct | 294 | sizeof(struct |
294 | acpi_table_header)); | 295 | acpi_table_header)); |
295 | } else | 296 | } else |
@@ -410,12 +411,11 @@ static int __init acpi_table_get_sdt(struct acpi_table_rsdp *rsdp) | |||
410 | 411 | ||
411 | /* First check XSDT (but only on ACPI 2.0-compatible systems) */ | 412 | /* First check XSDT (but only on ACPI 2.0-compatible systems) */ |
412 | 413 | ||
413 | if ((rsdp->revision >= 2) && | 414 | if ((rsdp->revision >= 2) && rsdp->xsdt_physical_address) { |
414 | (((struct acpi20_table_rsdp *)rsdp)->xsdt_address)) { | ||
415 | 415 | ||
416 | struct acpi_table_xsdt *mapped_xsdt = NULL; | 416 | struct acpi_table_xsdt *mapped_xsdt = NULL; |
417 | 417 | ||
418 | sdt_pa = ((struct acpi20_table_rsdp *)rsdp)->xsdt_address; | 418 | sdt_pa = rsdp->xsdt_physical_address; |
419 | 419 | ||
420 | /* map in just the header */ | 420 | /* map in just the header */ |
421 | header = (struct acpi_table_header *) | 421 | header = (struct acpi_table_header *) |
@@ -457,16 +457,16 @@ static int __init acpi_table_get_sdt(struct acpi_table_rsdp *rsdp) | |||
457 | } | 457 | } |
458 | 458 | ||
459 | for (i = 0; i < sdt_count; i++) | 459 | for (i = 0; i < sdt_count; i++) |
460 | sdt_entry[i].pa = (unsigned long)mapped_xsdt->entry[i]; | 460 | sdt_entry[i].pa = (unsigned long)mapped_xsdt->table_offset_entry[i]; |
461 | } | 461 | } |
462 | 462 | ||
463 | /* Then check RSDT */ | 463 | /* Then check RSDT */ |
464 | 464 | ||
465 | else if (rsdp->rsdt_address) { | 465 | else if (rsdp->rsdt_physical_address) { |
466 | 466 | ||
467 | struct acpi_table_rsdt *mapped_rsdt = NULL; | 467 | struct acpi_table_rsdt *mapped_rsdt = NULL; |
468 | 468 | ||
469 | sdt_pa = rsdp->rsdt_address; | 469 | sdt_pa = rsdp->rsdt_physical_address; |
470 | 470 | ||
471 | /* map in just the header */ | 471 | /* map in just the header */ |
472 | header = (struct acpi_table_header *) | 472 | header = (struct acpi_table_header *) |
@@ -507,7 +507,7 @@ static int __init acpi_table_get_sdt(struct acpi_table_rsdp *rsdp) | |||
507 | } | 507 | } |
508 | 508 | ||
509 | for (i = 0; i < sdt_count; i++) | 509 | for (i = 0; i < sdt_count; i++) |
510 | sdt_entry[i].pa = (unsigned long)mapped_rsdt->entry[i]; | 510 | sdt_entry[i].pa = (unsigned long)mapped_rsdt->table_offset_entry[i]; |
511 | } | 511 | } |
512 | 512 | ||
513 | else { | 513 | else { |
@@ -599,13 +599,10 @@ int __init acpi_table_init(void) | |||
599 | 599 | ||
600 | if (rsdp->revision < 2) | 600 | if (rsdp->revision < 2) |
601 | result = | 601 | result = |
602 | acpi_table_compute_checksum(rsdp, | 602 | acpi_table_compute_checksum(rsdp, ACPI_RSDP_REV0_SIZE); |
603 | sizeof(struct acpi_table_rsdp)); | ||
604 | else | 603 | else |
605 | result = | 604 | result = |
606 | acpi_table_compute_checksum(rsdp, | 605 | acpi_table_compute_checksum(rsdp, rsdp->length); |
607 | ((struct acpi20_table_rsdp *) | ||
608 | rsdp)->length); | ||
609 | 606 | ||
610 | if (result) { | 607 | if (result) { |
611 | printk(KERN_WARNING " >>> ERROR: Invalid checksum\n"); | 608 | printk(KERN_WARNING " >>> ERROR: Invalid checksum\n"); |
@@ -617,5 +614,7 @@ int __init acpi_table_init(void) | |||
617 | if (acpi_table_get_sdt(rsdp)) | 614 | if (acpi_table_get_sdt(rsdp)) |
618 | return -ENODEV; | 615 | return -ENODEV; |
619 | 616 | ||
617 | acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); | ||
618 | |||
620 | return 0; | 619 | return 0; |
621 | } | 620 | } |