|
15 | 15 | #include "acinterp.h" |
16 | 16 | #include "acnamesp.h" |
17 | 17 | #include "acevents.h" |
| 18 | +#ifdef ACPI_EXEC_APP |
| 19 | +#include "aecommon.h" |
| 20 | +#endif |
18 | 21 |
|
19 | 22 | #define _COMPONENT ACPI_DISPATCHER |
20 | 23 | ACPI_MODULE_NAME("dswload2") |
@@ -373,6 +376,10 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) |
373 | 376 | struct acpi_namespace_node *new_node; |
374 | 377 | u32 i; |
375 | 378 | u8 region_space; |
| 379 | +#ifdef ACPI_EXEC_APP |
| 380 | + union acpi_operand_object *obj_desc; |
| 381 | + char *namepath; |
| 382 | +#endif |
376 | 383 |
|
377 | 384 | ACPI_FUNCTION_TRACE(ds_load2_end_op); |
378 | 385 |
|
@@ -466,6 +473,11 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) |
466 | 473 | * be evaluated later during the execution phase |
467 | 474 | */ |
468 | 475 | status = acpi_ds_create_buffer_field(op, walk_state); |
| 476 | + if (ACPI_FAILURE(status)) { |
| 477 | + ACPI_EXCEPTION((AE_INFO, status, |
| 478 | + "CreateBufferField failure")); |
| 479 | + goto cleanup; |
| 480 | + } |
469 | 481 | break; |
470 | 482 |
|
471 | 483 | case AML_TYPE_NAMED_FIELD: |
@@ -604,6 +616,29 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) |
604 | 616 | case AML_NAME_OP: |
605 | 617 |
|
606 | 618 | status = acpi_ds_create_node(walk_state, node, op); |
| 619 | + if (ACPI_FAILURE(status)) { |
| 620 | + goto cleanup; |
| 621 | + } |
| 622 | +#ifdef ACPI_EXEC_APP |
| 623 | + /* |
| 624 | + * acpi_exec support for namespace initialization file (initialize |
| 625 | + * Name opcodes in this code.) |
| 626 | + */ |
| 627 | + namepath = acpi_ns_get_external_pathname(node); |
| 628 | + status = ae_lookup_init_file_entry(namepath, &obj_desc); |
| 629 | + if (ACPI_SUCCESS(status)) { |
| 630 | + |
| 631 | + /* Detach any existing object, attach new object */ |
| 632 | + |
| 633 | + if (node->object) { |
| 634 | + acpi_ns_detach_object(node); |
| 635 | + } |
| 636 | + acpi_ns_attach_object(node, obj_desc, |
| 637 | + obj_desc->common.type); |
| 638 | + } |
| 639 | + ACPI_FREE(namepath); |
| 640 | + status = AE_OK; |
| 641 | +#endif |
607 | 642 | break; |
608 | 643 |
|
609 | 644 | case AML_METHOD_OP: |
|
0 commit comments