Пример #1
0
/*******************************************************************************
 *
 * FUNCTION:    acpi_terminate_debugger
 *
 * PARAMETERS:  None
 *
 * RETURN:      None
 *
 * DESCRIPTION: Stop debugger
 *
 ******************************************************************************/
void acpi_terminate_debugger(void)
{

	/* Terminate the AML Debugger */

	acpi_gbl_db_terminate_loop = TRUE;

	if (acpi_gbl_debugger_configuration & DEBUGGER_MULTI_THREADED) {
		acpi_os_release_mutex(acpi_gbl_db_command_ready);

		/* Wait the AML Debugger threads */

		while (!acpi_gbl_db_threads_terminated) {
			acpi_os_sleep(100);
		}
	}

	if (acpi_gbl_db_buffer) {
		acpi_os_free(acpi_gbl_db_buffer);
		acpi_gbl_db_buffer = NULL;
	}

	/* Ensure that debug output is now disabled */

	acpi_gbl_db_output_flags = ACPI_DB_DISABLE_OUTPUT;
}
Пример #2
0
acpi_status acpi_ex_system_do_suspend(acpi_integer how_long)
{
    ACPI_FUNCTION_ENTRY();

    /* Since this thread will sleep, we must release the interpreter */

    acpi_ex_relinquish_interpreter();

    acpi_os_sleep(how_long);

    /* And now we must get the interpreter again */

    acpi_ex_reacquire_interpreter();
    return (AE_OK);
}
Пример #3
0
acpi_status acpi_ex_system_do_suspend(acpi_integer how_long)
{
	acpi_status status;

	ACPI_FUNCTION_ENTRY();

	/* Since this thread will sleep, we must release the interpreter */

	acpi_ex_exit_interpreter();

	acpi_os_sleep(how_long);

	/* And now we must get the interpreter again */

	status = acpi_ex_enter_interpreter();
	return (status);
}
Пример #4
0
acpi_status acpi_ex_system_do_sleep(u64 how_long)
{
	ACPI_FUNCTION_ENTRY();

	/* Since this thread will sleep, we must release the interpreter */

	acpi_ex_exit_interpreter();

	/*
	 * For compatibility with other ACPI implementations and to prevent
	 * accidental deep sleeps, limit the sleep time to something reasonable.
	 */
	if (how_long > ACPI_MAX_SLEEP) {
		how_long = ACPI_MAX_SLEEP;
	}

	acpi_os_sleep(how_long);

	/* And now we must get the interpreter again */

	acpi_ex_enter_interpreter();
	return (AE_OK);
}
Пример #5
0
void
acpi_db_execute (
	NATIVE_CHAR             *name,
	NATIVE_CHAR             **args,
	u32                     flags)
{
	acpi_status             status;
	acpi_buffer             return_obj;


#ifdef ACPI_DEBUG
	u32                     previous_allocations;
	u32                     allocations;


	/* Memory allocation tracking */

	previous_allocations = acpi_db_get_outstanding_allocations ();
#endif

	acpi_gbl_db_method_info.name = name;
	acpi_gbl_db_method_info.args = args;
	acpi_gbl_db_method_info.flags = flags;

	acpi_db_execute_setup (&acpi_gbl_db_method_info);
	status = acpi_db_execute_method (&acpi_gbl_db_method_info, &return_obj);

	/*
	 * Allow any handlers in separate threads to complete.
	 * (Such as Notify handlers invoked from AML executed above).
	 */
	acpi_os_sleep (0, 10);


#ifdef ACPI_DEBUG

	/* Memory allocation tracking */

	allocations = acpi_db_get_outstanding_allocations () - previous_allocations;

	acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT);

	if (allocations > 0) {
		acpi_os_printf ("Outstanding: %ld allocations after execution\n",
				  allocations);
	}
#endif

	if (ACPI_FAILURE (status)) {
		acpi_os_printf ("Execution 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 ("Execution of %s returned object %p Buflen %X\n",
				acpi_gbl_db_method_info.pathname, return_obj.pointer, return_obj.length);
			acpi_db_dump_object (return_obj.pointer, 1);
		}
	}

	acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
}