Lines Matching refs:state

4  * Module Name: utstate - state object support procedures
18 * PARAMETERS: list_head - Head of the state stack
19 * state - State object to push
23 * DESCRIPTION: Push a state object onto a state stack
28 union acpi_generic_state *state)
32 /* Push the state object onto the front of the list (stack) */
34 state->common.next = *list_head;
35 *list_head = state;
43 * PARAMETERS: list_head - Head of the state stack
45 * RETURN: The popped state object
47 * DESCRIPTION: Pop a state object from a state stack
54 union acpi_generic_state *state;
58 /* Remove the state object at the head of the list (stack) */
60 state = *list_head;
61 if (state) {
65 *list_head = state->common.next;
68 return (state);
77 * RETURN: The new state object. NULL on failure.
79 * DESCRIPTION: Create a generic state object. Attempt to obtain one from
80 * the global state cache; If none available, create a new one.
86 union acpi_generic_state *state;
90 state = acpi_os_acquire_object(acpi_gbl_state_cache);
91 if (state) {
94 state->common.descriptor_type = ACPI_DESC_TYPE_STATE;
97 return (state);
108 * DESCRIPTION: Create a "Thread State" - a flavor of the generic state used
115 union acpi_generic_state *state;
119 /* Create the generic state object */
121 state = acpi_ut_create_generic_state();
122 if (!state) {
128 state->common.descriptor_type = ACPI_DESC_TYPE_STATE_THREAD;
129 state->thread.thread_id = acpi_os_get_thread_id();
133 if (!state->thread.thread_id) {
135 state->thread.thread_id = (acpi_thread_id) 1;
138 return ((struct acpi_thread_state *)state);
145 * PARAMETERS: object - Initial Object to be installed in the state
148 * RETURN: New state object, null on failure
150 * DESCRIPTION: Create an "Update State" - a flavor of the generic state used
159 union acpi_generic_state *state;
163 /* Create the generic state object */
165 state = acpi_ut_create_generic_state();
166 if (!state) {
172 state->common.descriptor_type = ACPI_DESC_TYPE_STATE_UPDATE;
173 state->update.object = object;
174 state->update.value = action;
175 return (state);
182 * PARAMETERS: object - Initial Object to be installed in the state
185 * RETURN: New state object, null on failure
195 union acpi_generic_state *state;
199 /* Create the generic state object */
201 state = acpi_ut_create_generic_state();
202 if (!state) {
208 state->common.descriptor_type = ACPI_DESC_TYPE_STATE_PACKAGE;
209 state->pkg.source_object = (union acpi_operand_object *)internal_object;
210 state->pkg.dest_object = external_object;
211 state->pkg.index = index;
212 state->pkg.num_packages = 1;
214 return (state);
223 * RETURN: New state object, null on failure
225 * DESCRIPTION: Create a "Control State" - a flavor of the generic state used
232 union acpi_generic_state *state;
236 /* Create the generic state object */
238 state = acpi_ut_create_generic_state();
239 if (!state) {
245 state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL;
246 state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
248 return (state);
255 * PARAMETERS: state - The state object to be deleted
259 * DESCRIPTION: Release a state object to the state cache. NULL state objects
264 void acpi_ut_delete_generic_state(union acpi_generic_state *state)
268 /* Ignore null state */
270 if (state) {
271 (void)acpi_os_release_object(acpi_gbl_state_cache, state);