summaryrefslogtreecommitdiff
path: root/drivers/acpi/executer
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-07-08 08:00:00 +0400
committerLen Brown <len.brown@intel.com>2005-07-14 08:42:23 +0400
commitf9f4601f331aa1226d7a798a01950efbb388f07f (patch)
tree62e079a9275749d16a4a0da56a427be201e15d27 /drivers/acpi/executer
parent4c3ffbd79529b680b3c3ef2b6f42f0c89c694ec5 (diff)
downloadlinux-f9f4601f331aa1226d7a798a01950efbb388f07f.tar.xz
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: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r--drivers/acpi/executer/exconfig.c2
-rw-r--r--drivers/acpi/executer/exdump.c2
-rw-r--r--drivers/acpi/executer/exoparg1.c15
-rw-r--r--drivers/acpi/executer/exresop.c16
4 files changed, 21 insertions, 14 deletions
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 8bfa6effaa0c..76c6ebd0231f 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -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 */
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index 7007abb6051e..6158f5193f4a 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -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;
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index 131f49acb1df..c1ba8b48228e 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -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;
diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c
index d8b470eefe7a..aaba7abcb52d 100644
--- a/drivers/acpi/executer/exresop.c
+++ b/drivers/acpi/executer/exresop.c
@@ -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: