aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/tbinstal.c
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-04-04 00:39:18 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-04-20 16:59:39 -0400
commitcaf4a15c5f930aae41951b4916289e3e59dda8eb (patch)
treee7906f367abc62597b0075af93306571d362598c /drivers/acpi/acpica/tbinstal.c
parenta94e88cdd8057fe8ea84bbb6d9a89a823c7bc49b (diff)
ACPICA: Tables: Add acpi_install_table() API for early table installation.
This patch adds a new API - acpi_install_table(). OSPMs can use this API to install tables during early boot stage. Lv Zheng. References: https://lkml.org/lkml/2014/2/28/372 Cc: Thomas Renninger <trenn@suse.de> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> [rjw: Subject] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/tbinstal.c')
-rw-r--r--drivers/acpi/acpica/tbinstal.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index de10d3245d9c..9835213269e6 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -394,6 +394,7 @@ static void acpi_tb_release_temporal_table(struct acpi_table_desc *table_desc)
394 * 394 *
395 * PARAMETERS: table_index - Index into root table array 395 * PARAMETERS: table_index - Index into root table array
396 * new_table_desc - New table descriptor to install 396 * new_table_desc - New table descriptor to install
397 * override - Whether override should be performed
397 * 398 *
398 * RETURN: None 399 * RETURN: None
399 * 400 *
@@ -406,7 +407,8 @@ static void acpi_tb_release_temporal_table(struct acpi_table_desc *table_desc)
406 407
407void 408void
408acpi_tb_install_and_override_table(u32 table_index, 409acpi_tb_install_and_override_table(u32 table_index,
409 struct acpi_table_desc *new_table_desc) 410 struct acpi_table_desc *new_table_desc,
411 u8 override)
410{ 412{
411 if (table_index >= acpi_gbl_root_table_list.current_table_count) { 413 if (table_index >= acpi_gbl_root_table_list.current_table_count) {
412 return; 414 return;
@@ -419,7 +421,9 @@ acpi_tb_install_and_override_table(u32 table_index,
419 * one if desired. Any table within the RSDT/XSDT can be replaced, 421 * one if desired. Any table within the RSDT/XSDT can be replaced,
420 * including the DSDT which is pointed to by the FADT. 422 * including the DSDT which is pointed to by the FADT.
421 */ 423 */
422 acpi_tb_override_table(new_table_desc); 424 if (override) {
425 acpi_tb_override_table(new_table_desc);
426 }
423 427
424 acpi_tb_install_table(&acpi_gbl_root_table_list.tables[table_index], 428 acpi_tb_install_table(&acpi_gbl_root_table_list.tables[table_index],
425 new_table_desc->address, new_table_desc->flags, 429 new_table_desc->address, new_table_desc->flags,
@@ -484,7 +488,7 @@ acpi_tb_install_fixed_table(acpi_physical_address address,
484 goto release_and_exit; 488 goto release_and_exit;
485 } 489 }
486 490
487 acpi_tb_install_and_override_table(table_index, &new_table_desc); 491 acpi_tb_install_and_override_table(table_index, &new_table_desc, TRUE);
488 492
489release_and_exit: 493release_and_exit:
490 494
@@ -547,6 +551,7 @@ acpi_tb_is_equivalent_table(struct acpi_table_desc *table_desc, u32 table_index)
547 * address depending on the table_flags) 551 * address depending on the table_flags)
548 * flags - Flags for the table 552 * flags - Flags for the table
549 * reload - Whether reload should be performed 553 * reload - Whether reload should be performed
554 * override - Whether override should be performed
550 * table_index - Where the table index is returned 555 * table_index - Where the table index is returned
551 * 556 *
552 * RETURN: Status 557 * RETURN: Status
@@ -562,7 +567,8 @@ acpi_tb_is_equivalent_table(struct acpi_table_desc *table_desc, u32 table_index)
562 567
563acpi_status 568acpi_status
564acpi_tb_install_non_fixed_table(acpi_physical_address address, 569acpi_tb_install_non_fixed_table(acpi_physical_address address,
565 u8 flags, u8 reload, u32 *table_index) 570 u8 flags,
571 u8 reload, u8 override, u32 *table_index)
566{ 572{
567 u32 i; 573 u32 i;
568 acpi_status status = AE_OK; 574 acpi_status status = AE_OK;
@@ -687,7 +693,7 @@ acpi_tb_install_non_fixed_table(acpi_physical_address address,
687 goto release_and_exit; 693 goto release_and_exit;
688 } 694 }
689 *table_index = i; 695 *table_index = i;
690 acpi_tb_install_and_override_table(i, &new_table_desc); 696 acpi_tb_install_and_override_table(i, &new_table_desc, override);
691 697
692release_and_exit: 698release_and_exit:
693 699