aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/tables')
-rw-r--r--drivers/acpi/tables/tbconvrt.c8
-rw-r--r--drivers/acpi/tables/tbrsdt.c34
-rw-r--r--drivers/acpi/tables/tbxfroot.c8
3 files changed, 29 insertions, 21 deletions
diff --git a/drivers/acpi/tables/tbconvrt.c b/drivers/acpi/tables/tbconvrt.c
index 92e0c31539be..d4ff71f5fe5d 100644
--- a/drivers/acpi/tables/tbconvrt.c
+++ b/drivers/acpi/tables/tbconvrt.c
@@ -97,7 +97,9 @@ acpi_tb_get_table_count (
97 ACPI_FUNCTION_ENTRY (); 97 ACPI_FUNCTION_ENTRY ();
98 98
99 99
100 if (RSDP->revision < 2) { 100 /* RSDT pointers are 32 bits, XSDT pointers are 64 bits */
101
102 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
101 pointer_size = sizeof (u32); 103 pointer_size = sizeof (u32);
102 } 104 }
103 else { 105 else {
@@ -158,7 +160,9 @@ acpi_tb_convert_to_xsdt (
158 /* Copy the table pointers */ 160 /* Copy the table pointers */
159 161
160 for (i = 0; i < acpi_gbl_rsdt_table_count; i++) { 162 for (i = 0; i < acpi_gbl_rsdt_table_count; i++) {
161 if (acpi_gbl_RSDP->revision < 2) { 163 /* RSDT pointers are 32 bits, XSDT pointers are 64 bits */
164
165 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
162 ACPI_STORE_ADDRESS (new_table->table_offset_entry[i], 166 ACPI_STORE_ADDRESS (new_table->table_offset_entry[i],
163 (ACPI_CAST_PTR (struct rsdt_descriptor_rev1, 167 (ACPI_CAST_PTR (struct rsdt_descriptor_rev1,
164 table_info->pointer))->table_offset_entry[i]); 168 table_info->pointer))->table_offset_entry[i]);
diff --git a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c
index b7ffe39c3626..13c6ddb2f546 100644
--- a/drivers/acpi/tables/tbrsdt.c
+++ b/drivers/acpi/tables/tbrsdt.c
@@ -159,8 +159,8 @@ cleanup:
159 * 159 *
160 * RETURN: None, Address 160 * RETURN: None, Address
161 * 161 *
162 * DESCRIPTION: Extract the address of the RSDT or XSDT, depending on the 162 * DESCRIPTION: Extract the address of either the RSDT or XSDT, depending on the
163 * version of the RSDP 163 * version of the RSDP and whether the XSDT pointer is valid
164 * 164 *
165 ******************************************************************************/ 165 ******************************************************************************/
166 166
@@ -174,16 +174,19 @@ acpi_tb_get_rsdt_address (
174 174
175 out_address->pointer_type = acpi_gbl_table_flags | ACPI_LOGICAL_ADDRESSING; 175 out_address->pointer_type = acpi_gbl_table_flags | ACPI_LOGICAL_ADDRESSING;
176 176
177 /* 177 /* Use XSDT if it is present */
178 * For RSDP revision 0 or 1, we use the RSDT. 178
179 * For RSDP revision 2 (and above), we use the XSDT 179 if ((acpi_gbl_RSDP->revision >= 2) &&
180 */ 180 acpi_gbl_RSDP->xsdt_physical_address) {
181 if (acpi_gbl_RSDP->revision < 2) {
182 out_address->pointer.value = acpi_gbl_RSDP->rsdt_physical_address;
183 }
184 else {
185 out_address->pointer.value = 181 out_address->pointer.value =
186 acpi_gbl_RSDP->xsdt_physical_address; 182 acpi_gbl_RSDP->xsdt_physical_address;
183 acpi_gbl_root_table_type = ACPI_TABLE_TYPE_XSDT;
184 }
185 else {
186 /* No XSDT, use the RSDT */
187
188 out_address->pointer.value = acpi_gbl_RSDP->rsdt_physical_address;
189 acpi_gbl_root_table_type = ACPI_TABLE_TYPE_RSDT;
187 } 190 }
188} 191}
189 192
@@ -211,10 +214,9 @@ acpi_tb_validate_rsdt (
211 214
212 215
213 /* 216 /*
214 * For RSDP revision 0 or 1, we use the RSDT. 217 * Search for appropriate signature, RSDT or XSDT
215 * For RSDP revision 2 and above, we use the XSDT
216 */ 218 */
217 if (acpi_gbl_RSDP->revision < 2) { 219 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
218 no_match = ACPI_STRNCMP ((char *) table_ptr, RSDT_SIG, 220 no_match = ACPI_STRNCMP ((char *) table_ptr, RSDT_SIG,
219 sizeof (RSDT_SIG) -1); 221 sizeof (RSDT_SIG) -1);
220 } 222 }
@@ -236,11 +238,11 @@ acpi_tb_validate_rsdt (
236 acpi_gbl_RSDP->rsdt_physical_address, 238 acpi_gbl_RSDP->rsdt_physical_address,
237 (void *) (acpi_native_uint) acpi_gbl_RSDP->rsdt_physical_address)); 239 (void *) (acpi_native_uint) acpi_gbl_RSDP->rsdt_physical_address));
238 240
239 if (acpi_gbl_RSDP->revision < 2) { 241 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
240 ACPI_REPORT_ERROR (("Looking for RSDT (RSDP->Rev < 2)\n")) 242 ACPI_REPORT_ERROR (("Looking for RSDT\n"))
241 } 243 }
242 else { 244 else {
243 ACPI_REPORT_ERROR (("Looking for XSDT (RSDP->Rev >= 2)\n")) 245 ACPI_REPORT_ERROR (("Looking for XSDT\n"))
244 } 246 }
245 247
246 ACPI_DUMP_BUFFER ((char *) table_ptr, 48); 248 ACPI_DUMP_BUFFER ((char *) table_ptr, 48);
diff --git a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c
index 198997aa7fbe..fe9c8317df46 100644
--- a/drivers/acpi/tables/tbxfroot.c
+++ b/drivers/acpi/tables/tbxfroot.c
@@ -287,9 +287,11 @@ acpi_get_firmware_table (
287 * requested table 287 * requested table
288 */ 288 */
289 for (i = 0, j = 0; i < table_count; i++) { 289 for (i = 0, j = 0; i < table_count; i++) {
290 /* Get the next table pointer, handle RSDT vs. XSDT */ 290 /*
291 291 * Get the next table pointer, handle RSDT vs. XSDT
292 if (acpi_gbl_RSDP->revision < 2) { 292 * RSDT pointers are 32 bits, XSDT pointers are 64 bits
293 */
294 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
293 address.pointer.value = (ACPI_CAST_PTR ( 295 address.pointer.value = (ACPI_CAST_PTR (
294 RSDT_DESCRIPTOR, rsdt_info->pointer))->table_offset_entry[i]; 296 RSDT_DESCRIPTOR, rsdt_info->pointer))->table_offset_entry[i];
295 } 297 }