Lines 110-115
acpi_evaluate_object_typed(acpi_handle h
Link Here
|
110 |
} |
110 |
} |
111 |
|
111 |
|
112 |
if (return_buffer->length == 0) { |
112 |
if (return_buffer->length == 0) { |
|
|
113 |
|
113 |
/* Error because caller specifically asked for a return value */ |
114 |
/* Error because caller specifically asked for a return value */ |
114 |
|
115 |
|
115 |
ACPI_ERROR((AE_INFO, "No return value")); |
116 |
ACPI_ERROR((AE_INFO, "No return value")); |
Lines 131-136
acpi_evaluate_object_typed(acpi_handle h
Link Here
|
131 |
acpi_ut_get_type_name(return_type))); |
132 |
acpi_ut_get_type_name(return_type))); |
132 |
|
133 |
|
133 |
if (must_free) { |
134 |
if (must_free) { |
|
|
135 |
|
134 |
/* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */ |
136 |
/* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */ |
135 |
|
137 |
|
136 |
acpi_os_free(return_buffer->pointer); |
138 |
acpi_os_free(return_buffer->pointer); |
Lines 224-232
acpi_evaluate_object(acpi_handle handle,
Link Here
|
224 |
* 3) Valid handle |
226 |
* 3) Valid handle |
225 |
*/ |
227 |
*/ |
226 |
if ((pathname) && (acpi_ns_valid_root_prefix(pathname[0]))) { |
228 |
if ((pathname) && (acpi_ns_valid_root_prefix(pathname[0]))) { |
227 |
/* |
229 |
|
228 |
* The path is fully qualified, just evaluate by name |
230 |
/* The path is fully qualified, just evaluate by name */ |
229 |
*/ |
231 |
|
230 |
status = acpi_ns_evaluate_by_name(pathname, &info); |
232 |
status = acpi_ns_evaluate_by_name(pathname, &info); |
231 |
} else if (!handle) { |
233 |
} else if (!handle) { |
232 |
/* |
234 |
/* |
Lines 235-245
acpi_evaluate_object(acpi_handle handle,
Link Here
|
235 |
* qualified names above, this is an error |
237 |
* qualified names above, this is an error |
236 |
*/ |
238 |
*/ |
237 |
if (!pathname) { |
239 |
if (!pathname) { |
238 |
ACPI_ERROR((AE_INFO, |
240 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
239 |
"Both Handle and Pathname are NULL")); |
241 |
"Both Handle and Pathname are NULL")); |
240 |
} else { |
242 |
} else { |
241 |
ACPI_ERROR((AE_INFO, |
243 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
242 |
"Handle is NULL and Pathname is relative")); |
244 |
"Null Handle with relative pathname [%s]", |
|
|
245 |
pathname)); |
243 |
} |
246 |
} |
244 |
|
247 |
|
245 |
status = AE_BAD_PARAMETER; |
248 |
status = AE_BAD_PARAMETER; |
Lines 256-264
acpi_evaluate_object(acpi_handle handle,
Link Here
|
256 |
*/ |
259 |
*/ |
257 |
status = acpi_ns_evaluate_by_handle(&info); |
260 |
status = acpi_ns_evaluate_by_handle(&info); |
258 |
} else { |
261 |
} else { |
259 |
/* |
262 |
/* Both a Handle and a relative Pathname */ |
260 |
* Both a Handle and a relative Pathname |
263 |
|
261 |
*/ |
|
|
262 |
status = acpi_ns_evaluate_relative(pathname, &info); |
264 |
status = acpi_ns_evaluate_relative(pathname, &info); |
263 |
} |
265 |
} |
264 |
} |
266 |
} |
Lines 295-300
acpi_evaluate_object(acpi_handle handle,
Link Here
|
295 |
acpi_ut_get_object_size(info.return_object, |
297 |
acpi_ut_get_object_size(info.return_object, |
296 |
&buffer_space_needed); |
298 |
&buffer_space_needed); |
297 |
if (ACPI_SUCCESS(status)) { |
299 |
if (ACPI_SUCCESS(status)) { |
|
|
300 |
|
298 |
/* Validate/Allocate/Clear caller buffer */ |
301 |
/* Validate/Allocate/Clear caller buffer */ |
299 |
|
302 |
|
300 |
status = |
303 |
status = |
Lines 303-309
acpi_evaluate_object(acpi_handle handle,
Link Here
|
303 |
buffer_space_needed); |
306 |
buffer_space_needed); |
304 |
if (ACPI_FAILURE(status)) { |
307 |
if (ACPI_FAILURE(status)) { |
305 |
/* |
308 |
/* |
306 |
* Caller's buffer is too small or a new one can't be allocated |
309 |
* Caller's buffer is too small or a new one can't |
|
|
310 |
* be allocated |
307 |
*/ |
311 |
*/ |
308 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
312 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
309 |
"Needed buffer size %X, %s\n", |
313 |
"Needed buffer size %X, %s\n", |
Lines 312-320
acpi_evaluate_object(acpi_handle handle,
Link Here
|
312 |
acpi_format_exception |
316 |
acpi_format_exception |
313 |
(status))); |
317 |
(status))); |
314 |
} else { |
318 |
} else { |
315 |
/* |
319 |
/* We have enough space for the object, build it */ |
316 |
* We have enough space for the object, build it |
320 |
|
317 |
*/ |
|
|
318 |
status = |
321 |
status = |
319 |
acpi_ut_copy_iobject_to_eobject |
322 |
acpi_ut_copy_iobject_to_eobject |
320 |
(info.return_object, |
323 |
(info.return_object, |
Lines 341-350
acpi_evaluate_object(acpi_handle handle,
Link Here
|
341 |
} |
344 |
} |
342 |
} |
345 |
} |
343 |
|
346 |
|
344 |
/* |
347 |
/* Free the input parameter list (if we created one) */ |
345 |
* Free the input parameter list (if we created one), |
348 |
|
346 |
*/ |
|
|
347 |
if (info.parameters) { |
349 |
if (info.parameters) { |
|
|
350 |
|
348 |
/* Free the allocated parameter block */ |
351 |
/* Free the allocated parameter block */ |
349 |
|
352 |
|
350 |
acpi_ut_delete_internal_object_list(info.parameters); |
353 |
acpi_ut_delete_internal_object_list(info.parameters); |
Lines 473-478
acpi_ns_get_device_callback(acpi_handle
Link Here
|
473 |
} |
476 |
} |
474 |
|
477 |
|
475 |
if (!(flags & ACPI_STA_DEVICE_PRESENT)) { |
478 |
if (!(flags & ACPI_STA_DEVICE_PRESENT)) { |
|
|
479 |
|
476 |
/* Don't examine children of the device if not present */ |
480 |
/* Don't examine children of the device if not present */ |
477 |
|
481 |
|
478 |
return (AE_CTRL_DEPTH); |
482 |
return (AE_CTRL_DEPTH); |
Lines 489-494
acpi_ns_get_device_callback(acpi_handle
Link Here
|
489 |
} |
493 |
} |
490 |
|
494 |
|
491 |
if (ACPI_STRNCMP(hid.value, info->hid, sizeof(hid.value)) != 0) { |
495 |
if (ACPI_STRNCMP(hid.value, info->hid, sizeof(hid.value)) != 0) { |
|
|
496 |
|
492 |
/* Get the list of Compatible IDs */ |
497 |
/* Get the list of Compatible IDs */ |
493 |
|
498 |
|
494 |
status = acpi_ut_execute_CID(node, &cid); |
499 |
status = acpi_ut_execute_CID(node, &cid); |
Lines 563-571
acpi_get_devices(char *HID,
Link Here
|
563 |
* We're going to call their callback from OUR callback, so we need |
568 |
* We're going to call their callback from OUR callback, so we need |
564 |
* to know what it is, and their context parameter. |
569 |
* to know what it is, and their context parameter. |
565 |
*/ |
570 |
*/ |
|
|
571 |
info.hid = HID; |
566 |
info.context = context; |
572 |
info.context = context; |
567 |
info.user_function = user_function; |
573 |
info.user_function = user_function; |
568 |
info.hid = HID; |
|
|
569 |
|
574 |
|
570 |
/* |
575 |
/* |
571 |
* Lock the namespace around the walk. |
576 |
* Lock the namespace around the walk. |
Lines 578-586
acpi_get_devices(char *HID,
Link Here
|
578 |
return_ACPI_STATUS(status); |
583 |
return_ACPI_STATUS(status); |
579 |
} |
584 |
} |
580 |
|
585 |
|
581 |
status = acpi_ns_walk_namespace(ACPI_TYPE_DEVICE, |
586 |
status = acpi_ns_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, |
582 |
ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, |
587 |
ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, |
583 |
ACPI_NS_WALK_UNLOCK, |
|
|
584 |
acpi_ns_get_device_callback, &info, |
588 |
acpi_ns_get_device_callback, &info, |
585 |
return_value); |
589 |
return_value); |
586 |
|
590 |
|