diff options
author | Valery Podrezov <valery.a.podrezov@intel.com> | 2007-02-02 11:48:21 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-02 21:14:27 -0500 |
commit | 9bc75cff4919f9d947982d805aed89582a20d04d (patch) | |
tree | d07b8eb59b0dd6384f8fc5694113759ef7b8668e /drivers/acpi/dispatcher | |
parent | 4d0b4af958453afe871022e44abd57fac09baf67 (diff) |
ACPICA: Eliminate control method 2-pass parse/execute.
Completed an AML interpreter performance enhancement for control method
execution. Previously a 2-pass parse/execution, control methods are now
completely parsed and executed in single pass. This improves overall
interpreter performance by ~25%, reduces code size, and reduces CPU stack use.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/dispatcher')
-rw-r--r-- | drivers/acpi/dispatcher/dsmethod.c | 50 |
1 files changed, 4 insertions, 46 deletions
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c index cf888add3191..aa60dca1f8aa 100644 --- a/drivers/acpi/dispatcher/dsmethod.c +++ b/drivers/acpi/dispatcher/dsmethod.c | |||
@@ -327,7 +327,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, | |||
327 | ACPI_FUNCTION_TRACE_PTR(ds_call_control_method, this_walk_state); | 327 | ACPI_FUNCTION_TRACE_PTR(ds_call_control_method, this_walk_state); |
328 | 328 | ||
329 | ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, | 329 | ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, |
330 | "Execute method %p, currentstate=%p\n", | 330 | "Calling method %p, currentstate=%p\n", |
331 | this_walk_state->prev_op, this_walk_state)); | 331 | this_walk_state->prev_op, this_walk_state)); |
332 | 332 | ||
333 | /* | 333 | /* |
@@ -351,49 +351,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, | |||
351 | return_ACPI_STATUS(status); | 351 | return_ACPI_STATUS(status); |
352 | } | 352 | } |
353 | 353 | ||
354 | /* | 354 | /* Begin method parse/execution. Create a new walk state */ |
355 | * 1) Parse the method. All "normal" methods are parsed for each execution. | ||
356 | * Internal methods (_OSI, etc.) do not require parsing. | ||
357 | */ | ||
358 | if (!(obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY)) { | ||
359 | |||
360 | /* Create a new walk state for the parse */ | ||
361 | |||
362 | next_walk_state = | ||
363 | acpi_ds_create_walk_state(obj_desc->method.owner_id, op, | ||
364 | obj_desc, NULL); | ||
365 | if (!next_walk_state) { | ||
366 | status = AE_NO_MEMORY; | ||
367 | goto cleanup; | ||
368 | } | ||
369 | |||
370 | /* Create and init a parse tree root */ | ||
371 | |||
372 | op = acpi_ps_create_scope_op(); | ||
373 | if (!op) { | ||
374 | status = AE_NO_MEMORY; | ||
375 | goto cleanup; | ||
376 | } | ||
377 | |||
378 | status = acpi_ds_init_aml_walk(next_walk_state, op, method_node, | ||
379 | obj_desc->method.aml_start, | ||
380 | obj_desc->method.aml_length, | ||
381 | NULL, 1); | ||
382 | if (ACPI_FAILURE(status)) { | ||
383 | acpi_ps_delete_parse_tree(op); | ||
384 | goto cleanup; | ||
385 | } | ||
386 | |||
387 | /* Begin AML parse (deletes next_walk_state) */ | ||
388 | |||
389 | status = acpi_ps_parse_aml(next_walk_state); | ||
390 | acpi_ps_delete_parse_tree(op); | ||
391 | if (ACPI_FAILURE(status)) { | ||
392 | goto cleanup; | ||
393 | } | ||
394 | } | ||
395 | |||
396 | /* 2) Begin method execution. Create a new walk state */ | ||
397 | 355 | ||
398 | next_walk_state = acpi_ds_create_walk_state(obj_desc->method.owner_id, | 356 | next_walk_state = acpi_ds_create_walk_state(obj_desc->method.owner_id, |
399 | NULL, obj_desc, thread); | 357 | NULL, obj_desc, thread); |
@@ -445,8 +403,8 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, | |||
445 | this_walk_state->num_operands = 0; | 403 | this_walk_state->num_operands = 0; |
446 | 404 | ||
447 | ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, | 405 | ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, |
448 | "Starting nested execution, newstate=%p\n", | 406 | "**** Begin nested execution of [%4.4s] **** WalkState=%p\n", |
449 | next_walk_state)); | 407 | method_node->name.ascii, next_walk_state)); |
450 | 408 | ||
451 | /* Invoke an internal method if necessary */ | 409 | /* Invoke an internal method if necessary */ |
452 | 410 | ||