Commit f9f4601f authored by Robert Moore's avatar Robert Moore Committed by Len Brown

ACPICA 20050708 from Bob Moore <robert.moore@intel.com>

The use of the CPU stack in the debug version of the
subsystem has been considerably reduced.  Previously, a
debug structure was declared in every function that used
the debug macros.  This structure has been removed in
favor of declaring the individual elements as parameters
to the debug functions.  This reduces the cumulative stack
use during nested execution of ACPI function calls at the
cost of a small increase in the code size of the debug
version of the subsystem.  With assistance from Alexey
Starikovskiy and Len Brown.

Added the ACPI_GET_FUNCTION_NAME macro to enable the
compiler-dependent headers to define a macro that will
return the current function name at runtime (such as
__FUNCTION__ or _func_, etc.) The function name is used
by the debug trace output.  If ACPI_GET_FUNCTION_NAME
is not defined in the compiler-dependent header, the
function name is saved on the CPU stack (one pointer per
function.) This mechanism is used because apparently there
exists no standard ANSI-C defined macro that that returns
the function name.

Alexey Starikovskiy redesigned and reimplemented the
"Owner ID" mechanism used to track namespace objects
created/deleted by ACPI tables and control method
execution.  A bitmap is now used to allocate and free the
IDs, thus solving the wraparound problem present in the
previous implementation.  The size of the namespace node
descriptor was reduced by 2 bytes as a result.

Removed the UINT32_BIT and UINT16_BIT types that were used
for the bitfield flag definitions within the headers for
the predefined ACPI tables.  These have been replaced by
UINT8_BIT in order to increase the code portability of
the subsystem.  If the use of UINT8 remains a problem,
we may be forced to eliminate bitfields entirely because
of a lack of portability.

Alexey Starikovksiy enhanced the performance of
acpi_ut_update_object_reference.  This is a frequently used
function and this improvement increases the performance
of the entire subsystem.

