summaryrefslogtreecommitdiff
path: root/drivers/acpi/tables/tbrsdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/tables/tbrsdt.c')
-rw-r--r--drivers/acpi/tables/tbrsdt.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c
index b7ffe39..13c6ddb 100644
--- a/drivers/acpi/tables/tbrsdt.c
+++ b/drivers/acpi/tables/tbrsdt.c
@@ -159,8 +159,8 @@ cleanup:
*
* RETURN: None, Address
*
- * DESCRIPTION: Extract the address of the RSDT or XSDT, depending on the
- * version of the RSDP
+ * DESCRIPTION: Extract the address of either the RSDT or XSDT, depending on the
+ * version of the RSDP and whether the XSDT pointer is valid
*
******************************************************************************/
@@ -174,16 +174,19 @@ acpi_tb_get_rsdt_address (
out_address->pointer_type = acpi_gbl_table_flags | ACPI_LOGICAL_ADDRESSING;
- /*
- * For RSDP revision 0 or 1, we use the RSDT.
- * For RSDP revision 2 (and above), we use the XSDT
- */
- if (acpi_gbl_RSDP->revision < 2) {
- out_address->pointer.value = acpi_gbl_RSDP->rsdt_physical_address;
- }
- else {
+ /* Use XSDT if it is present */
+
+ if ((acpi_gbl_RSDP->revision >= 2) &&
+ acpi_gbl_RSDP->xsdt_physical_address) {
out_address->pointer.value =
acpi_gbl_RSDP->xsdt_physical_address;
+ acpi_gbl_root_table_type = ACPI_TABLE_TYPE_XSDT;
+ }
+ else {
+ /* No XSDT, use the RSDT */
+
+ out_address->pointer.value = acpi_gbl_RSDP->rsdt_physical_address;
+ acpi_gbl_root_table_type = ACPI_TABLE_TYPE_RSDT;
}
}
@@ -211,10 +214,9 @@ acpi_tb_validate_rsdt (
/*
- * For RSDP revision 0 or 1, we use the RSDT.
- * For RSDP revision 2 and above, we use the XSDT
+ * Search for appropriate signature, RSDT or XSDT
*/
- if (acpi_gbl_RSDP->revision < 2) {
+ if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
no_match = ACPI_STRNCMP ((char *) table_ptr, RSDT_SIG,
sizeof (RSDT_SIG) -1);
}
@@ -236,11 +238,11 @@ acpi_tb_validate_rsdt (
acpi_gbl_RSDP->rsdt_physical_address,
(void *) (acpi_native_uint) acpi_gbl_RSDP->rsdt_physical_address));
- if (acpi_gbl_RSDP->revision < 2) {
- ACPI_REPORT_ERROR (("Looking for RSDT (RSDP->Rev < 2)\n"))
+ if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
+ ACPI_REPORT_ERROR (("Looking for RSDT\n"))
}
else {
- ACPI_REPORT_ERROR (("Looking for XSDT (RSDP->Rev >= 2)\n"))
+ ACPI_REPORT_ERROR (("Looking for XSDT\n"))
}
ACPI_DUMP_BUFFER ((char *) table_ptr, 48);