if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) {
acpi_os_printf
("Address %p is not a valid namespace node [%s]\n",
node, acpi_ut_get_descriptor_name(node)); return (NULL);
}
} else { /* * Alpha argument: The parameter is a name string that must be * resolved to a Namespace object.
*/
node = acpi_db_local_ns_lookup(in_string); if (!node) {
acpi_os_printf
("Could not find [%s] in namespace, defaulting to root node\n",
in_string);
node = acpi_gbl_root_node;
}
}
return (node);
}
/******************************************************************************* * * FUNCTION: acpi_db_sleep * * PARAMETERS: object_arg - Desired sleep state (0-5). NULL means * invoke all possible sleep states. * * RETURN: Status * * DESCRIPTION: Simulate sleep/wake sequences *
******************************************************************************/
if (sleep_state > ACPI_S_STATES_MAX) {
acpi_os_printf("Sleep state %d out of range (%d max)\n",
sleep_state, ACPI_S_STATES_MAX); return;
}
acpi_os_printf("\n---- Invoking sleep state S%d (%s):\n",
sleep_state, acpi_gbl_sleep_state_names[sleep_state]);
/* Get the values for the sleep type registers (for display only) */
status =
acpi_get_sleep_type_data(sleep_state, &sleep_type_a, &sleep_type_b); if (ACPI_FAILURE(status)) {
acpi_os_printf("Could not evaluate [%s] method, %s\n",
acpi_gbl_sleep_state_names[sleep_state],
acpi_format_exception(status)); return;
}
acpi_os_printf
("Register values for sleep state S%d: Sleep-A: %.2X, Sleep-B: %.2X\n",
sleep_state, sleep_type_a, sleep_type_b);
/* Invoke the various sleep/wake interfaces */
acpi_os_printf("**** Sleep: Prepare to sleep (S%d) ****\n",
sleep_state);
status = acpi_enter_sleep_state_prep(sleep_state); if (ACPI_FAILURE(status)) { goto error_exit;
}
acpi_os_printf("**** Sleep: Going to sleep (S%d) ****\n", sleep_state);
status = acpi_enter_sleep_state(sleep_state); if (ACPI_FAILURE(status)) { goto error_exit;
}
acpi_os_printf("**** Wake: Prepare to return from sleep (S%d) ****\n",
sleep_state);
status = acpi_leave_sleep_state_prep(sleep_state); if (ACPI_FAILURE(status)) { goto error_exit;
}
acpi_os_printf("**** Wake: Return from sleep (S%d) ****\n",
sleep_state);
status = acpi_leave_sleep_state(sleep_state); if (ACPI_FAILURE(status)) { goto error_exit;
}
return;
error_exit:
ACPI_EXCEPTION((AE_INFO, status, "During invocation of sleep state S%d",
sleep_state));
}
for (i = 0; i < ACPI_MAX_MUTEX; i++) {
acpi_os_printf("%26s : %s\n", acpi_ut_get_mutex_name(i),
acpi_gbl_mutex_info[i].thread_id ==
ACPI_MUTEX_NOT_ACQUIRED ? "Locked" : "Unlocked");
}
}
/******************************************************************************* * * FUNCTION: acpi_db_display_table_info * * PARAMETERS: table_arg - Name of table to be displayed * * RETURN: None * * DESCRIPTION: Display information about loaded tables. Current * implementation displays all loaded tables. *
******************************************************************************/
switch (table_desc->flags & ACPI_TABLE_ORIGIN_MASK) { case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
acpi_os_printf("External/virtual "); break;
case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
acpi_os_printf("Internal/physical "); break;
case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
acpi_os_printf("Internal/virtual "); break;
default:
acpi_os_printf("INVALID TYPE "); break;
}
/* Make sure that the table is mapped */
status = acpi_tb_validate_table(table_desc); if (ACPI_FAILURE(status)) { return;
}
/* Dump the table header */
if (table_desc->pointer) {
acpi_tb_print_table_header(table_desc->address,
table_desc->pointer);
} else { /* If the pointer is null, the table has been unloaded */
ACPI_INFO(("%4.4s - Table has been unloaded",
table_desc->signature.ascii));
}
}
}
/******************************************************************************* * * FUNCTION: acpi_db_unload_acpi_table * * PARAMETERS: object_name - Namespace pathname for an object that * is owned by the table to be unloaded * * RETURN: None * * DESCRIPTION: Unload an ACPI table, via any namespace node that is owned * by the table. *
******************************************************************************/
node = acpi_db_convert_to_node(object_name); if (!node) { return;
}
status = acpi_unload_parent_table(ACPI_CAST_PTR(acpi_handle, node)); if (ACPI_SUCCESS(status)) {
acpi_os_printf("Parent of [%s] (%p) unloaded and uninstalled\n",
object_name, node);
} else {
acpi_os_printf("%s, while unloading parent table of [%s]\n",
acpi_format_exception(status), object_name);
}
}
/******************************************************************************* * * FUNCTION: acpi_db_send_notify * * PARAMETERS: name - Name of ACPI object where to send notify * value - Value of the notify to send. * * RETURN: None * * DESCRIPTION: Send an ACPI notification. The value specified is sent to the * named object as an ACPI notify. *
******************************************************************************/
if (ACPI_FAILURE(status)) {
acpi_os_printf
("Could not convert Buffer to a resource list: %s, %s\n",
buffer_arg, acpi_format_exception(status)); goto dump_buffer;
}
/******************************************************************************* * * FUNCTION: acpi_dm_compare_aml_resources * * PARAMETERS: aml1_buffer - Contains first resource list * aml1_buffer_length - Length of first resource list * aml2_buffer - Contains second resource list * aml2_buffer_length - Length of second resource list * * RETURN: None * * DESCRIPTION: Compare two AML resource lists, descriptor by descriptor (in * order to isolate a miscompare to an individual resource) *
******************************************************************************/
if (aml1_length != aml2_length) {
acpi_os_printf
("**** Length mismatch in descriptor [%.2X] type %2.2X, " "Offset %8.8X Len1 %X, Len2 %X ****\n", count,
resource_type, offset, aml1_length, aml2_length);
}
/* Check for descriptor byte match */
elseif (memcmp(aml1, aml2, aml1_length)) {
acpi_os_printf
("**** Data mismatch in descriptor [%.2X] type %2.2X, " "Offset %8.8X ****\n", count, resource_type,
offset);
for (i = 0; i < aml1_length; i++) { if (aml1[i] != aml2[i]) {
acpi_os_printf
("Mismatch at byte offset %.2X: is %2.2X, " "should be %2.2X\n", i, aml2[i],
aml1[i]);
}
}
}
/* Exit on end_tag descriptor */
if (resource_type == ACPI_RESOURCE_NAME_END_TAG) { return;
}
/******************************************************************************* * * FUNCTION: acpi_dm_test_resource_conversion * * PARAMETERS: node - Parent device node * name - resource method name (_CRS) * * RETURN: Status * * DESCRIPTION: Compare the original AML with a conversion of the AML to * internal resource list, then back to AML. *
******************************************************************************/
/* * Perform comparison of original AML to newly created AML. This * tests both the AML->Resource conversion and the Resource->AML * conversion.
*/
(void)acpi_dm_test_resource_conversion(node, METHOD_NAME__CRS);
/* Execute _SRS with the resource list */
acpi_os_printf("Evaluating _SRS\n");
status = acpi_set_current_resources(node, &return_buffer); if (ACPI_FAILURE(status)) {
acpi_os_printf("AcpiSetCurrentResources failed: %s\n",
acpi_format_exception(status)); goto end_crs;
}
end_crs:
ACPI_FREE(return_buffer.pointer);
}
/* _PRS */
get_prs: if (prs_node) {
acpi_os_printf("Evaluating _PRS\n");
/******************************************************************************* * * FUNCTION: acpi_db_display_resources * * PARAMETERS: object_arg - String object name or object pointer. * NULL or "*" means "display resources for * all devices" * * RETURN: None * * DESCRIPTION: Display the resource objects associated with a device. *
******************************************************************************/
/* * If no block arg, or block arg == 0 or 1, use the FADT-defined * GPE blocks.
*/ if (block_arg) {
block_number = strtoul(block_arg, NULL, 0); if (block_number == 1) {
block_number = 0;
}
}
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.