Alexey Starikovskiy fixed several possible memory leaks
and the inverse - premature object deletion.
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 4c3ffbd7
......@@ -99,7 +99,7 @@ acpi_ds_init_one_object (
* was just loaded
*/
if (((struct acpi_namespace_node *) obj_handle)->owner_id !=
info->table_desc->table_id) {
info->table_desc->owner_id) {
return (AE_OK);
}
......@@ -168,7 +168,7 @@ acpi_ds_init_one_object (
*/
acpi_ns_delete_namespace_subtree (obj_handle);
acpi_ns_delete_namespace_by_owner (
((struct acpi_namespace_node *) obj_handle)->object->method.owning_id);
((struct acpi_namespace_node *) obj_handle)->object->method.owner_id);
break;
......@@ -237,7 +237,7 @@ acpi_ds_initialize_objects (
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
"\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
table_desc->pointer->signature, table_desc->table_id, info.object_count,
table_desc->pointer->signature, table_desc->owner_id, info.object_count,
info.device_count, info.method_count, info.op_region_count));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
......
......@@ -77,7 +77,6 @@ acpi_ds_parse_method (
union acpi_operand_object *obj_desc;
union acpi_parse_object *op;
struct acpi_namespace_node *node;
acpi_owner_id owner_id;
struct acpi_walk_state *walk_state;
......@@ -132,15 +131,18 @@ acpi_ds_parse_method (
* objects (such as Operation Regions) can be created during the
* first pass parse.
*/
owner_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD);
obj_desc->method.owning_id = owner_id;
status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
/* Create and initialize a new walk state */
walk_state = acpi_ds_create_walk_state (owner_id, NULL, NULL, NULL);
walk_state = acpi_ds_create_walk_state (
obj_desc->method.owner_id, NULL, NULL, NULL);
if (!walk_state) {
status = AE_NO_MEMORY;
goto cleanup;
goto cleanup2;
}
status = acpi_ds_init_aml_walk (walk_state, op, node,
......@@ -148,7 +150,7 @@ acpi_ds_parse_method (
obj_desc->method.aml_length, NULL, 1);
if (ACPI_FAILURE (status)) {
acpi_ds_delete_walk_state (walk_state);
goto cleanup;
goto cleanup2;
}
/*
......@@ -162,13 +164,16 @@ acpi_ds_parse_method (
*/
status = acpi_ps_parse_aml (walk_state);
if (ACPI_FAILURE (status)) {
goto cleanup;
goto cleanup2;
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
acpi_ut_get_node_name (obj_handle), obj_handle, op));
cleanup2:
(void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
cleanup:
acpi_ps_delete_parse_tree (op);
return_ACPI_STATUS (status);
......@@ -265,7 +270,7 @@ acpi_ds_call_control_method (
{
acpi_status status;
struct acpi_namespace_node *method_node;
struct acpi_walk_state *next_walk_state;
struct acpi_walk_state *next_walk_state = NULL;
union acpi_operand_object *obj_desc;
struct acpi_parameter_info info;
u32 i;
......@@ -289,20 +294,23 @@ acpi_ds_call_control_method (
return_ACPI_STATUS (AE_NULL_OBJECT);
}
obj_desc->method.owning_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD);
status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Init for new method, wait on concurrency semaphore */
status = acpi_ds_begin_method_execution (method_node, obj_desc,
this_walk_state->method_node);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
goto cleanup;
}
if (!(obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY)) {
/* 1) Parse: Create a new walk state for the preempting walk */
next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
op, obj_desc, NULL);
if (!next_walk_state) {
return_ACPI_STATUS (AE_NO_MEMORY);
......@@ -332,7 +340,7 @@ acpi_ds_call_control_method (
/* 2) Execute: Create a new state for the preempting walk */
next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
NULL, obj_desc, thread);
if (!next_walk_state) {
status = AE_NO_MEMORY;
......@@ -383,6 +391,7 @@ acpi_ds_call_control_method (
/* On error, we must delete the new walk state */
cleanup:
(void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
if (next_walk_state && (next_walk_state->method_desc)) {
/* Decrement the thread count on the method parse tree */
......@@ -584,7 +593,7 @@ acpi_ds_terminate_control_method (
* Delete any namespace entries created anywhere else within
* the namespace
*/
acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owning_id);
acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owner_id);
status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
......
......@@ -487,7 +487,7 @@ acpi_ex_unload_table (
* Delete the entire namespace under this table Node
* (Offset contains the table_id)
*/
acpi_ns_delete_namespace_by_owner (table_info->table_id);
acpi_ns_delete_namespace_by_owner (table_info->owner_id);
/* Delete the table itself */
......
......@@ -819,7 +819,7 @@ acpi_ex_dump_object_descriptor (
acpi_ex_out_integer ("param_count", obj_desc->method.param_count);
acpi_ex_out_integer ("Concurrency", obj_desc->method.concurrency);
acpi_ex_out_pointer ("Semaphore", obj_desc->method.semaphore);
acpi_ex_out_integer ("owning_id", obj_desc->method.owning_id);
acpi_ex_out_integer ("owner_id", obj_desc->method.owner_id);
acpi_ex_out_integer ("aml_length", obj_desc->method.aml_length);
acpi_ex_out_pointer ("aml_start", obj_desc->method.aml_start);
break;
......
......@@ -904,6 +904,7 @@ acpi_ex_opcode_1A_0T_1R (
*/
return_desc = acpi_ns_get_attached_object (
(struct acpi_namespace_node *) operand[0]);
acpi_ut_add_reference (return_desc);
}
else {
/*
......@@ -953,20 +954,10 @@ acpi_ex_opcode_1A_0T_1R (
* add another reference to the referenced object, however.
*/
return_desc = *(operand[0]->reference.where);
if (!return_desc) {
/*
* We can't return a NULL dereferenced value. This is
* an uninitialized package element and is thus a
* severe error.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"NULL package element obj %p\n",
operand[0]));
status = AE_AML_UNINITIALIZED_ELEMENT;
goto cleanup;
if (return_desc) {
acpi_ut_add_reference (return_desc);
}
acpi_ut_add_reference (return_desc);
break;
......
......@@ -426,6 +426,10 @@ acpi_ex_resolve_operands (
return_ACPI_STATUS (status);
}
if (obj_desc != *stack_ptr) {
acpi_ut_remove_reference (obj_desc);
}
goto next_operand;
......@@ -448,6 +452,10 @@ acpi_ex_resolve_operands (
return_ACPI_STATUS (status);
}
if (obj_desc != *stack_ptr) {
acpi_ut_remove_reference (obj_desc);
}
goto next_operand;
......@@ -471,6 +479,10 @@ acpi_ex_resolve_operands (
return_ACPI_STATUS (status);
}
if (obj_desc != *stack_ptr) {
acpi_ut_remove_reference (obj_desc);
}
goto next_operand;
......@@ -515,6 +527,10 @@ acpi_ex_resolve_operands (
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
if (obj_desc != *stack_ptr) {
acpi_ut_remove_reference (obj_desc);
}
break;
default:
......
......@@ -163,7 +163,7 @@ acpi_ns_root_initialize (
/*
* i_aSL Compiler cheats by putting parameter count
* in the owner_iD
* in the owner_iD (param_count max is 7)
*/
new_node->owner_id = obj_desc->method.param_count;
#else
......
......@@ -190,7 +190,7 @@ acpi_ns_install_node (
struct acpi_namespace_node *node, /* New Child*/
acpi_object_type type)
{
u16 owner_id = 0;
acpi_owner_id owner_id = 0;
struct acpi_namespace_node *child_node;
#ifdef ACPI_ALPHABETIC_NAMESPACE
......@@ -559,7 +559,7 @@ acpi_ns_remove_reference (
void
acpi_ns_delete_namespace_by_owner (
u16 owner_id)
acpi_owner_id owner_id)
{
struct acpi_namespace_node *child_node;
struct acpi_namespace_node *deletion_node;
......@@ -635,6 +635,7 @@ acpi_ns_delete_namespace_by_owner (
}
}
(void) acpi_ut_release_owner_id (owner_id);
return_VOID;
}
......
......@@ -203,7 +203,7 @@ acpi_ns_dump_one_object (
/* Check if the owner matches */
if ((info->owner_id != ACPI_UINT32_MAX) &&
if ((info->owner_id != ACPI_OWNER_ID_MAX) &&
(info->owner_id != this_node->owner_id)) {
return (AE_OK);
}
......@@ -598,7 +598,7 @@ acpi_ns_dump_objects (
acpi_object_type type,
u8 display_type,
u32 max_depth,
u32 owner_id,
acpi_owner_id owner_id,
acpi_handle start_handle)
{
struct acpi_walk_info info;
......@@ -643,7 +643,7 @@ acpi_ns_dump_entry (
info.debug_level = debug_level;
info.owner_id = ACPI_UINT32_MAX;
info.owner_id = ACPI_OWNER_ID_MAX;
info.display_type = ACPI_DISPLAY_SUMMARY;
(void) acpi_ns_dump_one_object (handle, 1, &info, NULL);
......@@ -694,7 +694,7 @@ acpi_ns_dump_tables (
}
acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth,
ACPI_UINT32_MAX, search_handle);
ACPI_OWNER_ID_MAX, search_handle);
return_VOID;
}
#endif /* _ACPI_ASL_COMPILER */
......
......@@ -87,7 +87,7 @@ acpi_ns_one_complete_parse (
/* Create and initialize a new walk state */
walk_state = acpi_ds_create_walk_state (table_desc->table_id,
walk_state = acpi_ds_create_walk_state (table_desc->owner_id,
NULL, NULL, NULL);
if (!walk_state) {
acpi_ps_free_op (parse_root);
......
......@@ -407,9 +407,14 @@ acpi_ps_parse_loop (
INCREMENT_ARG_LIST (walk_state->arg_types);
}
/* Special processing for certain opcodes */
if ((walk_state->pass_number <= ACPI_IMODE_LOAD_PASS1) &&
/* TBD (remove): Temporary mechanism to disable this code if needed */
#ifndef ACPI_NO_MODULE_LEVEL_CODE
if ((walk_state->pass_number <= ACPI_IMODE_LOAD_PASS1) &&
((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) == 0)) {
/*
* We want to skip If/Else/While constructs during Pass1
......@@ -434,7 +439,7 @@ acpi_ps_parse_loop (
break;
}
}
#endif
switch (op->common.aml_opcode) {
case AML_METHOD_OP:
......
......@@ -138,11 +138,14 @@ acpi_psx_execute (
* objects (such as Operation Regions) can be created during the
* first pass parse.
*/
obj_desc->method.owning_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD);
status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
if (ACPI_FAILURE (status)) {
goto cleanup2;
}
/* Create and initialize a new walk state */
walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
NULL, NULL, NULL);
if (!walk_state) {
status = AE_NO_MEMORY;
......
......@@ -251,6 +251,7 @@ acpi_tb_init_table_descriptor (
{
struct acpi_table_list *list_head;
struct acpi_table_desc *table_desc;
acpi_status status;
ACPI_FUNCTION_TRACE_U32 ("tb_init_table_descriptor", table_type);
......@@ -263,6 +264,13 @@ acpi_tb_init_table_descriptor (
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Get a new owner ID for the table */
status = acpi_ut_allocate_owner_id (&table_desc->owner_id);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Install the table into the global data structure */
list_head = &acpi_gbl_table_lists[table_type];
......@@ -325,8 +333,6 @@ acpi_tb_init_table_descriptor (
table_desc->aml_start = (u8 *) (table_desc->pointer + 1),
table_desc->aml_length = (u32) (table_desc->length -
(u32) sizeof (struct acpi_table_header));
table_desc->table_id = acpi_ut_allocate_owner_id (
ACPI_OWNER_TYPE_TABLE);
table_desc->loaded_into_namespace = FALSE;
/*
......@@ -339,7 +345,7 @@ acpi_tb_init_table_descriptor (
/* Return Data */
table_info->table_id = table_desc->table_id;
table_info->owner_id = table_desc->owner_id;
table_info->installed_desc = table_desc;
return_ACPI_STATUS (AE_OK);
......
......@@ -96,32 +96,13 @@ acpi_tb_verify_rsdp (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/*
* The signature and checksum must both be correct
*/
if (ACPI_STRNCMP ((char *) rsdp, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) {
/* Nope, BAD Signature */
status = AE_BAD_SIGNATURE;
goto cleanup;
}
/* Check the standard checksum */
/* Verify RSDP signature and checksum */
if (acpi_tb_checksum (rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
status = AE_BAD_CHECKSUM;
status = acpi_tb_validate_rsdp (rsdp);
if (ACPI_FAILURE (status)) {
goto cleanup;
}
/* Check extended checksum if table version >= 2 */
if (rsdp->revision >= 2) {
if (acpi_tb_checksum (rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0) {
status = AE_BAD_CHECKSUM;
goto cleanup;
}
}
/* The RSDP supplied is OK */
table_info.pointer = ACPI_CAST_PTR (struct acpi_table_header, rsdp);
......
......@@ -260,8 +260,7 @@ acpi_unload_table (
* "Scope" operator. Thus, we need to track ownership by an ID, not
* simply a position within the hierarchy
*/
acpi_ns_delete_namespace_by_owner (table_desc->table_id);
acpi_ns_delete_namespace_by_owner (table_desc->owner_id);
table_desc = table_desc->next;
}
......
......@@ -63,6 +63,51 @@ acpi_tb_scan_memory_for_rsdp (
u32 length);
/*******************************************************************************
*
* FUNCTION: acpi_tb_validate_rsdp
*
* PARAMETERS: Rsdp - Pointer to unvalidated RSDP
*
* RETURN: Status
*
* DESCRIPTION: Validate the RSDP (ptr)
*
******************************************************************************/
acpi_status
acpi_tb_validate_rsdp (
struct rsdp_descriptor *rsdp)
{
ACPI_FUNCTION_ENTRY ();
/*
* The signature and checksum must both be correct
*/
if (ACPI_STRNCMP ((char *) rsdp, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) {
/* Nope, BAD Signature */
return (AE_BAD_SIGNATURE);
}
/* Check the standard checksum */
if (acpi_tb_checksum (rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
return (AE_BAD_CHECKSUM);
}
/* Check extended checksum if table version >= 2 */
if ((rsdp->revision >= 2) &&
(acpi_tb_checksum (rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)) {
return (AE_BAD_CHECKSUM);
}
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: acpi_tb_find_table
......@@ -218,19 +263,11 @@ acpi_get_firmware_table (
acpi_gbl_RSDP = address.pointer.logical;
}
/* The signature and checksum must both be correct */
if (ACPI_STRNCMP ((char *) acpi_gbl_RSDP, RSDP_SIG,
sizeof (RSDP_SIG)-1) != 0) {
/* Nope, BAD Signature */
/* The RDSP signature and checksum must both be correct */
return_ACPI_STATUS (AE_BAD_SIGNATURE);
}
if (acpi_tb_checksum (acpi_gbl_RSDP, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
/* Nope, BAD Checksum */
return_ACPI_STATUS (AE_BAD_CHECKSUM);
status = acpi_tb_validate_rsdp (acpi_gbl_RSDP);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
}
......@@ -414,9 +451,9 @@ acpi_tb_scan_memory_for_rsdp (
u8 *start_address,
u32 length)
{
acpi_status status;
u8 *mem_rover;
u8 *end_address;
u8 checksum;
ACPI_FUNCTION_TRACE ("tb_scan_memory_for_rsdp");
......@@ -428,45 +465,25 @@ acpi_tb_scan_memory_for_rsdp (
for (mem_rover = start_address; mem_rover < end_address;
mem_rover += ACPI_RSDP_SCAN_STEP) {
/* The signature and checksum must both be correct */
/* The RSDP signature and checksum must both be correct */
if (ACPI_STRNCMP ((char *) mem_rover,
RSDP_SIG, sizeof (RSDP_SIG) - 1) != 0) {
/* No signature match, keep looking */
continue;
}
/* Signature matches, check the appropriate checksum */
if ((ACPI_CAST_PTR (struct rsdp_descriptor, mem_rover))->revision < 2) {
/* ACPI version 1.0 */
checksum = acpi_tb_checksum (mem_rover, ACPI_RSDP_CHECKSUM_LENGTH);
}
else {
/* Post ACPI 1.0, use extended_checksum */
checksum = acpi_tb_checksum (mem_rover, ACPI_RSDP_XCHECKSUM_LENGTH);
}
if (checksum == 0) {
/* Checksum valid, we have found a valid RSDP */
status = acpi_tb_validate_rsdp (ACPI_CAST_PTR (struct rsdp_descriptor, mem_rover));
if (ACPI_SUCCESS (status)) {
/* Sig and checksum valid, we have found a real RSDP */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"RSDP located at physical address %p\n", mem_rover));
return_PTR (mem_rover);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Found an RSDP at physical address %p, but it has a bad checksum\n",
mem_rover));
/* No sig match or bad checksum, keep searching */
}
/* Searched entire block, no RSDP was found */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Searched entire block, no valid RSDP was found.\n"));
"Searched entire block from %p, valid RSDP was not found\n",
start_address));
return_PTR (NULL);
}
......@@ -554,7 +571,7 @@ acpi_tb_find_rsdp (
acpi_os_unmap_memory (table_ptr, ACPI_EBDA_WINDOW_SIZE);
if (mem_rover) {
/* Found it, return the physical address */
/* Return the physical address */
physical_address += ACPI_PTR_DIFF (mem_rover, table_ptr);
......@@ -583,7 +600,7 @@ acpi_tb_find_rsdp (
acpi_os_unmap_memory (table_ptr, ACPI_HI_RSDP_WINDOW_SIZE);
if (mem_rover) {
/* Found it, return the physical address */
/* Return the physical address */
physical_address =
ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF (mem_rover, table_ptr);
......@@ -614,7 +631,7 @@ acpi_tb_find_rsdp (
ACPI_PHYSADDR_TO_PTR (physical_address),
ACPI_EBDA_WINDOW_SIZE);
if (mem_rover) {
/* Found it, return the physical address */
/* Return the physical address */
table_info->physical_address = ACPI_TO_INTEGER (mem_rover);
return_ACPI_STATUS (AE_OK);
......@@ -634,8 +651,9 @@ acpi_tb_find_rsdp (
}
}
/* RSDP signature was not found */
/* A valid RSDP was not found */
ACPI_REPORT_ERROR (("No valid RSDP was found\n"));
return_ACPI_STATUS (AE_NOT_FOUND);
}
......
......@@ -74,6 +74,9 @@ acpi_os_create_cache (
struct acpi_memory_list *cache;
ACPI_FUNCTION_ENTRY ();
if (!cache_name || !return_cache || (object_size < 16)) {
return (AE_BAD_PARAMETER);
}
......@@ -161,7 +164,10 @@ acpi_os_delete_cache (
acpi_status status;
/* Purge all objects in the cache */
ACPI_FUNCTION_ENTRY ();
/* Purge all objects in the cache */
status = acpi_os_purge_cache (cache);
if (ACPI_FAILURE (status)) {
......@@ -259,7 +265,7 @@ acpi_os_acquire_object (
void *object;
ACPI_FUNCTION_NAME ("ut_acquire_from_cache");
ACPI_FUNCTION_NAME ("os_acquire_object");
if (!cache) {
......@@ -286,7 +292,7 @@ acpi_os_acquire_object (
ACPI_MEM_TRACKING (cache->hits++);
ACPI_MEM_TRACKING (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Object %p from %s\n", object, cache->list_name)));
"Object %p from %s cache\n", object, cache->list_name)));
status = acpi_ut_release_mutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (status)) {
......
This diff is collapsed.
......@@ -435,35 +435,24 @@ acpi_ut_update_object_reference (
union acpi_operand_object *object,
u16 action)
{
acpi_status status;
u32 i;
union acpi_generic_state *state_list = NULL;
union acpi_generic_state *state;
acpi_status status = AE_OK;
union acpi_generic_state *state_list = NULL;
union acpi_operand_object *next_object = NULL;
union acpi_generic_state *state;
acpi_native_uint i;
ACPI_FUNCTION_TRACE_PTR ("ut_update_object_reference", object);
/* Ignore a null object ptr */
while (object) {
/* Make sure that this isn't a namespace handle */
if (!object) {
return_ACPI_STATUS (AE_OK);
}
/* Make sure that this isn't a namespace handle */
if (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) {
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
"Object %p is NS handle\n", object));
return_ACPI_STATUS (AE_OK);
}
state = acpi_ut_create_update_state (object, action);
while (state) {
object = state->update.object;
action = state->update.value;
acpi_ut_delete_generic_state (state);
if (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) {
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
"Object %p is NS handle\n", object));
return_ACPI_STATUS (AE_OK);
}
/*
* All sub-objects must have their reference count incremented also.
......@@ -476,12 +465,10 @@ acpi_ut_update_object_reference (
acpi_ut_update_ref_count (object->device.device_notify, action);
break;
case ACPI_TYPE_PACKAGE:
/*
* We must update all the sub-objects of the package
* (Each of whom may have their own sub-objects, etc.
* We must update all the sub-objects of the package,
* each of whom may have their own sub-objects.
*/
for (i = 0; i < object->package.count; i++) {
/*
......@@ -497,35 +484,19 @@ acpi_ut_update_object_reference (
}
break;
case ACPI_TYPE_BUFFER_FIELD:
status = acpi_ut_create_update_state_and_push (