aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dsmethod.c
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-05-26 00:00:00 -0400
committerLen Brown <len.brown@intel.com>2005-07-13 16:46:34 -0400
commit88ac00f5a841dcfc5c682000f4a6add0add8caac (patch)
tree80dcff8323c6c79e8706f42eb4b7c3884bc03152 /drivers/acpi/dispatcher/dsmethod.c
parent6f42ccf2fc50ecee8ea170040627f268430c1648 (diff)
ACPICA 20050526 from Bob Moore <robert.moore@intel.com>
Implemented support to execute Type 1 and Type 2 AML opcodes appearing at the module level (not within a control method.) These opcodes are executed exactly once at the time the table is loaded. This type of code was legal up until the release of ACPI 2.0B (2002) and is now supported within ACPI CA in order to provide backwards compatibility with earlier BIOS implementations. This eliminates the "Encountered executable code at module level" warning that was previously generated upon detection of such code. Fixed a problem in the interpreter where an AE_NOT_FOUND exception could inadvertently be generated during the lookup of namespace objects in the second pass parse of ACPI tables and control methods. It appears that this problem could occur during the resolution of forward references to namespace objects. Added the ACPI_MUTEX_DEBUG #ifdef to the acpi_ut_release_mutex function, corresponding to the same the deadlock detection debug code to be compiled out in the normal case, improving mutex performance (and overall subsystem performance) considerably. As suggested by Alexey Starikovskiy. Implemented a handful of miscellaneous fixes for possible memory leaks on error conditions and error handling control paths. These fixes were suggested by FreeBSD and the Coverity Prevent source code analysis tool. Added a check for a null RSDT pointer in acpi_get_firmware_table (tbxfroot.c) to prevent a fault in this error case. Signed-off-by Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/dispatcher/dsmethod.c')
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index 9fc3f4c033eb..c9d9a6c45ae3 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -139,7 +139,8 @@ acpi_ds_parse_method (
139 139
140 walk_state = acpi_ds_create_walk_state (owner_id, NULL, NULL, NULL); 140 walk_state = acpi_ds_create_walk_state (owner_id, NULL, NULL, NULL);
141 if (!walk_state) { 141 if (!walk_state) {
142 return_ACPI_STATUS (AE_NO_MEMORY); 142 status = AE_NO_MEMORY;
143 goto cleanup;
143 } 144 }
144 145
145 status = acpi_ds_init_aml_walk (walk_state, op, node, 146 status = acpi_ds_init_aml_walk (walk_state, op, node,
@@ -147,7 +148,7 @@ acpi_ds_parse_method (
147 obj_desc->method.aml_length, NULL, 1); 148 obj_desc->method.aml_length, NULL, 1);
148 if (ACPI_FAILURE (status)) { 149 if (ACPI_FAILURE (status)) {
149 acpi_ds_delete_walk_state (walk_state); 150 acpi_ds_delete_walk_state (walk_state);
150 return_ACPI_STATUS (status); 151 goto cleanup;
151 } 152 }
152 153
153 /* 154 /*
@@ -161,13 +162,14 @@ acpi_ds_parse_method (
161 */ 162 */
162 status = acpi_ps_parse_aml (walk_state); 163 status = acpi_ps_parse_aml (walk_state);
163 if (ACPI_FAILURE (status)) { 164 if (ACPI_FAILURE (status)) {
164 return_ACPI_STATUS (status); 165 goto cleanup;
165 } 166 }
166 167
167 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, 168 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
168 "**** [%4.4s] Parsed **** named_obj=%p Op=%p\n", 169 "**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
169 acpi_ut_get_node_name (obj_handle), obj_handle, op)); 170 acpi_ut_get_node_name (obj_handle), obj_handle, op));
170 171
172cleanup:
171 acpi_ps_delete_parse_tree (op); 173 acpi_ps_delete_parse_tree (op);
172 return_ACPI_STATUS (status); 174 return_ACPI_STATUS (status);
173} 175}