| .. | .. |
|---|
| 3 | 3 | * |
|---|
| 4 | 4 | * Module Name: nsinit - namespace initialization |
|---|
| 5 | 5 | * |
|---|
| 6 | | - * Copyright (C) 2000 - 2018, Intel Corp. |
|---|
| 6 | + * Copyright (C) 2000 - 2020, Intel Corp. |
|---|
| 7 | 7 | * |
|---|
| 8 | 8 | *****************************************************************************/ |
|---|
| 9 | 9 | |
|---|
| .. | .. |
|---|
| 55 | 55 | ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, |
|---|
| 56 | 56 | "**** Starting initialization of namespace objects ****\n")); |
|---|
| 57 | 57 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, |
|---|
| 58 | | - "Completing Region/Field/Buffer/Package initialization:\n")); |
|---|
| 58 | + "Final data object initialization: ")); |
|---|
| 59 | 59 | |
|---|
| 60 | | - /* Set all init info to zero */ |
|---|
| 60 | + /* Clear the info block */ |
|---|
| 61 | 61 | |
|---|
| 62 | 62 | memset(&info, 0, sizeof(struct acpi_init_walk_info)); |
|---|
| 63 | 63 | |
|---|
| 64 | 64 | /* Walk entire namespace from the supplied root */ |
|---|
| 65 | 65 | |
|---|
| 66 | + /* |
|---|
| 67 | + * TBD: will become ACPI_TYPE_PACKAGE as this type object |
|---|
| 68 | + * is now the only one that supports deferred initialization |
|---|
| 69 | + * (forward references). |
|---|
| 70 | + */ |
|---|
| 66 | 71 | status = acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, |
|---|
| 67 | 72 | ACPI_UINT32_MAX, acpi_ns_init_one_object, |
|---|
| 68 | 73 | NULL, &info, NULL); |
|---|
| .. | .. |
|---|
| 71 | 76 | } |
|---|
| 72 | 77 | |
|---|
| 73 | 78 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, |
|---|
| 74 | | - " Initialized %u/%u Regions %u/%u Fields %u/%u " |
|---|
| 75 | | - "Buffers %u/%u Packages (%u nodes)\n", |
|---|
| 76 | | - info.op_region_init, info.op_region_count, |
|---|
| 77 | | - info.field_init, info.field_count, |
|---|
| 78 | | - info.buffer_init, info.buffer_count, |
|---|
| 79 | | - info.package_init, info.package_count, |
|---|
| 80 | | - info.object_count)); |
|---|
| 79 | + "Namespace contains %u (0x%X) objects\n", |
|---|
| 80 | + info.object_count, info.object_count)); |
|---|
| 81 | 81 | |
|---|
| 82 | 82 | ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, |
|---|
| 83 | 83 | "%u Control Methods found\n%u Op Regions found\n", |
|---|
| .. | .. |
|---|
| 382 | 382 | acpi_ex_enter_interpreter(); |
|---|
| 383 | 383 | |
|---|
| 384 | 384 | /* |
|---|
| 385 | | - * Each of these types can contain executable AML code within the |
|---|
| 386 | | - * declaration. |
|---|
| 385 | + * Only initialization of Package objects can be deferred, in order |
|---|
| 386 | + * to support forward references. |
|---|
| 387 | 387 | */ |
|---|
| 388 | 388 | switch (type) { |
|---|
| 389 | | - case ACPI_TYPE_REGION: |
|---|
| 390 | | - |
|---|
| 391 | | - info->op_region_init++; |
|---|
| 392 | | - status = acpi_ds_get_region_arguments(obj_desc); |
|---|
| 393 | | - break; |
|---|
| 394 | | - |
|---|
| 395 | | - case ACPI_TYPE_BUFFER_FIELD: |
|---|
| 396 | | - |
|---|
| 397 | | - info->field_init++; |
|---|
| 398 | | - status = acpi_ds_get_buffer_field_arguments(obj_desc); |
|---|
| 399 | | - break; |
|---|
| 400 | | - |
|---|
| 401 | 389 | case ACPI_TYPE_LOCAL_BANK_FIELD: |
|---|
| 390 | + |
|---|
| 391 | + /* TBD: bank_fields do not require deferred init, remove this code */ |
|---|
| 402 | 392 | |
|---|
| 403 | 393 | info->field_init++; |
|---|
| 404 | 394 | status = acpi_ds_get_bank_field_arguments(obj_desc); |
|---|
| 405 | | - break; |
|---|
| 406 | | - |
|---|
| 407 | | - case ACPI_TYPE_BUFFER: |
|---|
| 408 | | - |
|---|
| 409 | | - info->buffer_init++; |
|---|
| 410 | | - status = acpi_ds_get_buffer_arguments(obj_desc); |
|---|
| 411 | 395 | break; |
|---|
| 412 | 396 | |
|---|
| 413 | 397 | case ACPI_TYPE_PACKAGE: |
|---|
| .. | .. |
|---|
| 421 | 405 | |
|---|
| 422 | 406 | default: |
|---|
| 423 | 407 | |
|---|
| 424 | | - /* No other types can get here */ |
|---|
| 408 | + /* No other types should get here */ |
|---|
| 425 | 409 | |
|---|
| 410 | + status = AE_TYPE; |
|---|
| 411 | + ACPI_EXCEPTION((AE_INFO, status, |
|---|
| 412 | + "Opcode is not deferred [%4.4s] (%s)", |
|---|
| 413 | + acpi_ut_get_node_name(node), |
|---|
| 414 | + acpi_ut_get_type_name(type))); |
|---|
| 426 | 415 | break; |
|---|
| 427 | 416 | } |
|---|
| 428 | 417 | |
|---|
| .. | .. |
|---|
| 478 | 467 | |
|---|
| 479 | 468 | /* We are only looking for methods named _INI */ |
|---|
| 480 | 469 | |
|---|
| 481 | | - if (!ACPI_COMPARE_NAME(node->name.ascii, METHOD_NAME__INI)) { |
|---|
| 470 | + if (!ACPI_COMPARE_NAMESEG(node->name.ascii, METHOD_NAME__INI)) { |
|---|
| 482 | 471 | return (AE_OK); |
|---|
| 483 | 472 | } |
|---|
| 484 | 473 | |
|---|
| .. | .. |
|---|
| 641 | 630 | * Note: We know there is an _INI within this subtree, but it may not be |
|---|
| 642 | 631 | * under this particular device, it may be lower in the branch. |
|---|
| 643 | 632 | */ |
|---|
| 644 | | - if (!ACPI_COMPARE_NAME(device_node->name.ascii, "_SB_") || |
|---|
| 633 | + if (!ACPI_COMPARE_NAMESEG(device_node->name.ascii, "_SB_") || |
|---|
| 645 | 634 | device_node->parent != acpi_gbl_root_node) { |
|---|
| 646 | 635 | ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname |
|---|
| 647 | 636 | (ACPI_TYPE_METHOD, device_node, |
|---|