aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/uteval.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-05-26 16:36:00 -0400
committerLen Brown <len.brown@intel.com>2006-06-14 02:44:35 -0400
commit4119532c95547821dbe72d6916dfa1b2148475b3 (patch)
tree564eb8f69924fb7dc72e93526faf1547acac7d30 /drivers/acpi/utilities/uteval.c
parentb8d35192c55fb055792ff0641408eaaec7c88988 (diff)
ACPI: ACPICA 20060526
Restructured, flattened, and simplified the internal interfaces for namespace object evaluation - resulting in smaller code, less CPU stack use, and fewer interfaces. (With assistance from Mikhail Kouzmich) Fixed a problem with the CopyObject operator where the first parameter was not typed correctly for the parser, interpreter, compiler, and disassembler. Caused various errors and unexpected behavior. Fixed a problem where a ShiftLeft or ShiftRight of more than 64 bits produced incorrect results with some C compilers. Since the behavior of C compilers when the shift value is larger than the datatype width is apparently not well defined, the interpreter now detects this condition and simply returns zero as expected in all such cases. (BZ 395) Fixed problem reports (Valery Podrezov) integrated: - Update String-to-Integer conversion to match ACPI 3.0A spec http://bugzilla.kernel.org/show_bug.cgi?id=5329 Allow interpreter to handle nested method declarations http://bugzilla.kernel.org/show_bug.cgi?id=5361 Fixed problem reports (Fiodor Suietov) integrated: - acpi_terminate() doesn't free debug memory allocation list objects (BZ 355) - After Core Subsystem shutdown, acpi_subsystem_status() returns AE_OK (BZ 356) - acpi_os_unmap_memory() for RSDP can be invoked inconsistently (BZ 357) - Resource Manager should return AE_TYPE for non-device objects (BZ 358) - Incomplete cleanup branch in AcpiNsEvaluateRelative (BZ 359) - Use acpi_os_free() instead of ACPI_FREE in acpi_rs_set_srs_method_data (BZ 360) - Incomplete cleanup branch in acpi_ps_parse_aml (BZ 361) - Incomplete cleanup branch in acpi_ds_delete_walk_state (BZ 362) - acpi_get_table_header returns AE_NO_ACPI_TABLES until DSDT is loaded (BZ 365) - Status of the Global Initialization Handler call not used (BZ 366) - Incorrect object parameter to Global Initialization Handler (BZ 367) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities/uteval.c')
-rw-r--r--drivers/acpi/utilities/uteval.c45
1 files changed, 28 insertions, 17 deletions
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index 444d3a502c46..d6d7121583c0 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -181,19 +181,26 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
181 u32 expected_return_btypes, 181 u32 expected_return_btypes,
182 union acpi_operand_object **return_desc) 182 union acpi_operand_object **return_desc)
183{ 183{
184 struct acpi_parameter_info info; 184 struct acpi_evaluate_info *info;
185 acpi_status status; 185 acpi_status status;
186 u32 return_btype; 186 u32 return_btype;
187 187
188 ACPI_FUNCTION_TRACE(ut_evaluate_object); 188 ACPI_FUNCTION_TRACE(ut_evaluate_object);
189 189
190 info.node = prefix_node; 190 /* Allocate the evaluation information block */
191 info.parameters = NULL; 191
192 info.parameter_type = ACPI_PARAM_ARGS; 192 info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
193 if (!info) {
194 return_ACPI_STATUS(AE_NO_MEMORY);
195 }
196
197 info->prefix_node = prefix_node;
198 info->pathname = path;
199 info->parameter_type = ACPI_PARAM_ARGS;
193 200
194 /* Evaluate the object/method */ 201 /* Evaluate the object/method */
195 202
196 status = acpi_ns_evaluate_relative(path, &info); 203 status = acpi_ns_evaluate(info);
197 if (ACPI_FAILURE(status)) { 204 if (ACPI_FAILURE(status)) {
198 if (status == AE_NOT_FOUND) { 205 if (status == AE_NOT_FOUND) {
199 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 206 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
@@ -205,25 +212,25 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
205 prefix_node, path, status); 212 prefix_node, path, status);
206 } 213 }
207 214
208 return_ACPI_STATUS(status); 215 goto cleanup;
209 } 216 }
210 217
211 /* Did we get a return object? */ 218 /* Did we get a return object? */
212 219
213 if (!info.return_object) { 220 if (!info->return_object) {
214 if (expected_return_btypes) { 221 if (expected_return_btypes) {
215 ACPI_ERROR_METHOD("No object was returned from", 222 ACPI_ERROR_METHOD("No object was returned from",
216 prefix_node, path, AE_NOT_EXIST); 223 prefix_node, path, AE_NOT_EXIST);
217 224
218 return_ACPI_STATUS(AE_NOT_EXIST); 225 status = AE_NOT_EXIST;
219 } 226 }
220 227
221 return_ACPI_STATUS(AE_OK); 228 goto cleanup;
222 } 229 }
223 230
224 /* Map the return object type to the bitmapped type */ 231 /* Map the return object type to the bitmapped type */
225 232
226 switch (ACPI_GET_OBJECT_TYPE(info.return_object)) { 233 switch (ACPI_GET_OBJECT_TYPE(info->return_object)) {
227 case ACPI_TYPE_INTEGER: 234 case ACPI_TYPE_INTEGER:
228 return_btype = ACPI_BTYPE_INTEGER; 235 return_btype = ACPI_BTYPE_INTEGER;
229 break; 236 break;
@@ -251,8 +258,8 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
251 * happen frequently if the "implicit return" feature is enabled. 258 * happen frequently if the "implicit return" feature is enabled.
252 * Just delete the return object and return AE_OK. 259 * Just delete the return object and return AE_OK.
253 */ 260 */
254 acpi_ut_remove_reference(info.return_object); 261 acpi_ut_remove_reference(info->return_object);
255 return_ACPI_STATUS(AE_OK); 262 goto cleanup;
256 } 263 }
257 264
258 /* Is the return object one of the expected types? */ 265 /* Is the return object one of the expected types? */
@@ -264,19 +271,23 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
264 ACPI_ERROR((AE_INFO, 271 ACPI_ERROR((AE_INFO,
265 "Type returned from %s was incorrect: %s, expected Btypes: %X", 272 "Type returned from %s was incorrect: %s, expected Btypes: %X",
266 path, 273 path,
267 acpi_ut_get_object_type_name(info.return_object), 274 acpi_ut_get_object_type_name(info->return_object),
268 expected_return_btypes)); 275 expected_return_btypes));
269 276
270 /* On error exit, we must delete the return object */ 277 /* On error exit, we must delete the return object */
271 278
272 acpi_ut_remove_reference(info.return_object); 279 acpi_ut_remove_reference(info->return_object);
273 return_ACPI_STATUS(AE_TYPE); 280 status = AE_TYPE;
281 goto cleanup;
274 } 282 }
275 283
276 /* Object type is OK, return it */ 284 /* Object type is OK, return it */
277 285
278 *return_desc = info.return_object; 286 *return_desc = info->return_object;
279 return_ACPI_STATUS(AE_OK); 287
288 cleanup:
289 ACPI_FREE(info);
290 return_ACPI_STATUS(status);
280} 291}
281 292
282/******************************************************************************* 293/*******************************************************************************