diff options
Diffstat (limited to 'drivers/acpi')
| -rw-r--r-- | drivers/acpi/acpica/actables.h | 9 | ||||
| -rw-r--r-- | drivers/acpi/acpica/tbdata.c | 20 | ||||
| -rw-r--r-- | drivers/acpi/acpica/tbinstal.c | 39 |
3 files changed, 20 insertions, 48 deletions
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h index 1c127a43017b..7e0b6f1bec9c 100644 --- a/drivers/acpi/acpica/actables.h +++ b/drivers/acpi/acpica/actables.h | |||
| @@ -58,7 +58,9 @@ u8 *acpi_tb_scan_memory_for_rsdp(u8 *start_address, u32 length); | |||
| 58 | /* | 58 | /* |
| 59 | * tbdata - table data structure management | 59 | * tbdata - table data structure management |
| 60 | */ | 60 | */ |
| 61 | acpi_status acpi_tb_get_next_root_index(u32 *table_index); | 61 | acpi_status |
| 62 | acpi_tb_get_next_table_descriptor(u32 *table_index, | ||
| 63 | struct acpi_table_desc **table_desc); | ||
| 62 | 64 | ||
| 63 | void | 65 | void |
| 64 | acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc, | 66 | acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc, |
| @@ -119,11 +121,6 @@ acpi_tb_install_standard_table(acpi_physical_address address, | |||
| 119 | u8 flags, | 121 | u8 flags, |
| 120 | u8 reload, u8 override, u32 *table_index); | 122 | u8 reload, u8 override, u32 *table_index); |
| 121 | 123 | ||
| 122 | acpi_status | ||
| 123 | acpi_tb_store_table(acpi_physical_address address, | ||
| 124 | struct acpi_table_header *table, | ||
| 125 | u32 length, u8 flags, u32 *table_index); | ||
| 126 | |||
| 127 | void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc); | 124 | void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc); |
| 128 | 125 | ||
| 129 | void acpi_tb_terminate(void); | 126 | void acpi_tb_terminate(void); |
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c index fd5998b2b46b..d7f8386455bd 100644 --- a/drivers/acpi/acpica/tbdata.c +++ b/drivers/acpi/acpica/tbdata.c | |||
| @@ -484,19 +484,23 @@ acpi_status acpi_tb_resize_root_table_list(void) | |||
| 484 | 484 | ||
| 485 | /******************************************************************************* | 485 | /******************************************************************************* |
| 486 | * | 486 | * |
| 487 | * FUNCTION: acpi_tb_get_next_root_index | 487 | * FUNCTION: acpi_tb_get_next_table_descriptor |
| 488 | * | 488 | * |
| 489 | * PARAMETERS: table_index - Where table index is returned | 489 | * PARAMETERS: table_index - Where table index is returned |
| 490 | * table_desc - Where table descriptor is returned | ||
| 490 | * | 491 | * |
| 491 | * RETURN: Status and table index. | 492 | * RETURN: Status and table index/descriptor. |
| 492 | * | 493 | * |
| 493 | * DESCRIPTION: Allocate a new ACPI table entry to the global table list | 494 | * DESCRIPTION: Allocate a new ACPI table entry to the global table list |
| 494 | * | 495 | * |
| 495 | ******************************************************************************/ | 496 | ******************************************************************************/ |
| 496 | 497 | ||
| 497 | acpi_status acpi_tb_get_next_root_index(u32 *table_index) | 498 | acpi_status |
| 499 | acpi_tb_get_next_table_descriptor(u32 *table_index, | ||
| 500 | struct acpi_table_desc **table_desc) | ||
| 498 | { | 501 | { |
| 499 | acpi_status status; | 502 | acpi_status status; |
| 503 | u32 i; | ||
| 500 | 504 | ||
| 501 | /* Ensure that there is room for the table in the Root Table List */ | 505 | /* Ensure that there is room for the table in the Root Table List */ |
| 502 | 506 | ||
| @@ -508,8 +512,16 @@ acpi_status acpi_tb_get_next_root_index(u32 *table_index) | |||
| 508 | } | 512 | } |
| 509 | } | 513 | } |
| 510 | 514 | ||
| 511 | *table_index = acpi_gbl_root_table_list.current_table_count; | 515 | i = acpi_gbl_root_table_list.current_table_count; |
| 512 | acpi_gbl_root_table_list.current_table_count++; | 516 | acpi_gbl_root_table_list.current_table_count++; |
| 517 | |||
| 518 | if (table_index) { | ||
| 519 | *table_index = i; | ||
| 520 | } | ||
| 521 | if (table_desc) { | ||
| 522 | *table_desc = &acpi_gbl_root_table_list.tables[i]; | ||
| 523 | } | ||
| 524 | |||
| 513 | return (AE_OK); | 525 | return (AE_OK); |
| 514 | } | 526 | } |
| 515 | 527 | ||
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index 7e69bc73bd16..008a251780f4 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c | |||
| @@ -356,7 +356,7 @@ acpi_tb_install_standard_table(acpi_physical_address address, | |||
| 356 | 356 | ||
| 357 | /* Add the table to the global root table list */ | 357 | /* Add the table to the global root table list */ |
| 358 | 358 | ||
| 359 | status = acpi_tb_get_next_root_index(&i); | 359 | status = acpi_tb_get_next_table_descriptor(&i, NULL); |
| 360 | if (ACPI_FAILURE(status)) { | 360 | if (ACPI_FAILURE(status)) { |
| 361 | goto release_and_exit; | 361 | goto release_and_exit; |
| 362 | } | 362 | } |
| @@ -457,43 +457,6 @@ finish_override: | |||
| 457 | 457 | ||
| 458 | /******************************************************************************* | 458 | /******************************************************************************* |
| 459 | * | 459 | * |
| 460 | * FUNCTION: acpi_tb_store_table | ||
| 461 | * | ||
| 462 | * PARAMETERS: address - Table address | ||
| 463 | * table - Table header | ||
| 464 | * length - Table length | ||
| 465 | * flags - Install flags | ||
| 466 | * table_index - Where the table index is returned | ||
| 467 | * | ||
| 468 | * RETURN: Status and table index. | ||
| 469 | * | ||
| 470 | * DESCRIPTION: Add an ACPI table to the global table list | ||
| 471 | * | ||
| 472 | ******************************************************************************/ | ||
| 473 | |||
| 474 | acpi_status | ||
| 475 | acpi_tb_store_table(acpi_physical_address address, | ||
| 476 | struct acpi_table_header * table, | ||
| 477 | u32 length, u8 flags, u32 *table_index) | ||
| 478 | { | ||
| 479 | acpi_status status; | ||
| 480 | struct acpi_table_desc *table_desc; | ||
| 481 | |||
| 482 | status = acpi_tb_get_next_root_index(table_index); | ||
| 483 | if (ACPI_FAILURE(status)) { | ||
| 484 | return (status); | ||
| 485 | } | ||
| 486 | |||
| 487 | /* Initialize added table */ | ||
| 488 | |||
| 489 | table_desc = &acpi_gbl_root_table_list.tables[*table_index]; | ||
| 490 | acpi_tb_init_table_descriptor(table_desc, address, flags, table); | ||
| 491 | table_desc->pointer = table; | ||
| 492 | return (AE_OK); | ||
| 493 | } | ||
| 494 | |||
| 495 | /******************************************************************************* | ||
| 496 | * | ||
| 497 | * FUNCTION: acpi_tb_uninstall_table | 460 | * FUNCTION: acpi_tb_uninstall_table |
| 498 | * | 461 | * |
| 499 | * PARAMETERS: table_desc - Table descriptor | 462 | * PARAMETERS: table_desc - Table descriptor |
