| .. | .. |
|---|
| 86 | 86 | * |
|---|
| 87 | 87 | * RETURN: Status |
|---|
| 88 | 88 | * |
|---|
| 89 | | - * DESCRIPTION: Execute a control method. |
|---|
| 89 | + * DESCRIPTION: Execute a control method. Used to evaluate objects via the |
|---|
| 90 | + * "EXECUTE" or "EVALUATE" commands. |
|---|
| 90 | 91 | * |
|---|
| 91 | 92 | ******************************************************************************/ |
|---|
| 92 | 93 | |
|---|
| .. | .. |
|---|
| 160 | 161 | } |
|---|
| 161 | 162 | |
|---|
| 162 | 163 | ACPI_EXCEPTION((AE_INFO, status, |
|---|
| 163 | | - "while executing %s from debugger", |
|---|
| 164 | + "while executing %s from AML Debugger", |
|---|
| 164 | 165 | info->pathname)); |
|---|
| 165 | 166 | |
|---|
| 166 | 167 | if (status == AE_BUFFER_OVERFLOW) { |
|---|
| 167 | 168 | ACPI_ERROR((AE_INFO, |
|---|
| 168 | | - "Possible overflow of internal debugger " |
|---|
| 169 | + "Possible buffer overflow within AML Debugger " |
|---|
| 169 | 170 | "buffer (size 0x%X needed 0x%X)", |
|---|
| 170 | 171 | ACPI_DEBUG_BUFFER_SIZE, |
|---|
| 171 | 172 | (u32)return_obj->length)); |
|---|
| .. | .. |
|---|
| 314 | 315 | |
|---|
| 315 | 316 | status = acpi_evaluate_object(node, NULL, NULL, &return_obj); |
|---|
| 316 | 317 | |
|---|
| 318 | + acpi_gbl_method_executing = FALSE; |
|---|
| 319 | + |
|---|
| 317 | 320 | acpi_os_printf("Evaluation of [%4.4s] returned %s\n", |
|---|
| 318 | 321 | acpi_ut_get_node_name(node), |
|---|
| 319 | 322 | acpi_format_exception(status)); |
|---|
| 320 | 323 | |
|---|
| 321 | | - acpi_gbl_method_executing = FALSE; |
|---|
| 322 | 324 | return (AE_OK); |
|---|
| 323 | 325 | } |
|---|
| 324 | 326 | |
|---|
| .. | .. |
|---|
| 334 | 336 | * RETURN: None |
|---|
| 335 | 337 | * |
|---|
| 336 | 338 | * DESCRIPTION: Execute a control method. Name is relative to the current |
|---|
| 337 | | - * scope. |
|---|
| 339 | + * scope. Function used for the "EXECUTE", "EVALUATE", and |
|---|
| 340 | + * "ALL" commands |
|---|
| 338 | 341 | * |
|---|
| 339 | 342 | ******************************************************************************/ |
|---|
| 340 | 343 | |
|---|
| .. | .. |
|---|
| 372 | 375 | return; |
|---|
| 373 | 376 | } |
|---|
| 374 | 377 | |
|---|
| 378 | + if ((flags & EX_ALL) && (strlen(name) > 4)) { |
|---|
| 379 | + acpi_os_printf("Input name (%s) must be a 4-char NameSeg\n", |
|---|
| 380 | + name); |
|---|
| 381 | + return; |
|---|
| 382 | + } |
|---|
| 383 | + |
|---|
| 375 | 384 | name_string = ACPI_ALLOCATE(strlen(name) + 1); |
|---|
| 376 | 385 | if (!name_string) { |
|---|
| 377 | 386 | return; |
|---|
| .. | .. |
|---|
| 389 | 398 | return; |
|---|
| 390 | 399 | } |
|---|
| 391 | 400 | |
|---|
| 392 | | - acpi_gbl_db_method_info.name = name_string; |
|---|
| 393 | | - acpi_gbl_db_method_info.args = args; |
|---|
| 394 | | - acpi_gbl_db_method_info.types = types; |
|---|
| 395 | | - acpi_gbl_db_method_info.flags = flags; |
|---|
| 401 | + /* Command (ALL <nameseg>) to execute all methods of a particular name */ |
|---|
| 396 | 402 | |
|---|
| 397 | | - return_obj.pointer = NULL; |
|---|
| 398 | | - return_obj.length = ACPI_ALLOCATE_BUFFER; |
|---|
| 403 | + else if (flags & EX_ALL) { |
|---|
| 404 | + acpi_gbl_db_method_info.name = name_string; |
|---|
| 405 | + return_obj.pointer = NULL; |
|---|
| 406 | + return_obj.length = ACPI_ALLOCATE_BUFFER; |
|---|
| 407 | + acpi_db_evaluate_all(name_string); |
|---|
| 408 | + ACPI_FREE(name_string); |
|---|
| 409 | + return; |
|---|
| 410 | + } else { |
|---|
| 411 | + acpi_gbl_db_method_info.name = name_string; |
|---|
| 412 | + acpi_gbl_db_method_info.args = args; |
|---|
| 413 | + acpi_gbl_db_method_info.types = types; |
|---|
| 414 | + acpi_gbl_db_method_info.flags = flags; |
|---|
| 415 | + |
|---|
| 416 | + return_obj.pointer = NULL; |
|---|
| 417 | + return_obj.length = ACPI_ALLOCATE_BUFFER; |
|---|
| 418 | + } |
|---|
| 399 | 419 | |
|---|
| 400 | 420 | status = acpi_db_execute_setup(&acpi_gbl_db_method_info); |
|---|
| 401 | 421 | if (ACPI_FAILURE(status)) { |
|---|
| .. | .. |
|---|
| 450 | 470 | (u32)return_obj.length); |
|---|
| 451 | 471 | |
|---|
| 452 | 472 | acpi_db_dump_external_object(return_obj.pointer, 1); |
|---|
| 473 | + acpi_os_printf("\n"); |
|---|
| 453 | 474 | |
|---|
| 454 | 475 | /* Dump a _PLD buffer if present */ |
|---|
| 455 | 476 | |
|---|
| 456 | | - if (ACPI_COMPARE_NAME |
|---|
| 477 | + if (ACPI_COMPARE_NAMESEG |
|---|
| 457 | 478 | ((ACPI_CAST_PTR |
|---|
| 458 | 479 | (struct acpi_namespace_node, |
|---|
| 459 | 480 | acpi_gbl_db_method_info.method)->name.ascii), |
|---|