Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 3 | * Module Name: tbutils - table utilities |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * |
| 5 | *****************************************************************************/ |
| 6 | |
| 7 | /* |
Bob Moore | a8357b0 | 2010-01-22 19:07:36 +0800 | [diff] [blame] | 8 | * Copyright (C) 2000 - 2010, Intel Corp. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | * All rights reserved. |
| 10 | * |
| 11 | * Redistribution and use in source and binary forms, with or without |
| 12 | * modification, are permitted provided that the following conditions |
| 13 | * are met: |
| 14 | * 1. Redistributions of source code must retain the above copyright |
| 15 | * notice, this list of conditions, and the following disclaimer, |
| 16 | * without modification. |
| 17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
| 18 | * substantially similar to the "NO WARRANTY" disclaimer below |
| 19 | * ("Disclaimer") and any redistribution must be conditioned upon |
| 20 | * including a substantially similar Disclaimer requirement for further |
| 21 | * binary redistribution. |
| 22 | * 3. Neither the names of the above-listed copyright holders nor the names |
| 23 | * of any contributors may be used to endorse or promote products derived |
| 24 | * from this software without specific prior written permission. |
| 25 | * |
| 26 | * Alternatively, this software may be distributed under the terms of the |
| 27 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 28 | * Software Foundation. |
| 29 | * |
| 30 | * NO WARRANTY |
| 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
| 34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 41 | * POSSIBILITY OF SUCH DAMAGES. |
| 42 | */ |
| 43 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | #include <acpi/acpi.h> |
Len Brown | e2f7a77 | 2009-01-09 00:30:03 -0500 | [diff] [blame] | 45 | #include "accommon.h" |
| 46 | #include "actables.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | #define _COMPONENT ACPI_TABLES |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 49 | ACPI_MODULE_NAME("tbutils") |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 51 | /* Local prototypes */ |
Bob Moore | cf02cd4 | 2009-06-24 11:38:46 +0800 | [diff] [blame] | 52 | static void acpi_tb_fix_string(char *string, acpi_size length); |
| 53 | |
| 54 | static void |
| 55 | acpi_tb_cleanup_table_header(struct acpi_table_header *out_header, |
| 56 | struct acpi_table_header *header); |
| 57 | |
Bob Moore | a4bbb810 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 58 | static acpi_physical_address |
Bob Moore | 67a119f | 2008-06-10 13:42:13 +0800 | [diff] [blame] | 59 | acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size); |
| 60 | |
Zhao Yakui | 9f3119b | 2007-08-24 16:18:16 +0800 | [diff] [blame] | 61 | /******************************************************************************* |
| 62 | * |
| 63 | * FUNCTION: acpi_tb_check_xsdt |
| 64 | * |
| 65 | * PARAMETERS: address - Pointer to the XSDT |
| 66 | * |
| 67 | * RETURN: status |
| 68 | * AE_OK - XSDT is okay |
| 69 | * AE_NO_MEMORY - can't map XSDT |
| 70 | * AE_INVALID_TABLE_LENGTH - invalid table length |
| 71 | * AE_NULL_ENTRY - XSDT has NULL entry |
| 72 | * |
| 73 | * DESCRIPTION: validate XSDT |
| 74 | ******************************************************************************/ |
| 75 | |
| 76 | static acpi_status |
| 77 | acpi_tb_check_xsdt(acpi_physical_address address) |
| 78 | { |
| 79 | struct acpi_table_header *table; |
| 80 | u32 length; |
| 81 | u64 xsdt_entry_address; |
| 82 | u8 *table_entry; |
| 83 | u32 table_count; |
| 84 | int i; |
| 85 | |
| 86 | table = acpi_os_map_memory(address, sizeof(struct acpi_table_header)); |
| 87 | if (!table) |
| 88 | return AE_NO_MEMORY; |
| 89 | |
| 90 | length = table->length; |
| 91 | acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); |
| 92 | if (length < sizeof(struct acpi_table_header)) |
| 93 | return AE_INVALID_TABLE_LENGTH; |
| 94 | |
| 95 | table = acpi_os_map_memory(address, length); |
| 96 | if (!table) |
| 97 | return AE_NO_MEMORY; |
| 98 | |
| 99 | /* Calculate the number of tables described in XSDT */ |
| 100 | table_count = |
| 101 | (u32) ((table->length - |
| 102 | sizeof(struct acpi_table_header)) / sizeof(u64)); |
| 103 | table_entry = |
| 104 | ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header); |
| 105 | for (i = 0; i < table_count; i++) { |
| 106 | ACPI_MOVE_64_TO_64(&xsdt_entry_address, table_entry); |
| 107 | if (!xsdt_entry_address) { |
| 108 | /* XSDT has NULL entry */ |
| 109 | break; |
| 110 | } |
| 111 | table_entry += sizeof(u64); |
| 112 | } |
| 113 | acpi_os_unmap_memory(table, length); |
| 114 | |
| 115 | if (i < table_count) |
| 116 | return AE_NULL_ENTRY; |
| 117 | else |
| 118 | return AE_OK; |
| 119 | } |
Bob Moore | a4bbb810 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 120 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | /******************************************************************************* |
| 122 | * |
Bob Moore | 009c4cbe | 2008-11-12 15:34:52 +0800 | [diff] [blame] | 123 | * FUNCTION: acpi_tb_initialize_facs |
| 124 | * |
| 125 | * PARAMETERS: None |
| 126 | * |
| 127 | * RETURN: Status |
| 128 | * |
| 129 | * DESCRIPTION: Create a permanent mapping for the FADT and save it in a global |
| 130 | * for accessing the Global Lock and Firmware Waking Vector |
| 131 | * |
| 132 | ******************************************************************************/ |
| 133 | |
| 134 | acpi_status acpi_tb_initialize_facs(void) |
| 135 | { |
| 136 | acpi_status status; |
| 137 | |
| 138 | status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS, |
| 139 | ACPI_CAST_INDIRECT_PTR(struct |
| 140 | acpi_table_header, |
| 141 | &acpi_gbl_FACS)); |
| 142 | return status; |
| 143 | } |
| 144 | |
| 145 | /******************************************************************************* |
| 146 | * |
Bob Moore | c857303 | 2007-02-02 19:48:23 +0300 | [diff] [blame] | 147 | * FUNCTION: acpi_tb_tables_loaded |
| 148 | * |
| 149 | * PARAMETERS: None |
| 150 | * |
| 151 | * RETURN: TRUE if required ACPI tables are loaded |
| 152 | * |
| 153 | * DESCRIPTION: Determine if the minimum required ACPI tables are present |
| 154 | * (FADT, FACS, DSDT) |
| 155 | * |
| 156 | ******************************************************************************/ |
| 157 | |
| 158 | u8 acpi_tb_tables_loaded(void) |
| 159 | { |
| 160 | |
| 161 | if (acpi_gbl_root_table_list.count >= 3) { |
| 162 | return (TRUE); |
| 163 | } |
| 164 | |
| 165 | return (FALSE); |
| 166 | } |
| 167 | |
| 168 | /******************************************************************************* |
| 169 | * |
Bob Moore | cf02cd4 | 2009-06-24 11:38:46 +0800 | [diff] [blame] | 170 | * FUNCTION: acpi_tb_fix_string |
| 171 | * |
| 172 | * PARAMETERS: String - String to be repaired |
| 173 | * Length - Maximum length |
| 174 | * |
| 175 | * RETURN: None |
| 176 | * |
| 177 | * DESCRIPTION: Replace every non-printable or non-ascii byte in the string |
| 178 | * with a question mark '?'. |
| 179 | * |
| 180 | ******************************************************************************/ |
| 181 | |
| 182 | static void acpi_tb_fix_string(char *string, acpi_size length) |
| 183 | { |
| 184 | |
| 185 | while (length && *string) { |
| 186 | if (!ACPI_IS_PRINT(*string)) { |
| 187 | *string = '?'; |
| 188 | } |
| 189 | string++; |
| 190 | length--; |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | /******************************************************************************* |
| 195 | * |
| 196 | * FUNCTION: acpi_tb_cleanup_table_header |
| 197 | * |
| 198 | * PARAMETERS: out_header - Where the cleaned header is returned |
| 199 | * Header - Input ACPI table header |
| 200 | * |
| 201 | * RETURN: Returns the cleaned header in out_header |
| 202 | * |
| 203 | * DESCRIPTION: Copy the table header and ensure that all "string" fields in |
| 204 | * the header consist of printable characters. |
| 205 | * |
| 206 | ******************************************************************************/ |
| 207 | |
| 208 | static void |
| 209 | acpi_tb_cleanup_table_header(struct acpi_table_header *out_header, |
| 210 | struct acpi_table_header *header) |
| 211 | { |
| 212 | |
| 213 | ACPI_MEMCPY(out_header, header, sizeof(struct acpi_table_header)); |
| 214 | |
| 215 | acpi_tb_fix_string(out_header->signature, ACPI_NAME_SIZE); |
| 216 | acpi_tb_fix_string(out_header->oem_id, ACPI_OEM_ID_SIZE); |
| 217 | acpi_tb_fix_string(out_header->oem_table_id, ACPI_OEM_TABLE_ID_SIZE); |
| 218 | acpi_tb_fix_string(out_header->asl_compiler_id, ACPI_NAME_SIZE); |
| 219 | } |
| 220 | |
| 221 | /******************************************************************************* |
| 222 | * |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 223 | * FUNCTION: acpi_tb_print_table_header |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 224 | * |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 225 | * PARAMETERS: Address - Table physical address |
| 226 | * Header - Table header |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 227 | * |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 228 | * RETURN: None |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 229 | * |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 230 | * DESCRIPTION: Print an ACPI table header. Special cases for FACS and RSDP. |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 231 | * |
| 232 | ******************************************************************************/ |
| 233 | |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 234 | void |
| 235 | acpi_tb_print_table_header(acpi_physical_address address, |
| 236 | struct acpi_table_header *header) |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 237 | { |
Bob Moore | cf02cd4 | 2009-06-24 11:38:46 +0800 | [diff] [blame] | 238 | struct acpi_table_header local_header; |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 239 | |
Bob Moore | b6bc342 | 2009-02-23 10:26:19 +0800 | [diff] [blame] | 240 | /* |
| 241 | * The reason that the Address is cast to a void pointer is so that we |
| 242 | * can use %p which will work properly on both 32-bit and 64-bit hosts. |
| 243 | */ |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 244 | if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_FACS)) { |
| 245 | |
Bob Moore | b6bc342 | 2009-02-23 10:26:19 +0800 | [diff] [blame] | 246 | /* FACS only has signature and length fields */ |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 247 | |
Bob Moore | b6bc342 | 2009-02-23 10:26:19 +0800 | [diff] [blame] | 248 | ACPI_INFO((AE_INFO, "%4.4s %p %05X", |
| 249 | header->signature, ACPI_CAST_PTR(void, address), |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 250 | header->length)); |
| 251 | } else if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_RSDP)) { |
| 252 | |
| 253 | /* RSDP has no common fields */ |
| 254 | |
Bob Moore | cf02cd4 | 2009-06-24 11:38:46 +0800 | [diff] [blame] | 255 | ACPI_MEMCPY(local_header.oem_id, |
| 256 | ACPI_CAST_PTR(struct acpi_table_rsdp, |
| 257 | header)->oem_id, ACPI_OEM_ID_SIZE); |
| 258 | acpi_tb_fix_string(local_header.oem_id, ACPI_OEM_ID_SIZE); |
| 259 | |
Bob Moore | b6bc342 | 2009-02-23 10:26:19 +0800 | [diff] [blame] | 260 | ACPI_INFO((AE_INFO, "RSDP %p %05X (v%.2d %6.6s)", |
| 261 | ACPI_CAST_PTR (void, address), |
Bob Moore | a4bbb810 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 262 | (ACPI_CAST_PTR(struct acpi_table_rsdp, header)-> |
| 263 | revision > |
| 264 | 0) ? ACPI_CAST_PTR(struct acpi_table_rsdp, |
| 265 | header)->length : 20, |
| 266 | ACPI_CAST_PTR(struct acpi_table_rsdp, |
| 267 | header)->revision, |
Bob Moore | cf02cd4 | 2009-06-24 11:38:46 +0800 | [diff] [blame] | 268 | local_header.oem_id)); |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 269 | } else { |
Bob Moore | 4bf2739 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 270 | /* Standard ACPI table with full common header */ |
| 271 | |
Bob Moore | cf02cd4 | 2009-06-24 11:38:46 +0800 | [diff] [blame] | 272 | acpi_tb_cleanup_table_header(&local_header, header); |
| 273 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 274 | ACPI_INFO((AE_INFO, |
Bob Moore | b6bc342 | 2009-02-23 10:26:19 +0800 | [diff] [blame] | 275 | "%4.4s %p %05X (v%.2d %6.6s %8.8s %08X %4.4s %08X)", |
Bob Moore | cf02cd4 | 2009-06-24 11:38:46 +0800 | [diff] [blame] | 276 | local_header.signature, ACPI_CAST_PTR(void, address), |
| 277 | local_header.length, local_header.revision, |
| 278 | local_header.oem_id, local_header.oem_table_id, |
| 279 | local_header.oem_revision, |
| 280 | local_header.asl_compiler_id, |
| 281 | local_header.asl_compiler_revision)); |
| 282 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 283 | } |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 284 | } |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 285 | |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 286 | /******************************************************************************* |
| 287 | * |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 288 | * FUNCTION: acpi_tb_validate_checksum |
| 289 | * |
| 290 | * PARAMETERS: Table - ACPI table to verify |
| 291 | * Length - Length of entire table |
| 292 | * |
| 293 | * RETURN: Status |
| 294 | * |
| 295 | * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns |
| 296 | * exception on bad checksum. |
| 297 | * |
| 298 | ******************************************************************************/ |
| 299 | |
| 300 | acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) |
| 301 | { |
| 302 | u8 checksum; |
| 303 | |
| 304 | /* Compute the checksum on the table */ |
| 305 | |
| 306 | checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, table), length); |
| 307 | |
| 308 | /* Checksum ok? (should be zero) */ |
| 309 | |
| 310 | if (checksum) { |
| 311 | ACPI_WARNING((AE_INFO, |
Bob Moore | f6a22b0 | 2010-03-05 17:56:40 +0800 | [diff] [blame] | 312 | "Incorrect checksum in table [%4.4s] - 0x%2.2X, should be 0x%2.2X", |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 313 | table->signature, table->checksum, |
| 314 | (u8) (table->checksum - checksum))); |
| 315 | |
| 316 | #if (ACPI_CHECKSUM_ABORT) |
| 317 | |
| 318 | return (AE_BAD_CHECKSUM); |
| 319 | #endif |
| 320 | } |
| 321 | |
| 322 | return (AE_OK); |
| 323 | } |
| 324 | |
| 325 | /******************************************************************************* |
| 326 | * |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 327 | * FUNCTION: acpi_tb_checksum |
| 328 | * |
| 329 | * PARAMETERS: Buffer - Pointer to memory region to be checked |
| 330 | * Length - Length of this memory region |
| 331 | * |
| 332 | * RETURN: Checksum (u8) |
| 333 | * |
| 334 | * DESCRIPTION: Calculates circular checksum of memory region. |
| 335 | * |
| 336 | ******************************************************************************/ |
| 337 | |
Bob Moore | 67a119f | 2008-06-10 13:42:13 +0800 | [diff] [blame] | 338 | u8 acpi_tb_checksum(u8 *buffer, u32 length) |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 339 | { |
| 340 | u8 sum = 0; |
| 341 | u8 *end = buffer + length; |
| 342 | |
| 343 | while (buffer < end) { |
| 344 | sum = (u8) (sum + *(buffer++)); |
| 345 | } |
| 346 | |
| 347 | return sum; |
| 348 | } |
| 349 | |
| 350 | /******************************************************************************* |
| 351 | * |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 352 | * FUNCTION: acpi_tb_install_table |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 353 | * |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 354 | * PARAMETERS: Address - Physical address of DSDT or FACS |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 355 | * Signature - Table signature, NULL if no need to |
| 356 | * match |
| 357 | * table_index - Index into root table array |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 358 | * |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 359 | * RETURN: None |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 360 | * |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 361 | * DESCRIPTION: Install an ACPI table into the global data structure. The |
| 362 | * table override mechanism is implemented here to allow the host |
| 363 | * OS to replace any table before it is installed in the root |
| 364 | * table array. |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 365 | * |
| 366 | ******************************************************************************/ |
| 367 | |
Bob Moore | 765ec20 | 2007-02-02 19:48:20 +0300 | [diff] [blame] | 368 | void |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 369 | acpi_tb_install_table(acpi_physical_address address, |
Bob Moore | 97cbb7d | 2009-02-03 14:41:03 +0800 | [diff] [blame] | 370 | char *signature, u32 table_index) |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 371 | { |
Bob Moore | 97cbb7d | 2009-02-03 14:41:03 +0800 | [diff] [blame] | 372 | u8 flags; |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 373 | acpi_status status; |
| 374 | struct acpi_table_header *table_to_install; |
| 375 | struct acpi_table_header *mapped_table; |
| 376 | struct acpi_table_header *override_table = NULL; |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 377 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 378 | if (!address) { |
| 379 | ACPI_ERROR((AE_INFO, |
| 380 | "Null physical address for ACPI table [%s]", |
| 381 | signature)); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 382 | return; |
| 383 | } |
| 384 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 385 | /* Map just the table header */ |
| 386 | |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 387 | mapped_table = |
| 388 | acpi_os_map_memory(address, sizeof(struct acpi_table_header)); |
| 389 | if (!mapped_table) { |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 390 | return; |
| 391 | } |
| 392 | |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 393 | /* If a particular signature is expected (DSDT/FACS), it must match */ |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 394 | |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 395 | if (signature && !ACPI_COMPARE_NAME(mapped_table->signature, signature)) { |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 396 | ACPI_ERROR((AE_INFO, |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 397 | "Invalid signature 0x%X for ACPI table, expected [%s]", |
| 398 | *ACPI_CAST_PTR(u32, mapped_table->signature), |
| 399 | signature)); |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 400 | goto unmap_and_exit; |
| 401 | } |
| 402 | |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 403 | /* |
| 404 | * ACPI Table Override: |
| 405 | * |
| 406 | * Before we install the table, let the host OS override it with a new |
| 407 | * one if desired. Any table within the RSDT/XSDT can be replaced, |
| 408 | * including the DSDT which is pointed to by the FADT. |
| 409 | */ |
| 410 | status = acpi_os_table_override(mapped_table, &override_table); |
| 411 | if (ACPI_SUCCESS(status) && override_table) { |
| 412 | ACPI_INFO((AE_INFO, |
| 413 | "%4.4s @ 0x%p Table override, replaced with:", |
| 414 | mapped_table->signature, ACPI_CAST_PTR(void, |
| 415 | address))); |
| 416 | |
| 417 | acpi_gbl_root_table_list.tables[table_index].pointer = |
| 418 | override_table; |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 419 | address = ACPI_PTR_TO_PHYSADDR(override_table); |
| 420 | |
| 421 | table_to_install = override_table; |
Bob Moore | 97cbb7d | 2009-02-03 14:41:03 +0800 | [diff] [blame] | 422 | flags = ACPI_TABLE_ORIGIN_OVERRIDE; |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 423 | } else { |
| 424 | table_to_install = mapped_table; |
Bob Moore | 97cbb7d | 2009-02-03 14:41:03 +0800 | [diff] [blame] | 425 | flags = ACPI_TABLE_ORIGIN_MAPPED; |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 426 | } |
| 427 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 428 | /* Initialize the table entry */ |
| 429 | |
| 430 | acpi_gbl_root_table_list.tables[table_index].address = address; |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 431 | acpi_gbl_root_table_list.tables[table_index].length = |
| 432 | table_to_install->length; |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 433 | acpi_gbl_root_table_list.tables[table_index].flags = flags; |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 434 | |
| 435 | ACPI_MOVE_32_TO_32(& |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 436 | (acpi_gbl_root_table_list.tables[table_index]. |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 437 | signature), table_to_install->signature); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 438 | |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 439 | acpi_tb_print_table_header(address, table_to_install); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 440 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 441 | if (table_index == ACPI_TABLE_INDEX_DSDT) { |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 442 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 443 | /* Global integer width is based upon revision of the DSDT */ |
| 444 | |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 445 | acpi_ut_set_integer_width(table_to_install->revision); |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 446 | } |
| 447 | |
| 448 | unmap_and_exit: |
Bob Moore | ac5f98d | 2009-02-03 14:35:25 +0800 | [diff] [blame] | 449 | acpi_os_unmap_memory(mapped_table, sizeof(struct acpi_table_header)); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 450 | } |
| 451 | |
| 452 | /******************************************************************************* |
| 453 | * |
Bob Moore | a4bbb810 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 454 | * FUNCTION: acpi_tb_get_root_table_entry |
| 455 | * |
| 456 | * PARAMETERS: table_entry - Pointer to the RSDT/XSDT table entry |
| 457 | * table_entry_size - sizeof 32 or 64 (RSDT or XSDT) |
| 458 | * |
| 459 | * RETURN: Physical address extracted from the root table |
| 460 | * |
| 461 | * DESCRIPTION: Get one root table entry. Handles 32-bit and 64-bit cases on |
| 462 | * both 32-bit and 64-bit platforms |
| 463 | * |
| 464 | * NOTE: acpi_physical_address is 32-bit on 32-bit platforms, 64-bit on |
| 465 | * 64-bit platforms. |
| 466 | * |
| 467 | ******************************************************************************/ |
| 468 | |
| 469 | static acpi_physical_address |
Bob Moore | 67a119f | 2008-06-10 13:42:13 +0800 | [diff] [blame] | 470 | acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) |
Bob Moore | a4bbb810 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 471 | { |
| 472 | u64 address64; |
| 473 | |
| 474 | /* |
| 475 | * Get the table physical address (32-bit for RSDT, 64-bit for XSDT): |
| 476 | * Note: Addresses are 32-bit aligned (not 64) in both RSDT and XSDT |
| 477 | */ |
| 478 | if (table_entry_size == sizeof(u32)) { |
| 479 | /* |
| 480 | * 32-bit platform, RSDT: Return 32-bit table entry |
| 481 | * 64-bit platform, RSDT: Expand 32-bit to 64-bit and return |
| 482 | */ |
| 483 | return ((acpi_physical_address) |
| 484 | (*ACPI_CAST_PTR(u32, table_entry))); |
| 485 | } else { |
| 486 | /* |
| 487 | * 32-bit platform, XSDT: Truncate 64-bit to 32-bit and return |
Bob Moore | ec41f19 | 2009-02-18 15:03:30 +0800 | [diff] [blame] | 488 | * 64-bit platform, XSDT: Move (unaligned) 64-bit to local, |
| 489 | * return 64-bit |
Bob Moore | a4bbb810 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 490 | */ |
| 491 | ACPI_MOVE_64_TO_64(&address64, table_entry); |
| 492 | |
| 493 | #if ACPI_MACHINE_WIDTH == 32 |
| 494 | if (address64 > ACPI_UINT32_MAX) { |
| 495 | |
Bob Moore | ea5d8eb | 2007-02-02 19:48:20 +0300 | [diff] [blame] | 496 | /* Will truncate 64-bit address to 32 bits, issue warning */ |
Bob Moore | a4bbb810 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 497 | |
| 498 | ACPI_WARNING((AE_INFO, |
Bob Moore | f6a22b0 | 2010-03-05 17:56:40 +0800 | [diff] [blame] | 499 | "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," |
Bob Moore | ec41f19 | 2009-02-18 15:03:30 +0800 | [diff] [blame] | 500 | " truncating", |
Bob Moore | a4bbb810 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 501 | ACPI_FORMAT_UINT64(address64))); |
| 502 | } |
| 503 | #endif |
| 504 | return ((acpi_physical_address) (address64)); |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | /******************************************************************************* |
| 509 | * |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 510 | * FUNCTION: acpi_tb_parse_root_table |
| 511 | * |
| 512 | * PARAMETERS: Rsdp - Pointer to the RSDP |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 513 | * |
| 514 | * RETURN: Status |
| 515 | * |
| 516 | * DESCRIPTION: This function is called to parse the Root System Description |
| 517 | * Table (RSDT or XSDT) |
| 518 | * |
| 519 | * NOTE: Tables are mapped (not copied) for efficiency. The FACS must |
| 520 | * be mapped and cannot be copied because it contains the actual |
| 521 | * memory location of the ACPI Global Lock. |
| 522 | * |
| 523 | ******************************************************************************/ |
| 524 | |
Alexey Starikovskiy | ad71860a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 525 | acpi_status __init |
Bob Moore | 97cbb7d | 2009-02-03 14:41:03 +0800 | [diff] [blame] | 526 | acpi_tb_parse_root_table(acpi_physical_address rsdp_address) |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 527 | { |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 528 | struct acpi_table_rsdp *rsdp; |
Bob Moore | 67a119f | 2008-06-10 13:42:13 +0800 | [diff] [blame] | 529 | u32 table_entry_size; |
| 530 | u32 i; |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 531 | u32 table_count; |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 532 | struct acpi_table_header *table; |
| 533 | acpi_physical_address address; |
Andrew Morton | 8ab7367 | 2007-10-02 13:24:10 -0700 | [diff] [blame] | 534 | acpi_physical_address uninitialized_var(rsdt_address); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 535 | u32 length; |
| 536 | u8 *table_entry; |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 537 | acpi_status status; |
| 538 | |
| 539 | ACPI_FUNCTION_TRACE(tb_parse_root_table); |
| 540 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 541 | /* |
| 542 | * Map the entire RSDP and extract the address of the RSDT or XSDT |
| 543 | */ |
| 544 | rsdp = acpi_os_map_memory(rsdp_address, sizeof(struct acpi_table_rsdp)); |
| 545 | if (!rsdp) { |
| 546 | return_ACPI_STATUS(AE_NO_MEMORY); |
| 547 | } |
| 548 | |
| 549 | acpi_tb_print_table_header(rsdp_address, |
| 550 | ACPI_CAST_PTR(struct acpi_table_header, |
| 551 | rsdp)); |
| 552 | |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 553 | /* Differentiate between RSDT and XSDT root tables */ |
| 554 | |
Zhao Yakui | 237889b | 2008-12-17 16:55:18 +0800 | [diff] [blame] | 555 | if (rsdp->revision > 1 && rsdp->xsdt_physical_address |
| 556 | && !acpi_rsdt_forced) { |
Bob Moore | a18ecf4 | 2005-08-15 03:42:00 -0800 | [diff] [blame] | 557 | /* |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 558 | * Root table is an XSDT (64-bit physical addresses). We must use the |
| 559 | * XSDT if the revision is > 1 and the XSDT pointer is present, as per |
| 560 | * the ACPI specification. |
Bob Moore | a18ecf4 | 2005-08-15 03:42:00 -0800 | [diff] [blame] | 561 | */ |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 562 | address = (acpi_physical_address) rsdp->xsdt_physical_address; |
| 563 | table_entry_size = sizeof(u64); |
Zhao Yakui | 9f3119b | 2007-08-24 16:18:16 +0800 | [diff] [blame] | 564 | rsdt_address = (acpi_physical_address) |
| 565 | rsdp->rsdt_physical_address; |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 566 | } else { |
| 567 | /* Root table is an RSDT (32-bit physical addresses) */ |
Bob Moore | 52fc0b0 | 2006-10-02 00:00:00 -0400 | [diff] [blame] | 568 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 569 | address = (acpi_physical_address) rsdp->rsdt_physical_address; |
| 570 | table_entry_size = sizeof(u32); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 571 | } |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 572 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 573 | /* |
| 574 | * It is not possible to map more than one entry in some environments, |
| 575 | * so unmap the RSDP here before mapping other tables |
| 576 | */ |
| 577 | acpi_os_unmap_memory(rsdp, sizeof(struct acpi_table_rsdp)); |
| 578 | |
Zhao Yakui | 9f3119b | 2007-08-24 16:18:16 +0800 | [diff] [blame] | 579 | if (table_entry_size == sizeof(u64)) { |
| 580 | if (acpi_tb_check_xsdt(address) == AE_NULL_ENTRY) { |
| 581 | /* XSDT has NULL entry, RSDT is used */ |
| 582 | address = rsdt_address; |
| 583 | table_entry_size = sizeof(u32); |
Joe Perches | 4fdb2a0 | 2007-11-19 17:48:02 -0800 | [diff] [blame] | 584 | ACPI_WARNING((AE_INFO, "BIOS XSDT has NULL entry, " |
Zhao Yakui | 9f3119b | 2007-08-24 16:18:16 +0800 | [diff] [blame] | 585 | "using RSDT")); |
| 586 | } |
| 587 | } |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 588 | /* Map the RSDT/XSDT table header to get the full table length */ |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 589 | |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 590 | table = acpi_os_map_memory(address, sizeof(struct acpi_table_header)); |
| 591 | if (!table) { |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 592 | return_ACPI_STATUS(AE_NO_MEMORY); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 593 | } |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 594 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 595 | acpi_tb_print_table_header(address, table); |
| 596 | |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 597 | /* Get the length of the full table, verify length and map entire table */ |
| 598 | |
| 599 | length = table->length; |
| 600 | acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); |
| 601 | |
| 602 | if (length < sizeof(struct acpi_table_header)) { |
| 603 | ACPI_ERROR((AE_INFO, "Invalid length 0x%X in RSDT/XSDT", |
| 604 | length)); |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 605 | return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 606 | } |
| 607 | |
| 608 | table = acpi_os_map_memory(address, length); |
| 609 | if (!table) { |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 610 | return_ACPI_STATUS(AE_NO_MEMORY); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 611 | } |
| 612 | |
| 613 | /* Validate the root table checksum */ |
| 614 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 615 | status = acpi_tb_verify_checksum(table, length); |
| 616 | if (ACPI_FAILURE(status)) { |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 617 | acpi_os_unmap_memory(table, length); |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 618 | return_ACPI_STATUS(status); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 619 | } |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 620 | |
| 621 | /* Calculate the number of tables described in the root table */ |
| 622 | |
Bob Moore | ec41f19 | 2009-02-18 15:03:30 +0800 | [diff] [blame] | 623 | table_count = (u32)((table->length - sizeof(struct acpi_table_header)) / |
| 624 | table_entry_size); |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 625 | /* |
Bob Moore | ec41f19 | 2009-02-18 15:03:30 +0800 | [diff] [blame] | 626 | * First two entries in the table array are reserved for the DSDT |
| 627 | * and FACS, which are not actually present in the RSDT/XSDT - they |
| 628 | * come from the FADT |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 629 | */ |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 630 | table_entry = |
| 631 | ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header); |
| 632 | acpi_gbl_root_table_list.count = 2; |
| 633 | |
| 634 | /* |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 635 | * Initialize the root table array from the RSDT/XSDT |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 636 | */ |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 637 | for (i = 0; i < table_count; i++) { |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 638 | if (acpi_gbl_root_table_list.count >= |
| 639 | acpi_gbl_root_table_list.size) { |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 640 | |
| 641 | /* There is no more room in the root table array, attempt resize */ |
| 642 | |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 643 | status = acpi_tb_resize_root_table_list(); |
| 644 | if (ACPI_FAILURE(status)) { |
| 645 | ACPI_WARNING((AE_INFO, |
| 646 | "Truncating %u table entries!", |
Myron Stowe | 386e4a8 | 2009-01-30 15:44:53 -0700 | [diff] [blame] | 647 | (unsigned) (table_count - |
| 648 | (acpi_gbl_root_table_list. |
| 649 | count - 2)))); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 650 | break; |
| 651 | } |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 652 | } |
| 653 | |
Bob Moore | a4bbb810 | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 654 | /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */ |
| 655 | |
| 656 | acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list.count]. |
| 657 | address = |
| 658 | acpi_tb_get_root_table_entry(table_entry, table_entry_size); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 659 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 660 | table_entry += table_entry_size; |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 661 | acpi_gbl_root_table_list.count++; |
| 662 | } |
| 663 | |
| 664 | /* |
| 665 | * It is not possible to map more than one entry in some environments, |
| 666 | * so unmap the root table here before mapping other tables |
| 667 | */ |
| 668 | acpi_os_unmap_memory(table, length); |
| 669 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 670 | /* |
| 671 | * Complete the initialization of the root table array by examining |
| 672 | * the header of each table |
| 673 | */ |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 674 | for (i = 2; i < acpi_gbl_root_table_list.count; i++) { |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 675 | acpi_tb_install_table(acpi_gbl_root_table_list.tables[i]. |
Bob Moore | 97cbb7d | 2009-02-03 14:41:03 +0800 | [diff] [blame] | 676 | address, NULL, i); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 677 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 678 | /* Special case for FADT - get the DSDT and FACS */ |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 679 | |
Bob Moore | c5fc42a | 2007-02-02 19:48:19 +0300 | [diff] [blame] | 680 | if (ACPI_COMPARE_NAME |
| 681 | (&acpi_gbl_root_table_list.tables[i].signature, |
| 682 | ACPI_SIG_FADT)) { |
Bob Moore | 97cbb7d | 2009-02-03 14:41:03 +0800 | [diff] [blame] | 683 | acpi_tb_parse_fadt(i); |
Bob Moore | f3d2e78 | 2007-02-02 19:48:18 +0300 | [diff] [blame] | 684 | } |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 685 | } |
| 686 | |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 687 | return_ACPI_STATUS(AE_OK); |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 688 | } |