Commit 86a33cf3 authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki

ACPICA: Update for object initialization sequence

ACPICA commit 106c72a97f5ca972f29956e5e9a0429b8c4a2723

 1) Do not allow the objects to be initialized twice
 2) Only package objects require a deferred initialization
 3) Cleanup initialization output

Link: https://github.com/acpica/acpica/commit/106c72a9Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarErik Schmauss <erik.schmauss@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 8894f52a
...@@ -202,7 +202,7 @@ acpi_ds_initialize_objects(u32 table_index, ...@@ -202,7 +202,7 @@ acpi_ds_initialize_objects(u32 table_index,
if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT)) { if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT)) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"\nInitializing Namespace objects:\n")); "\nACPI table initialization:\n"));
} }
/* Summary of objects initialized */ /* Summary of objects initialized */
......
...@@ -55,14 +55,19 @@ acpi_status acpi_ns_initialize_objects(void) ...@@ -55,14 +55,19 @@ acpi_status acpi_ns_initialize_objects(void)
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n")); "**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Completing Region/Field/Buffer/Package initialization:\n")); "Final data object initialization: "));
/* Set all init info to zero */ /* Clear the info block */
memset(&info, 0, sizeof(struct acpi_init_walk_info)); memset(&info, 0, sizeof(struct acpi_init_walk_info));
/* Walk entire namespace from the supplied root */ /* Walk entire namespace from the supplied root */
/*
* TBD: will become ACPI_TYPE_PACKAGE as this type object
* is now the only one that supports deferred initialization
* (forward references).
*/
status = acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, status = acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, acpi_ns_init_one_object, ACPI_UINT32_MAX, acpi_ns_init_one_object,
NULL, &info, NULL); NULL, &info, NULL);
...@@ -71,13 +76,8 @@ acpi_status acpi_ns_initialize_objects(void) ...@@ -71,13 +76,8 @@ acpi_status acpi_ns_initialize_objects(void)
} }
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
" Initialized %u/%u Regions %u/%u Fields %u/%u " "Namespace contains %u (0x%X) objects\n",
"Buffers %u/%u Packages (%u nodes)\n", info.object_count, info.object_count));
info.op_region_init, info.op_region_count,
info.field_init, info.field_count,
info.buffer_init, info.buffer_count,
info.package_init, info.package_count,
info.object_count));
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"%u Control Methods found\n%u Op Regions found\n", "%u Control Methods found\n%u Op Regions found\n",
...@@ -382,34 +382,18 @@ acpi_ns_init_one_object(acpi_handle obj_handle, ...@@ -382,34 +382,18 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
acpi_ex_enter_interpreter(); acpi_ex_enter_interpreter();
/* /*
* Each of these types can contain executable AML code within the * Only initialization of Package objects can be deferred, in order
* declaration. * to support forward references.
*/ */
switch (type) { switch (type) {
case ACPI_TYPE_REGION:
info->op_region_init++;
status = acpi_ds_get_region_arguments(obj_desc);
break;
case ACPI_TYPE_BUFFER_FIELD:
info->field_init++;
status = acpi_ds_get_buffer_field_arguments(obj_desc);
break;
case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
/* TBD: bank_fields do not require deferred init, remove this code */
info->field_init++; info->field_init++;
status = acpi_ds_get_bank_field_arguments(obj_desc); status = acpi_ds_get_bank_field_arguments(obj_desc);
break; break;
case ACPI_TYPE_BUFFER:
info->buffer_init++;
status = acpi_ds_get_buffer_arguments(obj_desc);
break;
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
/* Complete the initialization/resolution of the package object */ /* Complete the initialization/resolution of the package object */
...@@ -421,8 +405,13 @@ acpi_ns_init_one_object(acpi_handle obj_handle, ...@@ -421,8 +405,13 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
default: default:
/* No other types can get here */ /* No other types should get here */
status = AE_TYPE;
ACPI_EXCEPTION((AE_INFO, status,
"Opcode is not deferred [%4.4s] (%s)",
acpi_ut_get_node_name(node),
acpi_ut_get_type_name(type)));
break; break;
} }
......
...@@ -211,11 +211,17 @@ acpi_status ACPI_INIT_FUNCTION acpi_initialize_objects(u32 flags) ...@@ -211,11 +211,17 @@ acpi_status ACPI_INIT_FUNCTION acpi_initialize_objects(u32 flags)
ACPI_FUNCTION_TRACE(acpi_initialize_objects); ACPI_FUNCTION_TRACE(acpi_initialize_objects);
#ifdef ACPI_OBSOLETE_BEHAVIOR
/*
* 05/2019: Removed, initialization now happens at both object
* creation and table load time
*/
/* /*
* Initialize the objects that remain uninitialized. This * Initialize the objects that remain uninitialized. This
* runs the executable AML that may be part of the * runs the executable AML that may be part of the
* declaration of these objects: * declaration of these objects: operation_regions, buffer_fields,
* operation_regions, buffer_fields, Buffers, and Packages. * bank_fields, Buffers, and Packages.
*/ */
if (!(flags & ACPI_NO_OBJECT_INIT)) { if (!(flags & ACPI_NO_OBJECT_INIT)) {
status = acpi_ns_initialize_objects(); status = acpi_ns_initialize_objects();
...@@ -223,6 +229,7 @@ acpi_status ACPI_INIT_FUNCTION acpi_initialize_objects(u32 flags) ...@@ -223,6 +229,7 @@ acpi_status ACPI_INIT_FUNCTION acpi_initialize_objects(u32 flags)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
} }
#endif
/* /*
* Initialize all device/region objects in the namespace. This runs * Initialize all device/region objects in the namespace. This runs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment