/******************************************************************************* * * FUNCTION: acpi_ut_evaluate_object * * PARAMETERS: prefix_node - Starting node * path - Path to object from starting node * expected_return_types - Bitmap of allowed return types * return_desc - Where a return value is stored * * RETURN: Status * * DESCRIPTION: Evaluates a namespace object and verifies the type of the * return object. Common code that simplifies accessing objects * that have required return objects of fixed types. * * NOTE: Internal function, no parameter validation *
******************************************************************************/
status = acpi_ns_evaluate(info); if (ACPI_FAILURE(status)) { if (status == AE_NOT_FOUND) {
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s.%s] was not found\n",
acpi_ut_get_node_name(prefix_node),
path));
} else {
ACPI_ERROR_METHOD("Method execution failed",
prefix_node, path, status);
}
goto cleanup;
}
/* Did we get a return object? */
if (!info->return_object) { if (expected_return_btypes) {
ACPI_ERROR_METHOD("No object was returned from",
prefix_node, path, AE_NOT_EXIST);
status = AE_NOT_EXIST;
}
goto cleanup;
}
/* Map the return object type to the bitmapped type */
switch ((info->return_object)->common.type) { case ACPI_TYPE_INTEGER:
return_btype = ACPI_BTYPE_INTEGER; break;
case ACPI_TYPE_BUFFER:
return_btype = ACPI_BTYPE_BUFFER; break;
case ACPI_TYPE_STRING:
return_btype = ACPI_BTYPE_STRING; break;
case ACPI_TYPE_PACKAGE:
return_btype = ACPI_BTYPE_PACKAGE; break;
default:
return_btype = 0; break;
}
if ((acpi_gbl_enable_interpreter_slack) && (!expected_return_btypes)) { /* * We received a return object, but one was not expected. This can * happen frequently if the "implicit return" feature is enabled. * Just delete the return object and return AE_OK.
*/
acpi_ut_remove_reference(info->return_object); goto cleanup;
}
/* Is the return object one of the expected types? */
if (!(expected_return_btypes & return_btype)) {
ACPI_ERROR_METHOD("Return object type is incorrect",
prefix_node, path, AE_TYPE);
ACPI_ERROR((AE_INFO, "Type returned from %s was incorrect: %s, expected Btypes: 0x%X",
path,
acpi_ut_get_object_type_name(info->return_object),
expected_return_btypes));
/* On error exit, we must delete the return object */
acpi_ut_remove_reference(info->return_object);
status = AE_TYPE; goto cleanup;
}
/******************************************************************************* * * FUNCTION: acpi_ut_evaluate_numeric_object * * PARAMETERS: object_name - Object name to be evaluated * device_node - Node for the device * value - Where the value is returned * * RETURN: Status * * DESCRIPTION: Evaluates a numeric namespace object for a selected device * and stores result in *Value. * * NOTE: Internal function, no parameter validation *
******************************************************************************/
/******************************************************************************* * * FUNCTION: acpi_ut_execute_STA * * PARAMETERS: device_node - Node for the device * flags - Where the status flags are returned * * RETURN: Status * * DESCRIPTION: Executes _STA for selected device and stores results in * *Flags. If _STA does not exist, then the device is assumed * to be present/functional/enabled (as per the ACPI spec). * * NOTE: Internal function, no parameter validation *
******************************************************************************/
status = acpi_ut_evaluate_object(device_node, METHOD_NAME__STA,
ACPI_BTYPE_INTEGER, &obj_desc); if (ACPI_FAILURE(status)) { if (AE_NOT_FOUND == status) { /* * if _STA does not exist, then (as per the ACPI specification), * the returned flags will indicate that the device is present, * functional, and enabled.
*/
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "_STA on %4.4s was not found, assuming device is present\n",
acpi_ut_get_node_name(device_node)));
/******************************************************************************* * * FUNCTION: acpi_ut_execute_power_methods * * PARAMETERS: device_node - Node for the device * method_names - Array of power method names * method_count - Number of methods to execute * out_values - Where the power method values are returned * * RETURN: Status, out_values * * DESCRIPTION: Executes the specified power methods for the device and returns * the result(s). * * NOTE: Internal function, no parameter validation *
******************************************************************************/
for (i = 0; i < method_count; i++) { /* * Execute the power method (_sx_d or _sx_w). The only allowable * return type is an Integer.
*/
status = acpi_ut_evaluate_object(device_node,
ACPI_CAST_PTR(char,
method_names[i]),
ACPI_BTYPE_INTEGER, &obj_desc); if (ACPI_SUCCESS(status)) {
out_values[i] = (u8)obj_desc->integer.value;
/* Delete the return object */
acpi_ut_remove_reference(obj_desc);
final_status = AE_OK; /* At least one value is valid */ continue;
}
out_values[i] = ACPI_UINT8_MAX; if (status == AE_NOT_FOUND) { continue; /* Ignore if not found */
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.