aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/parser/psscope.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/parser/psscope.c')
-rw-r--r--drivers/acpi/parser/psscope.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/drivers/acpi/parser/psscope.c b/drivers/acpi/parser/psscope.c
index dcbed49608b0..8dcd1b1e7131 100644
--- a/drivers/acpi/parser/psscope.c
+++ b/drivers/acpi/parser/psscope.c
@@ -65,6 +65,7 @@ union acpi_parse_object *
65acpi_ps_get_parent_scope ( 65acpi_ps_get_parent_scope (
66 struct acpi_parse_state *parser_state) 66 struct acpi_parse_state *parser_state)
67{ 67{
68
68 return (parser_state->scope->parse_scope.op); 69 return (parser_state->scope->parse_scope.op);
69} 70}
70 71
@@ -87,8 +88,10 @@ u8
87acpi_ps_has_completed_scope ( 88acpi_ps_has_completed_scope (
88 struct acpi_parse_state *parser_state) 89 struct acpi_parse_state *parser_state)
89{ 90{
90 return ((u8) ((parser_state->aml >= parser_state->scope->parse_scope.arg_end || 91
91 !parser_state->scope->parse_scope.arg_count))); 92 return ((u8)
93 ((parser_state->aml >= parser_state->scope->parse_scope.arg_end ||
94 !parser_state->scope->parse_scope.arg_count)));
92} 95}
93 96
94 97
@@ -167,23 +170,23 @@ acpi_ps_push_scope (
167 return_ACPI_STATUS (AE_NO_MEMORY); 170 return_ACPI_STATUS (AE_NO_MEMORY);
168 } 171 }
169 172
170 scope->common.data_type = ACPI_DESC_TYPE_STATE_PSCOPE; 173 scope->common.data_type = ACPI_DESC_TYPE_STATE_PSCOPE;
171 scope->parse_scope.op = op; 174 scope->parse_scope.op = op;
172 scope->parse_scope.arg_list = remaining_args; 175 scope->parse_scope.arg_list = remaining_args;
173 scope->parse_scope.arg_count = arg_count; 176 scope->parse_scope.arg_count = arg_count;
174 scope->parse_scope.pkg_end = parser_state->pkg_end; 177 scope->parse_scope.pkg_end = parser_state->pkg_end;
175 178
176 /* Push onto scope stack */ 179 /* Push onto scope stack */
177 180
178 acpi_ut_push_generic_state (&parser_state->scope, scope); 181 acpi_ut_push_generic_state (&parser_state->scope, scope);
179 182
180 if (arg_count == ACPI_VAR_ARGS) { 183 if (arg_count == ACPI_VAR_ARGS) {
181 /* multiple arguments */ 184 /* Multiple arguments */
182 185
183 scope->parse_scope.arg_end = parser_state->pkg_end; 186 scope->parse_scope.arg_end = parser_state->pkg_end;
184 } 187 }
185 else { 188 else {
186 /* single argument */ 189 /* Single argument */
187 190
188 scope->parse_scope.arg_end = ACPI_TO_POINTER (ACPI_MAX_PTR); 191 scope->parse_scope.arg_end = ACPI_TO_POINTER (ACPI_MAX_PTR);
189 } 192 }
@@ -221,18 +224,17 @@ acpi_ps_pop_scope (
221 ACPI_FUNCTION_TRACE ("ps_pop_scope"); 224 ACPI_FUNCTION_TRACE ("ps_pop_scope");
222 225
223 226
224 /* 227 /* Only pop the scope if there is in fact a next scope */
225 * Only pop the scope if there is in fact a next scope 228
226 */
227 if (scope->common.next) { 229 if (scope->common.next) {
228 scope = acpi_ut_pop_generic_state (&parser_state->scope); 230 scope = acpi_ut_pop_generic_state (&parser_state->scope);
229 231
230 /* return to parsing previous op */ 232 /* return to parsing previous op */
231 233
232 *op = scope->parse_scope.op; 234 *op = scope->parse_scope.op;
233 *arg_list = scope->parse_scope.arg_list; 235 *arg_list = scope->parse_scope.arg_list;
234 *arg_count = scope->parse_scope.arg_count; 236 *arg_count = scope->parse_scope.arg_count;
235 parser_state->pkg_end = scope->parse_scope.pkg_end; 237 parser_state->pkg_end = scope->parse_scope.pkg_end;
236 238
237 /* All done with this scope state structure */ 239 /* All done with this scope state structure */
238 240
@@ -241,12 +243,13 @@ acpi_ps_pop_scope (
241 else { 243 else {
242 /* empty parse stack, prepare to fetch next opcode */ 244 /* empty parse stack, prepare to fetch next opcode */
243 245
244 *op = NULL; 246 *op = NULL;
245 *arg_list = 0; 247 *arg_list = 0;
246 *arg_count = 0; 248 *arg_count = 0;
247 } 249 }
248 250
249 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped Op %p Args %X\n", *op, *arg_count)); 251 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
252 "Popped Op %p Args %X\n", *op, *arg_count));
250 return_VOID; 253 return_VOID;
251} 254}
252 255
@@ -257,7 +260,7 @@ acpi_ps_pop_scope (
257 * 260 *
258 * PARAMETERS: parser_state - Current parser state object 261 * PARAMETERS: parser_state - Current parser state object
259 * 262 *
260 * RETURN: Status 263 * RETURN: None
261 * 264 *
262 * DESCRIPTION: Destroy available list, remaining stack levels, and return 265 * DESCRIPTION: Destroy available list, remaining stack levels, and return
263 * root scope 266 * root scope