******************************************************************************/
/*
- * Copyright (C) 2000 - 2005, R. Byron Moore
+ * Copyright (C) 2000 - 2006, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <acpi/acpi.h>
#define _COMPONENT ACPI_UTILITIES
- ACPI_MODULE_NAME ("utstate")
-
+ACPI_MODULE_NAME("utstate")
/*******************************************************************************
*
* DESCRIPTION: Create a new state and push it
*
******************************************************************************/
-
acpi_status
-acpi_ut_create_pkg_state_and_push (
- void *internal_object,
- void *external_object,
- u16 index,
- union acpi_generic_state **state_list)
+acpi_ut_create_pkg_state_and_push(void *internal_object,
+ void *external_object,
+ u16 index,
+ union acpi_generic_state **state_list)
{
- union acpi_generic_state *state;
-
+ union acpi_generic_state *state;
- ACPI_FUNCTION_ENTRY ();
+ ACPI_FUNCTION_ENTRY();
-
- state = acpi_ut_create_pkg_state (internal_object, external_object, index);
+ state =
+ acpi_ut_create_pkg_state(internal_object, external_object, index);
if (!state) {
return (AE_NO_MEMORY);
}
- acpi_ut_push_generic_state (state_list, state);
+ acpi_ut_push_generic_state(state_list, state);
return (AE_OK);
}
-
/*******************************************************************************
*
* FUNCTION: acpi_ut_push_generic_state
******************************************************************************/
void
-acpi_ut_push_generic_state (
- union acpi_generic_state **list_head,
- union acpi_generic_state *state)
+acpi_ut_push_generic_state(union acpi_generic_state **list_head,
+ union acpi_generic_state *state)
{
- ACPI_FUNCTION_TRACE ("ut_push_generic_state");
-
+ ACPI_FUNCTION_TRACE("ut_push_generic_state");
/* Push the state object onto the front of the list (stack) */
return_VOID;
}
-
/*******************************************************************************
*
* FUNCTION: acpi_ut_pop_generic_state
*
******************************************************************************/
-union acpi_generic_state *
-acpi_ut_pop_generic_state (
- union acpi_generic_state **list_head)
+union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
+ **list_head)
{
- union acpi_generic_state *state;
-
-
- ACPI_FUNCTION_TRACE ("ut_pop_generic_state");
+ union acpi_generic_state *state;
+ ACPI_FUNCTION_TRACE("ut_pop_generic_state");
/* Remove the state object at the head of the list (stack) */
*list_head = state->common.next;
}
- return_PTR (state);
+ return_PTR(state);
}
-
/*******************************************************************************
*
* FUNCTION: acpi_ut_create_generic_state
*
******************************************************************************/
-union acpi_generic_state *
-acpi_ut_create_generic_state (
- void)
+union acpi_generic_state *acpi_ut_create_generic_state(void)
{
- union acpi_generic_state *state;
-
+ union acpi_generic_state *state;
- ACPI_FUNCTION_ENTRY ();
+ ACPI_FUNCTION_ENTRY();
-
- state = acpi_os_acquire_object (acpi_gbl_state_cache);
+ state = acpi_os_acquire_object(acpi_gbl_state_cache);
if (state) {
/* Initialize */
memset(state, 0, sizeof(union acpi_generic_state));
return (state);
}
-
/*******************************************************************************
*
* FUNCTION: acpi_ut_create_thread_state
*
******************************************************************************/
-struct acpi_thread_state *
-acpi_ut_create_thread_state (
- void)
+struct acpi_thread_state *acpi_ut_create_thread_state(void)
{
- union acpi_generic_state *state;
-
-
- ACPI_FUNCTION_TRACE ("ut_create_thread_state");
+ union acpi_generic_state *state;
+ ACPI_FUNCTION_TRACE("ut_create_thread_state");
/* Create the generic state object */
- state = acpi_ut_create_generic_state ();
+ state = acpi_ut_create_generic_state();
if (!state) {
- return_PTR (NULL);
+ return_PTR(NULL);
}
/* Init fields specific to the update struct */
state->common.data_type = ACPI_DESC_TYPE_STATE_THREAD;
- state->thread.thread_id = acpi_os_get_thread_id ();
+ state->thread.thread_id = acpi_os_get_thread_id();
- return_PTR ((struct acpi_thread_state *) state);
+ return_PTR((struct acpi_thread_state *)state);
}
-
/*******************************************************************************
*
* FUNCTION: acpi_ut_create_update_state
*
******************************************************************************/
-union acpi_generic_state *
-acpi_ut_create_update_state (
- union acpi_operand_object *object,
- u16 action)
+union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object
+ *object, u16 action)
{
- union acpi_generic_state *state;
-
-
- ACPI_FUNCTION_TRACE_PTR ("ut_create_update_state", object);
+ union acpi_generic_state *state;
+ ACPI_FUNCTION_TRACE_PTR("ut_create_update_state", object);
/* Create the generic state object */
- state = acpi_ut_create_generic_state ();
+ state = acpi_ut_create_generic_state();
if (!state) {
- return_PTR (NULL);
+ return_PTR(NULL);
}
/* Init fields specific to the update struct */
state->common.data_type = ACPI_DESC_TYPE_STATE_UPDATE;
state->update.object = object;
- state->update.value = action;
+ state->update.value = action;
- return_PTR (state);
+ return_PTR(state);
}
-
/*******************************************************************************
*
* FUNCTION: acpi_ut_create_pkg_state
*
******************************************************************************/
-union acpi_generic_state *
-acpi_ut_create_pkg_state (
- void *internal_object,
- void *external_object,
- u16 index)
+union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
+ void *external_object,
+ u16 index)
{
- union acpi_generic_state *state;
-
-
- ACPI_FUNCTION_TRACE_PTR ("ut_create_pkg_state", internal_object);
+ union acpi_generic_state *state;
+ ACPI_FUNCTION_TRACE_PTR("ut_create_pkg_state", internal_object);
/* Create the generic state object */
- state = acpi_ut_create_generic_state ();
+ state = acpi_ut_create_generic_state();
if (!state) {
- return_PTR (NULL);
+ return_PTR(NULL);
}
/* Init fields specific to the update struct */
state->common.data_type = ACPI_DESC_TYPE_STATE_PACKAGE;
- state->pkg.source_object = (union acpi_operand_object *) internal_object;
- state->pkg.dest_object = external_object;
- state->pkg.index = index;
+ state->pkg.source_object = (union acpi_operand_object *)internal_object;
+ state->pkg.dest_object = external_object;
+ state->pkg.index = index;
state->pkg.num_packages = 1;
- return_PTR (state);
+ return_PTR(state);
}
-
/*******************************************************************************
*
* FUNCTION: acpi_ut_create_control_state
*
******************************************************************************/
-union acpi_generic_state *
-acpi_ut_create_control_state (
- void)
+union acpi_generic_state *acpi_ut_create_control_state(void)
{
- union acpi_generic_state *state;
-
-
- ACPI_FUNCTION_TRACE ("ut_create_control_state");
+ union acpi_generic_state *state;
+ ACPI_FUNCTION_TRACE("ut_create_control_state");
/* Create the generic state object */
- state = acpi_ut_create_generic_state ();
+ state = acpi_ut_create_generic_state();
if (!state) {
- return_PTR (NULL);
+ return_PTR(NULL);
}
/* Init fields specific to the control struct */
state->common.data_type = ACPI_DESC_TYPE_STATE_CONTROL;
- state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
+ state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
- return_PTR (state);
+ return_PTR(state);
}
-
/*******************************************************************************
*
* FUNCTION: acpi_ut_delete_generic_state
*
******************************************************************************/
-void
-acpi_ut_delete_generic_state (
- union acpi_generic_state *state)
+void acpi_ut_delete_generic_state(union acpi_generic_state *state)
{
- ACPI_FUNCTION_TRACE ("ut_delete_generic_state");
+ ACPI_FUNCTION_TRACE("ut_delete_generic_state");
-
- (void) acpi_os_release_object (acpi_gbl_state_cache, state);
+ (void)acpi_os_release_object(acpi_gbl_state_cache, state);
return_VOID;
}
-
-