aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/dispatcher/dsmethod.c
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-07-29 15:15:00 -0700
committerLen Brown <len.brown@intel.com>2005-07-30 00:51:39 -0400
commit0c9938cc75057c0fca1af55a55dcfc2842436695 (patch)
treed18e809bf9e3811f20c609b6515d4d1b8520cfbc /drivers/acpi/dispatcher/dsmethod.c
parentdd8f39bbf5154cdbfd698fc70c66faba33eafa44 (diff)
[ACPI] ACPICA 20050729 from Bob Moore
Implemented support to ignore an attempt to install/load a particular ACPI table more than once. Apparently there exists BIOS code that repeatedly attempts to load the same SSDT upon certain events. Thanks to Venkatesh Pallipadi. Restructured the main interface to the AML parser in order to correctly handle all exceptional conditions. This will prevent leakage of the OwnerId resource and should eliminate the AE_OWNER_ID_LIMIT exceptions seen on some machines. Thanks to Alexey Starikovskiy. Support for "module level code" has been disabled in this version due to a number of issues that have appeared on various machines. The support can be enabled by defining ACPI_ENABLE_MODULE_LEVEL_CODE during subsystem compilation. When the issues are fully resolved, the code will be enabled by default again. Modified the internal functions for debug print support to define the FunctionName parameter as a (const char *) for compatibility with compiler built-in macros such as __FUNCTION__, etc. Linted the entire ACPICA source tree for both 32-bit and 64-bit. Signed-off-by: Robert Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/dispatcher/dsmethod.c')
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index 1b90813cbde..e344c06ed33 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -58,12 +58,11 @@
*
* FUNCTION: acpi_ds_parse_method
*
- * PARAMETERS: obj_handle - Method node
+ * PARAMETERS: Node - Method node
*
* RETURN: Status
*
- * DESCRIPTION: Call the parser and parse the AML that is associated with the
- * method.
+ * DESCRIPTION: Parse the AML that is associated with the method.
*
* MUTEX: Assumes parser is locked
*
@@ -71,30 +70,28 @@
acpi_status
acpi_ds_parse_method (
- acpi_handle obj_handle)
+ struct acpi_namespace_node *node)
{
acpi_status status;
union acpi_operand_object *obj_desc;
union acpi_parse_object *op;
- struct acpi_namespace_node *node;
struct acpi_walk_state *walk_state;
- ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", obj_handle);
+ ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", node);
/* Parameter Validation */
- if (!obj_handle) {
+ if (!node) {
return_ACPI_STATUS (AE_NULL_ENTRY);
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** named_obj=%p\n",
- acpi_ut_get_node_name (obj_handle), obj_handle));
+ acpi_ut_get_node_name (node), node));
/* Extract the method object from the method Node */
- node = (struct acpi_namespace_node *) obj_handle;
obj_desc = acpi_ns_get_attached_object (node);
if (!obj_desc) {
return_ACPI_STATUS (AE_NULL_OBJECT);
@@ -169,10 +166,18 @@ acpi_ds_parse_method (
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));
+ acpi_ut_get_node_name (node), node, op));
+
+ /*
+ * Delete the parse tree. We simply re-parse the method for every
+ * execution since there isn't much overhead (compared to keeping lots
+ * of parse trees around)
+ */
+ acpi_ns_delete_namespace_subtree (node);
+ acpi_ns_delete_namespace_by_owner (obj_desc->method.owner_id);
cleanup2:
- (void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
+ acpi_ut_release_owner_id (&obj_desc->method.owner_id);
cleanup:
acpi_ps_delete_parse_tree (op);
@@ -391,7 +396,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);
+ 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 */
@@ -563,8 +568,7 @@ acpi_ds_terminate_control_method (
*/
if ((walk_state->method_desc->method.concurrency == 1) &&
(!walk_state->method_desc->method.semaphore)) {
- status = acpi_os_create_semaphore (1,
- 1,
+ status = acpi_os_create_semaphore (1, 1,
&walk_state->method_desc->method.semaphore);
}
@@ -595,6 +599,8 @@ acpi_ds_terminate_control_method (
*/
acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owner_id);
status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+ acpi_ut_release_owner_id (&walk_state->method_desc->method.owner_id);
+
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}