diff options
Diffstat (limited to 'drivers/acpi/namespace/nsparse.c')
-rw-r--r-- | drivers/acpi/namespace/nsparse.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c index e696aa847990..46a79b0103b6 100644 --- a/drivers/acpi/namespace/nsparse.c +++ b/drivers/acpi/namespace/nsparse.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2007, R. Byron Moore | 8 | * Copyright (C) 2000 - 2008, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -64,7 +64,8 @@ ACPI_MODULE_NAME("nsparse") | |||
64 | ******************************************************************************/ | 64 | ******************************************************************************/ |
65 | acpi_status | 65 | acpi_status |
66 | acpi_ns_one_complete_parse(acpi_native_uint pass_number, | 66 | acpi_ns_one_complete_parse(acpi_native_uint pass_number, |
67 | acpi_native_uint table_index) | 67 | acpi_native_uint table_index, |
68 | struct acpi_namespace_node * start_node) | ||
68 | { | 69 | { |
69 | union acpi_parse_object *parse_root; | 70 | union acpi_parse_object *parse_root; |
70 | acpi_status status; | 71 | acpi_status status; |
@@ -111,14 +112,25 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number, | |||
111 | aml_start = (u8 *) table + sizeof(struct acpi_table_header); | 112 | aml_start = (u8 *) table + sizeof(struct acpi_table_header); |
112 | aml_length = table->length - sizeof(struct acpi_table_header); | 113 | aml_length = table->length - sizeof(struct acpi_table_header); |
113 | status = acpi_ds_init_aml_walk(walk_state, parse_root, NULL, | 114 | status = acpi_ds_init_aml_walk(walk_state, parse_root, NULL, |
114 | aml_start, aml_length, NULL, | 115 | aml_start, (u32) aml_length, |
115 | (u8) pass_number); | 116 | NULL, (u8) pass_number); |
116 | } | 117 | } |
117 | 118 | ||
118 | if (ACPI_FAILURE(status)) { | 119 | if (ACPI_FAILURE(status)) { |
119 | acpi_ds_delete_walk_state(walk_state); | 120 | acpi_ds_delete_walk_state(walk_state); |
120 | acpi_ps_delete_parse_tree(parse_root); | 121 | goto cleanup; |
121 | return_ACPI_STATUS(status); | 122 | } |
123 | |||
124 | /* start_node is the default location to load the table */ | ||
125 | |||
126 | if (start_node && start_node != acpi_gbl_root_node) { | ||
127 | status = | ||
128 | acpi_ds_scope_stack_push(start_node, ACPI_TYPE_METHOD, | ||
129 | walk_state); | ||
130 | if (ACPI_FAILURE(status)) { | ||
131 | acpi_ds_delete_walk_state(walk_state); | ||
132 | goto cleanup; | ||
133 | } | ||
122 | } | 134 | } |
123 | 135 | ||
124 | /* Parse the AML */ | 136 | /* Parse the AML */ |
@@ -127,6 +139,7 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number, | |||
127 | (unsigned)pass_number)); | 139 | (unsigned)pass_number)); |
128 | status = acpi_ps_parse_aml(walk_state); | 140 | status = acpi_ps_parse_aml(walk_state); |
129 | 141 | ||
142 | cleanup: | ||
130 | acpi_ps_delete_parse_tree(parse_root); | 143 | acpi_ps_delete_parse_tree(parse_root); |
131 | return_ACPI_STATUS(status); | 144 | return_ACPI_STATUS(status); |
132 | } | 145 | } |
@@ -163,7 +176,9 @@ acpi_ns_parse_table(acpi_native_uint table_index, | |||
163 | * performs another complete parse of the AML. | 176 | * performs another complete parse of the AML. |
164 | */ | 177 | */ |
165 | ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n")); | 178 | ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n")); |
166 | status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, table_index); | 179 | status = |
180 | acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, table_index, | ||
181 | start_node); | ||
167 | if (ACPI_FAILURE(status)) { | 182 | if (ACPI_FAILURE(status)) { |
168 | return_ACPI_STATUS(status); | 183 | return_ACPI_STATUS(status); |
169 | } | 184 | } |
@@ -178,7 +193,9 @@ acpi_ns_parse_table(acpi_native_uint table_index, | |||
178 | * parse objects are all cached. | 193 | * parse objects are all cached. |
179 | */ | 194 | */ |
180 | ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n")); | 195 | ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n")); |
181 | status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, table_index); | 196 | status = |
197 | acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, table_index, | ||
198 | start_node); | ||
182 | if (ACPI_FAILURE(status)) { | 199 | if (ACPI_FAILURE(status)) { |
183 | return_ACPI_STATUS(status); | 200 | return_ACPI_STATUS(status); |
184 | } | 201 | } |