/******************************************************************************* * * FUNCTION: acpi_db_delete_objects * * PARAMETERS: count - Count of objects in the list * objects - Array of ACPI_OBJECTs to be deleted * * RETURN: None * * DESCRIPTION: Delete a list of ACPI_OBJECTS. Handles packages and nested * packages via recursion. *
******************************************************************************/
void acpi_db_delete_objects(u32 count, union acpi_object *objects)
{
u32 i;
for (i = 0; i < count; i++) { switch (objects[i].type) { case ACPI_TYPE_BUFFER:
/******************************************************************************* * * FUNCTION: acpi_db_execute_method * * PARAMETERS: info - Valid info segment * return_obj - Where to put return object * * RETURN: Status * * DESCRIPTION: Execute a control method. Used to evaluate objects via the * "EXECUTE" or "EVALUATE" commands. *
******************************************************************************/
/******************************************************************************* * * FUNCTION: acpi_db_get_outstanding_allocations * * PARAMETERS: None * * RETURN: Current global allocation count minus cache entries * * DESCRIPTION: Determine the current number of "outstanding" allocations -- * those allocations that have not been freed and also are not * in one of the various object caches. *
******************************************************************************/
/******************************************************************************* * * FUNCTION: acpi_db_execution_walk * * PARAMETERS: WALK_CALLBACK * * RETURN: Status * * DESCRIPTION: Execute a control method. Name is relative to the current * scope. *
******************************************************************************/
status = acpi_evaluate_object(node, NULL, NULL, &return_obj);
acpi_gbl_method_executing = FALSE;
acpi_os_printf("Evaluation of [%4.4s] returned %s\n",
acpi_ut_get_node_name(node),
acpi_format_exception(status));
return (AE_OK);
}
/******************************************************************************* * * FUNCTION: acpi_db_execute * * PARAMETERS: name - Name of method to execute * args - Parameters to the method * Types - * flags - single step/no single step * * RETURN: None * * DESCRIPTION: Execute a control method. Name is relative to the current * scope. Function used for the "EXECUTE", "EVALUATE", and * "ALL" commands *
******************************************************************************/
/* * Allow one execution to be performed by debugger or single step * execution will be dead locked by the interpreter mutexes.
*/ if (acpi_gbl_method_executing) {
acpi_os_printf("Only one debugger execution is allowed.\n"); return;
} #ifdef ACPI_DEBUG_OUTPUT /* Memory allocation tracking */
status = acpi_db_execute_setup(&acpi_gbl_db_method_info); if (ACPI_FAILURE(status)) {
ACPI_FREE(name_string); return;
}
/* Get the NS node, determines existence also */
status = acpi_get_handle(NULL, acpi_gbl_db_method_info.pathname,
&acpi_gbl_db_method_info.method); if (ACPI_SUCCESS(status)) {
status = acpi_db_execute_method(&acpi_gbl_db_method_info,
&return_obj);
}
ACPI_FREE(name_string);
/* * Allow any handlers in separate threads to complete. * (Such as Notify handlers invoked from AML executed above).
*/
acpi_os_sleep((u64)10);
if (allocations > 0) {
acpi_os_printf
("0x%X Outstanding allocations after evaluation of %s\n",
allocations, acpi_gbl_db_method_info.pathname);
} #endif
if (ACPI_FAILURE(status)) {
acpi_os_printf("Evaluation of %s failed with status %s\n",
acpi_gbl_db_method_info.pathname,
acpi_format_exception(status));
} else { /* Display a return object, if any */
if (return_obj.length) {
acpi_os_printf("Evaluation of %s returned object %p, " "external buffer length %X\n",
acpi_gbl_db_method_info.pathname,
return_obj.pointer,
(u32)return_obj.length);
if (ACPI_COMPARE_NAMESEG
((ACPI_CAST_PTR
(struct acpi_namespace_node,
acpi_gbl_db_method_info.method)->name.ascii),
METHOD_NAME__PLD)) {
acpi_db_dump_pld_buffer(return_obj.pointer);
}
} else {
acpi_os_printf
("No object was returned from evaluation of %s\n",
acpi_gbl_db_method_info.pathname);
}
}
/* * acpi_gbl_db_method_info.Arguments will be passed as method arguments. * Prevent acpi_gbl_db_method_info from being modified by multiple threads * concurrently. * * Note: The arguments we are passing are used by the ASL test suite * (aslts). Do not change them without updating the tests.
*/
(void)acpi_os_wait_semaphore(info->info_gate, 1, ACPI_WAIT_FOREVER);
if (info->init_args) {
acpi_db_uint32_to_hex_string(info->num_created,
info->index_of_thread_str);
acpi_db_uint32_to_hex_string((u32)acpi_os_get_thread_id(),
info->id_of_thread_str);
}
for (i = 0; i < info->num_loops; i++) {
status = acpi_db_execute_method(&local_info, &return_obj); if (ACPI_FAILURE(status)) {
acpi_os_printf
("%s During evaluation of %s at iteration %X\n",
acpi_format_exception(status), info->pathname, i); if (status == AE_ABORT_METHOD) { break;
}
} #if 0 if ((i % 100) == 0) {
acpi_os_printf("%u loops, Thread 0x%x\n",
i, acpi_os_get_thread_id());
}
if (return_obj.length) {
acpi_os_printf
("Evaluation of %s returned object %p Buflen %X\n",
info->pathname, return_obj.pointer,
(u32)return_obj.length);
acpi_db_dump_external_object(return_obj.pointer, 1);
} #endif
}
if (allow) {
status = acpi_os_signal_semaphore(info->main_thread_gate, 1); if (ACPI_FAILURE(status)) {
acpi_os_printf
("Could not signal debugger thread sync semaphore, %s\n",
acpi_format_exception(status));
}
}
}
/******************************************************************************* * * FUNCTION: acpi_db_single_execution_thread * * PARAMETERS: context - Method info struct * * RETURN: None * * DESCRIPTION: Create one thread and execute a method *
******************************************************************************/
status = acpi_db_execute_method(info, &return_obj); if (ACPI_FAILURE(status)) {
acpi_os_printf("%s During evaluation of %s\n",
acpi_format_exception(status), info->pathname); return;
}
/* Display a return object, if any */
if (return_obj.length) {
acpi_os_printf("Evaluation of %s returned object %p, " "external buffer length %X\n",
acpi_gbl_db_method_info.pathname,
return_obj.pointer, (u32)return_obj.length);
/******************************************************************************* * * FUNCTION: acpi_db_create_execution_thread * * PARAMETERS: method_name_arg - Control method to execute * arguments - Array of arguments to the method * types - Corresponding array of object types * * RETURN: None * * DESCRIPTION: Create a single thread to evaluate a namespace object. Handles * arguments passed on command line for control methods. *
******************************************************************************/
status = acpi_db_execute_setup(&acpi_gbl_db_method_info); if (ACPI_FAILURE(status)) { return;
}
/* Get the NS node, determines existence also */
status = acpi_get_handle(NULL, acpi_gbl_db_method_info.pathname,
&acpi_gbl_db_method_info.method); if (ACPI_FAILURE(status)) {
acpi_os_printf("%s Could not get handle for %s\n",
acpi_format_exception(status),
acpi_gbl_db_method_info.pathname); return;
}
status = acpi_os_execute(OSL_DEBUGGER_EXEC_THREAD,
acpi_db_single_execution_thread,
&acpi_gbl_db_method_info); if (ACPI_FAILURE(status)) { return;
}
/* * Create the semaphore for synchronization of * the created threads with the main thread.
*/
status = acpi_os_create_semaphore(1, 0, &main_thread_gate); if (ACPI_FAILURE(status)) {
acpi_os_printf("Could not create semaphore for " "synchronization with the main thread, %s\n",
acpi_format_exception(status)); return;
}
/* * Create the semaphore for synchronization * between the created threads.
*/
status = acpi_os_create_semaphore(1, 1, &thread_complete_gate); if (ACPI_FAILURE(status)) {
acpi_os_printf("Could not create semaphore for " "synchronization between the created threads, %s\n",
acpi_format_exception(status));
status = acpi_os_create_semaphore(1, 1, &info_gate); if (ACPI_FAILURE(status)) {
acpi_os_printf("Could not create semaphore for " "synchronization of AcpiGbl_DbMethodInfo, %s\n",
acpi_format_exception(status));
status = acpi_db_execute_setup(&acpi_gbl_db_method_info); if (ACPI_FAILURE(status)) { goto cleanup_and_exit;
}
/* Get the NS node, determines existence also */
status = acpi_get_handle(NULL, acpi_gbl_db_method_info.pathname,
&acpi_gbl_db_method_info.method); if (ACPI_FAILURE(status)) {
acpi_os_printf("%s Could not get handle for %s\n",
acpi_format_exception(status),
acpi_gbl_db_method_info.pathname); goto cleanup_and_exit;
}
/* Create the threads */
acpi_os_printf("Creating %X threads to execute %X times each\n",
num_threads, num_loops);
for (i = 0; i < (num_threads); i++) {
status =
acpi_os_execute(OSL_DEBUGGER_EXEC_THREAD,
acpi_db_method_thread,
&acpi_gbl_db_method_info); if (ACPI_FAILURE(status)) { break;
}
}
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.