aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2015-04-12 23:49:30 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-04-14 08:51:52 -0400
commit76cffa79bd7f139a8f16d4e7969bf7891fe6f901 (patch)
treeb58b06452d7551de4e6783db728452959d40b0d3 /drivers
parent9bd4ce36dcbc8e3b2218e84cdfd1dff6d5671f3c (diff)
ACPICA: Tables: Move an iasl specific table function to iasl source file.
ACPICA commit 6eb364d790dd103bd4990f808e0095a421c437cb acpi_tb_store_table() implements a logic that is only correct to iasl. So it won't be used by any other utilities except iasl. This function is complained by the kernel users as an unused function. The best choice to stop releasing it to the Linux kernel should be moving it to adisasm.c. ACPI table manager can use both struct acpi_table_desc (direct referencing) and table index (indirect referencing) as the descriptor to the table, so acpi_tb_get_next_root_index() is extended to return both of them to allow maximum usability from the callers. NOTE that indirect referencing is a design result to meet the boot stage static allocation requirement for the table descriptors. This is a linuxized acpi_tb_store_table() removing result, there should be no functional changes introduced to the Linux kernel by this patch except the additonal kernel unused argument for acpi_tb_get_next_root_index() (renamed to acpi_tb_get_next_root_index()). This argument is used in the ACPICA upstream. Link: https://github.com/acpica/acpica/commit/6eb364d7 Reported-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/acpica/actables.h9
-rw-r--r--drivers/acpi/acpica/tbdata.c20
-rw-r--r--drivers/acpi/acpica/tbinstal.c39
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 */
61acpi_status acpi_tb_get_next_root_index(u32 *table_index); 61acpi_status
62acpi_tb_get_next_table_descriptor(u32 *table_index,
63 struct acpi_table_desc **table_desc);
62 64
63void 65void
64acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc, 66acpi_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
122acpi_status
123acpi_tb_store_table(acpi_physical_address address,
124 struct acpi_table_header *table,
125 u32 length, u8 flags, u32 *table_index);
126
127void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc); 124void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc);
128 125
129void acpi_tb_terminate(void); 126void 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
497acpi_status acpi_tb_get_next_root_index(u32 *table_index) 498acpi_status
499acpi_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
474acpi_status
475acpi_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