diff options
author | Lv Zheng <lv.zheng@intel.com> | 2015-04-13 06:49:30 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-04-14 15:51:52 +0300 |
commit | 76cffa79bd7f139a8f16d4e7969bf7891fe6f901 (patch) | |
tree | b58b06452d7551de4e6783db728452959d40b0d3 /drivers/acpi/acpica/tbdata.c | |
parent | 9bd4ce36dcbc8e3b2218e84cdfd1dff6d5671f3c (diff) | |
download | linux-76cffa79bd7f139a8f16d4e7969bf7891fe6f901.tar.xz |
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/acpi/acpica/tbdata.c')
-rw-r--r-- | drivers/acpi/acpica/tbdata.c | 20 |
1 files changed, 16 insertions, 4 deletions
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) /******************************************************************************* * - * FUNCTION: acpi_tb_get_next_root_index + * FUNCTION: acpi_tb_get_next_table_descriptor * * PARAMETERS: table_index - Where table index is returned + * table_desc - Where table descriptor is returned * - * RETURN: Status and table index. + * RETURN: Status and table index/descriptor. * * DESCRIPTION: Allocate a new ACPI table entry to the global table list * ******************************************************************************/ -acpi_status acpi_tb_get_next_root_index(u32 *table_index) +acpi_status +acpi_tb_get_next_table_descriptor(u32 *table_index, + struct acpi_table_desc **table_desc) { acpi_status status; + u32 i; /* Ensure that there is room for the table in the Root Table List */ @@ -508,8 +512,16 @@ acpi_status acpi_tb_get_next_root_index(u32 *table_index) } } - *table_index = acpi_gbl_root_table_list.current_table_count; + i = acpi_gbl_root_table_list.current_table_count; acpi_gbl_root_table_list.current_table_count++; + + if (table_index) { + *table_index = i; + } + if (table_desc) { + *table_desc = &acpi_gbl_root_table_list.tables[i]; + } + return (AE_OK); } |