From 7f4ac9f91383a0707de559dc8fbca986fc2d302f Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Thu, 10 Apr 2008 19:06:39 +0400 Subject: ACPICA: Fix for Load/LoadTable to specify load location Fixed a problem with the Load and LoadTable operators where the table location within the namespace was ignored. Instead, the table was always loaded into the root or current scope. Signed-off-by: Bob Moore Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown --- drivers/acpi/namespace/nsparse.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'drivers/acpi/namespace/nsparse.c') diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c index e696aa84799..86bd6e5920c 100644 --- a/drivers/acpi/namespace/nsparse.c +++ b/drivers/acpi/namespace/nsparse.c @@ -64,7 +64,8 @@ ACPI_MODULE_NAME("nsparse") ******************************************************************************/ acpi_status acpi_ns_one_complete_parse(acpi_native_uint pass_number, - acpi_native_uint table_index) + acpi_native_uint table_index, + struct acpi_namespace_node * start_node) { union acpi_parse_object *parse_root; acpi_status status; @@ -121,6 +122,13 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number, return_ACPI_STATUS(status); } + /* start_node is the default location to load the table */ + + if (start_node && start_node != acpi_gbl_root_node) { + acpi_ds_scope_stack_push(start_node, ACPI_TYPE_METHOD, + walk_state); + } + /* Parse the AML */ ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "*PARSE* pass %d parse\n", @@ -163,7 +171,9 @@ acpi_ns_parse_table(acpi_native_uint table_index, * performs another complete parse of the AML. */ ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n")); - status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, table_index); + status = + acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, table_index, + start_node); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } @@ -178,7 +188,9 @@ acpi_ns_parse_table(acpi_native_uint table_index, * parse objects are all cached. */ ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n")); - status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, table_index); + status = + acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, table_index, + start_node); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } -- cgit v1.2.3 From 1d18c05825c3f2b8933a7fc7f7528881e98deb04 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Thu, 10 Apr 2008 19:06:40 +0400 Subject: ACPICA: Cosmetic changes only, no functional changes Lint changes, fix compiler warnings, etc. Signed-off-by: Bob Moore Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown --- drivers/acpi/namespace/nsparse.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'drivers/acpi/namespace/nsparse.c') diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c index 86bd6e5920c..f260b6941c1 100644 --- a/drivers/acpi/namespace/nsparse.c +++ b/drivers/acpi/namespace/nsparse.c @@ -112,21 +112,25 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number, aml_start = (u8 *) table + sizeof(struct acpi_table_header); aml_length = table->length - sizeof(struct acpi_table_header); status = acpi_ds_init_aml_walk(walk_state, parse_root, NULL, - aml_start, aml_length, NULL, - (u8) pass_number); + aml_start, (u32) aml_length, + NULL, (u8) pass_number); } if (ACPI_FAILURE(status)) { acpi_ds_delete_walk_state(walk_state); - acpi_ps_delete_parse_tree(parse_root); - return_ACPI_STATUS(status); + goto cleanup; } /* start_node is the default location to load the table */ if (start_node && start_node != acpi_gbl_root_node) { - acpi_ds_scope_stack_push(start_node, ACPI_TYPE_METHOD, - walk_state); + status = + acpi_ds_scope_stack_push(start_node, ACPI_TYPE_METHOD, + walk_state); + if (ACPI_FAILURE(status)) { + acpi_ds_delete_walk_state(walk_state); + goto cleanup; + } } /* Parse the AML */ @@ -135,6 +139,7 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number, (unsigned)pass_number)); status = acpi_ps_parse_aml(walk_state); + cleanup: acpi_ps_delete_parse_tree(parse_root); return_ACPI_STATUS(status); } -- cgit v1.2.3 From 75a44ce00b312f57264f42a0a985d17cd9994b98 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Wed, 23 Apr 2008 23:00:13 -0400 Subject: ACPICA: update Intel copyright Signed-off-by: Len Brown --- drivers/acpi/namespace/nsparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/acpi/namespace/nsparse.c') diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c index f260b6941c1..46a79b0103b 100644 --- a/drivers/acpi/namespace/nsparse.c +++ b/drivers/acpi/namespace/nsparse.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2007, R. Byron Moore + * Copyright (C) 2000 - 2008, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without -- cgit v1.2.3