diff options
author | Bob Moore <robert.moore@intel.com> | 2006-05-26 16:36:00 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-06-14 02:44:35 -0400 |
commit | 4119532c95547821dbe72d6916dfa1b2148475b3 (patch) | |
tree | 564eb8f69924fb7dc72e93526faf1547acac7d30 /drivers/acpi/namespace/nsinit.c | |
parent | b8d35192c55fb055792ff0641408eaaec7c88988 (diff) |
ACPI: ACPICA 20060526
Restructured, flattened, and simplified the internal
interfaces for namespace object evaluation - resulting
in smaller code, less CPU stack use, and fewer
interfaces. (With assistance from Mikhail Kouzmich)
Fixed a problem with the CopyObject operator where the
first parameter was not typed correctly for the parser,
interpreter, compiler, and disassembler. Caused various
errors and unexpected behavior.
Fixed a problem where a ShiftLeft or ShiftRight of
more than 64 bits produced incorrect results with some
C compilers. Since the behavior of C compilers when
the shift value is larger than the datatype width is
apparently not well defined, the interpreter now detects
this condition and simply returns zero as expected in all
such cases. (BZ 395)
Fixed problem reports (Valery Podrezov) integrated: -
Update String-to-Integer conversion to match ACPI 3.0A spec
http://bugzilla.kernel.org/show_bug.cgi?id=5329
Allow interpreter to handle nested method declarations
http://bugzilla.kernel.org/show_bug.cgi?id=5361
Fixed problem reports (Fiodor Suietov) integrated: -
acpi_terminate() doesn't free debug memory allocation
list objects (BZ 355) - After Core Subsystem
shutdown, acpi_subsystem_status() returns AE_OK (BZ 356) -
acpi_os_unmap_memory() for RSDP can be invoked inconsistently
(BZ 357) - Resource Manager should return AE_TYPE for
non-device objects (BZ 358) - Incomplete cleanup branch
in AcpiNsEvaluateRelative (BZ 359) - Use acpi_os_free()
instead of ACPI_FREE in acpi_rs_set_srs_method_data (BZ 360)
- Incomplete cleanup branch in acpi_ps_parse_aml (BZ 361) -
Incomplete cleanup branch in acpi_ds_delete_walk_state (BZ 362)
- acpi_get_table_header returns AE_NO_ACPI_TABLES until DSDT
is loaded (BZ 365) - Status of the Global Initialization
Handler call not used (BZ 366) - Incorrect object parameter
to Global Initialization Handler (BZ 367)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/namespace/nsinit.c')
-rw-r--r-- | drivers/acpi/namespace/nsinit.c | 57 |
1 files changed, 36 insertions, 21 deletions
diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c index bf1d8dbc0b86..1c9ca6e05314 100644 --- a/drivers/acpi/namespace/nsinit.c +++ b/drivers/acpi/namespace/nsinit.c | |||
@@ -154,7 +154,16 @@ acpi_status acpi_ns_initialize_devices(void) | |||
154 | ACPI_UINT32_MAX, FALSE, | 154 | ACPI_UINT32_MAX, FALSE, |
155 | acpi_ns_find_ini_methods, &info, NULL); | 155 | acpi_ns_find_ini_methods, &info, NULL); |
156 | if (ACPI_FAILURE(status)) { | 156 | if (ACPI_FAILURE(status)) { |
157 | ACPI_EXCEPTION((AE_INFO, status, "During WalkNamespace")); | 157 | goto error_exit; |
158 | } | ||
159 | |||
160 | /* Allocate the evaluation information block */ | ||
161 | |||
162 | info.evaluate_info = | ||
163 | ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info)); | ||
164 | if (!info.evaluate_info) { | ||
165 | status = AE_NO_MEMORY; | ||
166 | goto error_exit; | ||
158 | } | 167 | } |
159 | 168 | ||
160 | /* Walk namespace to execute all _INIs on present devices */ | 169 | /* Walk namespace to execute all _INIs on present devices */ |
@@ -162,8 +171,10 @@ acpi_status acpi_ns_initialize_devices(void) | |||
162 | status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, | 171 | status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, |
163 | ACPI_UINT32_MAX, FALSE, | 172 | ACPI_UINT32_MAX, FALSE, |
164 | acpi_ns_init_one_device, &info, NULL); | 173 | acpi_ns_init_one_device, &info, NULL); |
174 | |||
175 | ACPI_FREE(info.evaluate_info); | ||
165 | if (ACPI_FAILURE(status)) { | 176 | if (ACPI_FAILURE(status)) { |
166 | ACPI_EXCEPTION((AE_INFO, status, "During WalkNamespace")); | 177 | goto error_exit; |
167 | } | 178 | } |
168 | 179 | ||
169 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, | 180 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, |
@@ -171,6 +182,10 @@ acpi_status acpi_ns_initialize_devices(void) | |||
171 | info.num_INI, info.num_STA, info.device_count)); | 182 | info.num_INI, info.num_STA, info.device_count)); |
172 | 183 | ||
173 | return_ACPI_STATUS(status); | 184 | return_ACPI_STATUS(status); |
185 | |||
186 | error_exit: | ||
187 | ACPI_EXCEPTION((AE_INFO, status, "During device initialization")); | ||
188 | return_ACPI_STATUS(status); | ||
174 | } | 189 | } |
175 | 190 | ||
176 | /******************************************************************************* | 191 | /******************************************************************************* |
@@ -398,9 +413,9 @@ static acpi_status | |||
398 | acpi_ns_init_one_device(acpi_handle obj_handle, | 413 | acpi_ns_init_one_device(acpi_handle obj_handle, |
399 | u32 nesting_level, void *context, void **return_value) | 414 | u32 nesting_level, void *context, void **return_value) |
400 | { | 415 | { |
401 | struct acpi_device_walk_info *info = | 416 | struct acpi_device_walk_info *walk_info = |
402 | ACPI_CAST_PTR(struct acpi_device_walk_info, context); | 417 | ACPI_CAST_PTR(struct acpi_device_walk_info, context); |
403 | struct acpi_parameter_info pinfo; | 418 | struct acpi_evaluate_info *info = walk_info->evaluate_info; |
404 | u32 flags; | 419 | u32 flags; |
405 | acpi_status status; | 420 | acpi_status status; |
406 | struct acpi_namespace_node *device_node; | 421 | struct acpi_namespace_node *device_node; |
@@ -460,7 +475,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
460 | * other words, the device is present, ..., and functioning)" | 475 | * other words, the device is present, ..., and functioning)" |
461 | */ | 476 | */ |
462 | if (flags != ACPI_UINT32_MAX) { | 477 | if (flags != ACPI_UINT32_MAX) { |
463 | info->num_STA++; | 478 | walk_info->num_STA++; |
464 | } | 479 | } |
465 | 480 | ||
466 | /* | 481 | /* |
@@ -516,20 +531,16 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
516 | ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname | 531 | ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname |
517 | (ACPI_TYPE_METHOD, device_node, METHOD_NAME__INI)); | 532 | (ACPI_TYPE_METHOD, device_node, METHOD_NAME__INI)); |
518 | 533 | ||
519 | pinfo.node = device_node; | 534 | info->prefix_node = device_node; |
520 | pinfo.parameters = NULL; | 535 | info->pathname = METHOD_NAME__INI; |
521 | pinfo.parameter_type = ACPI_PARAM_ARGS; | 536 | info->parameters = NULL; |
537 | info->parameter_type = ACPI_PARAM_ARGS; | ||
538 | info->flags = ACPI_IGNORE_RETURN_VALUE; | ||
522 | 539 | ||
523 | status = acpi_ns_evaluate_relative(METHOD_NAME__INI, &pinfo); | 540 | status = acpi_ns_evaluate(info); |
524 | if (ACPI_SUCCESS(status)) { | 541 | if (ACPI_SUCCESS(status)) { |
542 | walk_info->num_INI++; | ||
525 | 543 | ||
526 | /* Delete any return object (especially if implicit_return is enabled) */ | ||
527 | |||
528 | if (pinfo.return_object) { | ||
529 | acpi_ut_remove_reference(pinfo.return_object); | ||
530 | } | ||
531 | |||
532 | info->num_INI++; | ||
533 | if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && | 544 | if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && |
534 | (!(acpi_dbg_level & ACPI_LV_INFO))) { | 545 | (!(acpi_dbg_level & ACPI_LV_INFO))) { |
535 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ".")); | 546 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ".")); |
@@ -540,20 +551,24 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
540 | 551 | ||
541 | /* Ignore error and move on to next device */ | 552 | /* Ignore error and move on to next device */ |
542 | 553 | ||
543 | char *scope_name = acpi_ns_get_external_pathname(pinfo.node); | 554 | char *scope_name = |
555 | acpi_ns_get_external_pathname(info->resolved_node); | ||
544 | 556 | ||
545 | ACPI_EXCEPTION((AE_INFO, status, "during %s._INI execution", | 557 | ACPI_EXCEPTION((AE_INFO, status, "during %s._INI execution", |
546 | scope_name)); | 558 | scope_name)); |
547 | ACPI_FREE(scope_name); | 559 | ACPI_FREE(scope_name); |
560 | status = AE_OK; | ||
548 | } | 561 | } |
549 | #endif | 562 | #endif |
550 | 563 | ||
551 | /* If an external initialization handler is present, call it */ | 564 | /* |
552 | 565 | * The _INI method has been run if present; call the Global Initialization | |
566 | * Handler for this device. | ||
567 | */ | ||
553 | if (acpi_gbl_init_handler) { | 568 | if (acpi_gbl_init_handler) { |
554 | status = | 569 | status = |
555 | acpi_gbl_init_handler(pinfo.node, ACPI_INIT_DEVICE_INI); | 570 | acpi_gbl_init_handler(device_node, ACPI_INIT_DEVICE_INI); |
556 | } | 571 | } |
557 | 572 | ||
558 | return_ACPI_STATUS(AE_OK); | 573 | return_ACPI_STATUS(status); |
559 | } | 574 | } |