1 /******************************************************************************
3 * Module Name: dswstate - Dispatcher parse tree walk management routines
6 *****************************************************************************/
9 * Copyright (C) 2000, 2001 R. Byron Moore
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 #define _COMPONENT ACPI_DISPATCHER
35 MODULE_NAME ("dswstate")
38 /*******************************************************************************
40 * FUNCTION: Acpi_ds_result_insert
42 * PARAMETERS: Object - Object to push
43 * Walk_state - Current Walk state
47 * DESCRIPTION: Push an object onto this walk's result stack
49 ******************************************************************************/
52 acpi_ds_result_insert (
55 acpi_walk_state *walk_state)
57 acpi_generic_state *state;
60 PROC_NAME ("Ds_result_insert");
63 state = walk_state->results;
65 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result object pushed! State=%p\n",
67 return (AE_NOT_EXIST);
70 if (index >= OBJ_NUM_OPERANDS) {
71 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
72 "Index out of range: %X Obj=%p State=%p Num=%X\n",
73 index, object, walk_state, state->results.num_results));
74 return (AE_BAD_PARAMETER);
78 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
79 "Null Object! Index=%X Obj=%p State=%p Num=%X\n",
80 index, object, walk_state, state->results.num_results));
81 return (AE_BAD_PARAMETER);
84 state->results.obj_desc [index] = object;
85 state->results.num_results++;
87 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
88 "Obj=%p [%s] State=%p Num=%X Cur=%X\n",
89 object, object ? acpi_ut_get_type_name (((acpi_operand_object *) object)->common.type) : "NULL",
90 walk_state, state->results.num_results, walk_state->current_result));
96 /*******************************************************************************
98 * FUNCTION: Acpi_ds_result_remove
100 * PARAMETERS: Object - Where to return the popped object
101 * Walk_state - Current Walk state
105 * DESCRIPTION: Pop an object off the bottom of this walk's result stack. In
106 * other words, this is a FIFO.
108 ******************************************************************************/
111 acpi_ds_result_remove (
112 acpi_operand_object **object,
114 acpi_walk_state *walk_state)
116 acpi_generic_state *state;
119 PROC_NAME ("Ds_result_remove");
122 state = walk_state->results;
124 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result object pushed! State=%p\n",
126 return (AE_NOT_EXIST);
129 if (index >= OBJ_NUM_OPERANDS) {
130 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
131 "Index out of range: %X State=%p Num=%X\n",
132 index, walk_state, state->results.num_results));
136 /* Check for a valid result object */
138 if (!state->results.obj_desc [index]) {
139 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
140 "Null operand! State=%p #Ops=%X, Index=%X\n",
141 walk_state, state->results.num_results, index));
142 return (AE_AML_NO_RETURN_VALUE);
145 /* Remove the object */
147 state->results.num_results--;
149 *object = state->results.obj_desc [index];
150 state->results.obj_desc [index] = NULL;
152 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
153 "Obj=%p [%s] Index=%X State=%p Num=%X\n",
154 *object, (*object) ? acpi_ut_get_type_name ((*object)->common.type) : "NULL",
155 index, walk_state, state->results.num_results));
161 /*******************************************************************************
163 * FUNCTION: Acpi_ds_result_pop
165 * PARAMETERS: Object - Where to return the popped object
166 * Walk_state - Current Walk state
170 * DESCRIPTION: Pop an object off the bottom of this walk's result stack. In
171 * other words, this is a FIFO.
173 ******************************************************************************/
177 acpi_operand_object **object,
178 acpi_walk_state *walk_state)
181 acpi_generic_state *state;
184 PROC_NAME ("Ds_result_pop");
187 state = walk_state->results;
192 if (!state->results.num_results) {
193 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Result stack is empty! State=%p\n",
195 return (AE_AML_NO_RETURN_VALUE);
198 /* Remove top element */
200 state->results.num_results--;
202 for (index = OBJ_NUM_OPERANDS; index; index--) {
203 /* Check for a valid result object */
205 if (state->results.obj_desc [index -1]) {
206 *object = state->results.obj_desc [index -1];
207 state->results.obj_desc [index -1] = NULL;
209 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] Index=%X State=%p Num=%X\n",
210 *object, (*object) ? acpi_ut_get_type_name ((*object)->common.type) : "NULL",
211 index -1, walk_state, state->results.num_results));
217 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result objects! State=%p\n", walk_state));
218 return (AE_AML_NO_RETURN_VALUE);
221 /*******************************************************************************
223 * FUNCTION: Acpi_ds_result_pop_from_bottom
225 * PARAMETERS: Object - Where to return the popped object
226 * Walk_state - Current Walk state
230 * DESCRIPTION: Pop an object off the bottom of this walk's result stack. In
231 * other words, this is a FIFO.
233 ******************************************************************************/
236 acpi_ds_result_pop_from_bottom (
237 acpi_operand_object **object,
238 acpi_walk_state *walk_state)
241 acpi_generic_state *state;
244 PROC_NAME ("Ds_result_pop_from_bottom");
247 state = walk_state->results;
249 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
250 "Warning: No result object pushed! State=%p\n", walk_state));
251 return (AE_NOT_EXIST);
255 if (!state->results.num_results) {
256 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result objects! State=%p\n", walk_state));
257 return (AE_AML_NO_RETURN_VALUE);
260 /* Remove Bottom element */
262 *object = state->results.obj_desc [0];
264 /* Push entire stack down one element */
266 for (index = 0; index < state->results.num_results; index++) {
267 state->results.obj_desc [index] = state->results.obj_desc [index + 1];
270 state->results.num_results--;
272 /* Check for a valid result object */
275 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null operand! State=%p #Ops=%X, Index=%X\n",
276 walk_state, state->results.num_results, index));
277 return (AE_AML_NO_RETURN_VALUE);
280 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s], Results=%p State=%p\n",
281 *object, (*object) ? acpi_ut_get_type_name ((*object)->common.type) : "NULL",
289 /*******************************************************************************
291 * FUNCTION: Acpi_ds_result_push
293 * PARAMETERS: Object - Where to return the popped object
294 * Walk_state - Current Walk state
298 * DESCRIPTION: Push an object onto the current result stack
300 ******************************************************************************/
303 acpi_ds_result_push (
304 acpi_operand_object *object,
305 acpi_walk_state *walk_state)
307 acpi_generic_state *state;
310 PROC_NAME ("Ds_result_push");
313 state = walk_state->results;
315 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result stack frame\n"));
316 return (AE_AML_INTERNAL);
319 if (state->results.num_results == OBJ_NUM_OPERANDS) {
320 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
321 "Result stack overflow: Obj=%p State=%p Num=%X\n",
322 object, walk_state, state->results.num_results));
323 return (AE_STACK_OVERFLOW);
327 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Object! Obj=%p State=%p Num=%X\n",
328 object, walk_state, state->results.num_results));
329 return (AE_BAD_PARAMETER);
333 state->results.obj_desc [state->results.num_results] = object;
334 state->results.num_results++;
336 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] State=%p Num=%X Cur=%X\n",
337 object, object ? acpi_ut_get_type_name (((acpi_operand_object *) object)->common.type) : "NULL",
338 walk_state, state->results.num_results, walk_state->current_result));
344 /*******************************************************************************
346 * FUNCTION: Acpi_ds_result_stack_push
348 * PARAMETERS: Object - Object to push
349 * Walk_state - Current Walk state
355 ******************************************************************************/
358 acpi_ds_result_stack_push (
359 acpi_walk_state *walk_state)
361 acpi_generic_state *state;
363 PROC_NAME ("Ds_result_stack_push");
366 state = acpi_ut_create_generic_state ();
368 return (AE_NO_MEMORY);
371 state->common.data_type = ACPI_DESC_TYPE_STATE_RESULT;
372 acpi_ut_push_generic_state (&walk_state->results, state);
374 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Results=%p State=%p\n",
381 /*******************************************************************************
383 * FUNCTION: Acpi_ds_result_stack_pop
385 * PARAMETERS: Walk_state - Current Walk state
391 ******************************************************************************/
394 acpi_ds_result_stack_pop (
395 acpi_walk_state *walk_state)
397 acpi_generic_state *state;
399 PROC_NAME ("Ds_result_stack_pop");
402 /* Check for stack underflow */
404 if (walk_state->results == NULL) {
405 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Underflow - State=%p\n",
407 return (AE_AML_NO_OPERAND);
411 state = acpi_ut_pop_generic_state (&walk_state->results);
413 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
414 "Result=%p Remaining_results=%X State=%p\n",
415 state, state->results.num_results, walk_state));
417 acpi_ut_delete_generic_state (state);
423 /*******************************************************************************
425 * FUNCTION: Acpi_ds_obj_stack_delete_all
427 * PARAMETERS: Walk_state - Current Walk state
431 * DESCRIPTION: Clear the object stack by deleting all objects that are on it.
432 * Should be used with great care, if at all!
434 ******************************************************************************/
437 acpi_ds_obj_stack_delete_all (
438 acpi_walk_state *walk_state)
443 FUNCTION_TRACE_PTR ("Ds_obj_stack_delete_all", walk_state);
446 /* The stack size is configurable, but fixed */
448 for (i = 0; i < OBJ_NUM_OPERANDS; i++) {
449 if (walk_state->operands[i]) {
450 acpi_ut_remove_reference (walk_state->operands[i]);
451 walk_state->operands[i] = NULL;
455 return_ACPI_STATUS (AE_OK);
459 /*******************************************************************************
461 * FUNCTION: Acpi_ds_obj_stack_push
463 * PARAMETERS: Object - Object to push
464 * Walk_state - Current Walk state
468 * DESCRIPTION: Push an object onto this walk's object/operand stack
470 ******************************************************************************/
473 acpi_ds_obj_stack_push (
475 acpi_walk_state *walk_state)
477 PROC_NAME ("Ds_obj_stack_push");
480 /* Check for stack overflow */
482 if (walk_state->num_operands >= OBJ_NUM_OPERANDS) {
483 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
484 "overflow! Obj=%p State=%p #Ops=%X\n",
485 object, walk_state, walk_state->num_operands));
486 return (AE_STACK_OVERFLOW);
489 /* Put the object onto the stack */
491 walk_state->operands [walk_state->num_operands] = object;
492 walk_state->num_operands++;
494 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] State=%p #Ops=%X\n",
495 object, acpi_ut_get_type_name (((acpi_operand_object *) object)->common.type),
496 walk_state, walk_state->num_operands));
503 /*******************************************************************************
505 * FUNCTION: Acpi_ds_obj_stack_pop_object
507 * PARAMETERS: Pop_count - Number of objects/entries to pop
508 * Walk_state - Current Walk state
512 * DESCRIPTION: Pop this walk's object stack. Objects on the stack are NOT
513 * deleted by this routine.
515 ******************************************************************************/
518 acpi_ds_obj_stack_pop_object (
519 acpi_operand_object **object,
520 acpi_walk_state *walk_state)
522 PROC_NAME ("Ds_obj_stack_pop_object");
525 /* Check for stack underflow */
527 if (walk_state->num_operands == 0) {
528 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
529 "Missing operand/stack empty! State=%p #Ops=%X\n",
530 walk_state, walk_state->num_operands));
532 return (AE_AML_NO_OPERAND);
537 walk_state->num_operands--;
539 /* Check for a valid operand */
541 if (!walk_state->operands [walk_state->num_operands]) {
542 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
543 "Null operand! State=%p #Ops=%X\n",
544 walk_state, walk_state->num_operands));
546 return (AE_AML_NO_OPERAND);
549 /* Get operand and set stack entry to null */
551 *object = walk_state->operands [walk_state->num_operands];
552 walk_state->operands [walk_state->num_operands] = NULL;
554 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] State=%p #Ops=%X\n",
555 *object, acpi_ut_get_type_name ((*object)->common.type),
556 walk_state, walk_state->num_operands));
562 /*******************************************************************************
564 * FUNCTION: Acpi_ds_obj_stack_pop
566 * PARAMETERS: Pop_count - Number of objects/entries to pop
567 * Walk_state - Current Walk state
571 * DESCRIPTION: Pop this walk's object stack. Objects on the stack are NOT
572 * deleted by this routine.
574 ******************************************************************************/
577 acpi_ds_obj_stack_pop (
579 acpi_walk_state *walk_state)
583 PROC_NAME ("Ds_obj_stack_pop");
586 for (i = 0; i < pop_count; i++) {
587 /* Check for stack underflow */
589 if (walk_state->num_operands == 0) {
590 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
591 "Underflow! Count=%X State=%p #Ops=%X\n",
592 pop_count, walk_state, walk_state->num_operands));
593 return (AE_STACK_UNDERFLOW);
596 /* Just set the stack entry to null */
598 walk_state->num_operands--;
599 walk_state->operands [walk_state->num_operands] = NULL;
602 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n",
603 pop_count, walk_state, walk_state->num_operands));
609 /*******************************************************************************
611 * FUNCTION: Acpi_ds_obj_stack_pop_and_delete
613 * PARAMETERS: Pop_count - Number of objects/entries to pop
614 * Walk_state - Current Walk state
618 * DESCRIPTION: Pop this walk's object stack and delete each object that is
621 ******************************************************************************/
624 acpi_ds_obj_stack_pop_and_delete (
626 acpi_walk_state *walk_state)
629 acpi_operand_object *obj_desc;
631 PROC_NAME ("Ds_obj_stack_pop_and_delete");
634 for (i = 0; i < pop_count; i++) {
635 /* Check for stack underflow */
637 if (walk_state->num_operands == 0) {
638 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
639 "Underflow! Count=%X State=%p #Ops=%X\n",
640 pop_count, walk_state, walk_state->num_operands));
641 return (AE_STACK_UNDERFLOW);
644 /* Pop the stack and delete an object if present in this stack entry */
646 walk_state->num_operands--;
647 obj_desc = walk_state->operands [walk_state->num_operands];
649 acpi_ut_remove_reference (walk_state->operands [walk_state->num_operands]);
650 walk_state->operands [walk_state->num_operands] = NULL;
654 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n",
655 pop_count, walk_state, walk_state->num_operands));
661 /*******************************************************************************
663 * FUNCTION: Acpi_ds_obj_stack_get_value
665 * PARAMETERS: Index - Stack index whose value is desired. Based
666 * on the top of the stack (index=0 == top)
667 * Walk_state - Current Walk state
671 * DESCRIPTION: Retrieve an object from this walk's object stack. Index must
672 * be within the range of the current stack pointer.
674 ******************************************************************************/
677 acpi_ds_obj_stack_get_value (
679 acpi_walk_state *walk_state)
682 FUNCTION_TRACE_PTR ("Ds_obj_stack_get_value", walk_state);
685 /* Can't do it if the stack is empty */
687 if (walk_state->num_operands == 0) {
691 /* or if the index is past the top of the stack */
693 if (index > (walk_state->num_operands - (u32) 1)) {
698 return_PTR (walk_state->operands[(NATIVE_UINT)(walk_state->num_operands - 1) -
703 /*******************************************************************************
705 * FUNCTION: Acpi_ds_get_current_walk_state
707 * PARAMETERS: Walk_list - Get current active state for this walk list
709 * RETURN: Pointer to the current walk state
711 * DESCRIPTION: Get the walk state that is at the head of the list (the "current"
714 ******************************************************************************/
717 acpi_ds_get_current_walk_state (
718 acpi_walk_list *walk_list)
721 PROC_NAME ("Ds_get_current_walk_state");
724 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Ds_get_current_walk_state, =%p\n",
725 walk_list->walk_state));
731 return (walk_list->walk_state);
735 /*******************************************************************************
737 * FUNCTION: Acpi_ds_push_walk_state
739 * PARAMETERS: Walk_state - State to push
740 * Walk_list - The list that owns the walk stack
744 * DESCRIPTION: Place the Walk_state at the head of the state list.
746 ******************************************************************************/
749 acpi_ds_push_walk_state (
750 acpi_walk_state *walk_state,
751 acpi_walk_list *walk_list)
753 FUNCTION_TRACE ("Ds_push_walk_state");
756 walk_state->next = walk_list->walk_state;
757 walk_list->walk_state = walk_state;
763 /*******************************************************************************
765 * FUNCTION: Acpi_ds_pop_walk_state
767 * PARAMETERS: Walk_list - The list that owns the walk stack
769 * RETURN: A Walk_state object popped from the stack
771 * DESCRIPTION: Remove and return the walkstate object that is at the head of
772 * the walk stack for the given walk list. NULL indicates that
775 ******************************************************************************/
778 acpi_ds_pop_walk_state (
779 acpi_walk_list *walk_list)
781 acpi_walk_state *walk_state;
784 FUNCTION_TRACE ("Ds_pop_walk_state");
787 walk_state = walk_list->walk_state;
790 /* Next walk state becomes the current walk state */
792 walk_list->walk_state = walk_state->next;
795 * Don't clear the NEXT field, this serves as an indicator
796 * that there is a parent WALK STATE
797 * Walk_state->Next = NULL;
801 return_PTR (walk_state);
805 /*******************************************************************************
807 * FUNCTION: Acpi_ds_create_walk_state
809 * PARAMETERS: Origin - Starting point for this walk
810 * Walk_list - Owning walk list
812 * RETURN: Pointer to the new walk state.
814 * DESCRIPTION: Allocate and initialize a new walk state. The current walk state
815 * is set to this new state.
817 ******************************************************************************/
820 acpi_ds_create_walk_state (
821 acpi_owner_id owner_id,
822 acpi_parse_object *origin,
823 acpi_operand_object *mth_desc,
824 acpi_walk_list *walk_list)
826 acpi_walk_state *walk_state;
830 FUNCTION_TRACE ("Ds_create_walk_state");
833 walk_state = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_WALK);
838 walk_state->data_type = ACPI_DESC_TYPE_WALK;
839 walk_state->owner_id = owner_id;
840 walk_state->origin = origin;
841 walk_state->method_desc = mth_desc;
842 walk_state->walk_list = walk_list;
844 /* Init the method args/local */
846 #ifndef _ACPI_ASL_COMPILER
847 acpi_ds_method_data_init (walk_state);
850 /* Create an initial result stack entry */
852 status = acpi_ds_result_stack_push (walk_state);
853 if (ACPI_FAILURE (status)) {
857 /* Put the new state at the head of the walk list */
860 acpi_ds_push_walk_state (walk_state, walk_list);
863 return_PTR (walk_state);
867 #ifndef _ACPI_ASL_COMPILER
868 /*******************************************************************************
870 * FUNCTION: Acpi_ds_init_aml_walk
872 * PARAMETERS: Walk_state - New state to be initialized
876 * DESCRIPTION: Initialize a walk state for a pass 1 or 2 parse tree walk
878 ******************************************************************************/
881 acpi_ds_init_aml_walk (
882 acpi_walk_state *walk_state,
883 acpi_parse_object *op,
884 acpi_namespace_node *method_node,
887 acpi_operand_object **params,
888 acpi_operand_object **return_obj_desc,
892 acpi_parse_state *parser_state = &walk_state->parser_state;
895 FUNCTION_TRACE ("Ds_init_aml_walk");
898 walk_state->parser_state.aml =
899 walk_state->parser_state.aml_start = aml_start;
900 walk_state->parser_state.aml_end =
901 walk_state->parser_state.pkg_end = aml_start + aml_length;
903 /* The Next_op of the Next_walk will be the beginning of the method */
904 /* TBD: [Restructure] -- obsolete? */
906 walk_state->next_op = NULL;
907 walk_state->params = params;
908 walk_state->caller_return_desc = return_obj_desc;
910 status = acpi_ps_init_scope (&walk_state->parser_state, op);
911 if (ACPI_FAILURE (status)) {
912 return_ACPI_STATUS (status);
916 walk_state->parser_state.start_node = method_node;
917 walk_state->walk_type = WALK_METHOD;
918 walk_state->method_node = method_node;
919 walk_state->method_desc = acpi_ns_get_attached_object (method_node);
922 /* Push start scope on scope stack and make it current */
924 status = acpi_ds_scope_stack_push (method_node, ACPI_TYPE_METHOD, walk_state);
925 if (ACPI_FAILURE (status)) {
926 return_ACPI_STATUS (status);
929 /* Init the method arguments */
931 acpi_ds_method_data_init_args (params, MTH_NUM_ARGS, walk_state);
935 /* Setup the current scope */
937 parser_state->start_node = parser_state->start_op->node;
938 if (parser_state->start_node) {
939 /* Push start scope on scope stack and make it current */
941 status = acpi_ds_scope_stack_push (parser_state->start_node,
942 parser_state->start_node->type, walk_state);
943 if (ACPI_FAILURE (status)) {
944 return_ACPI_STATUS (status);
949 acpi_ds_init_callbacks (walk_state, pass_number);
951 return_ACPI_STATUS (AE_OK);
956 /*******************************************************************************
958 * FUNCTION: Acpi_ds_delete_walk_state
960 * PARAMETERS: Walk_state - State to delete
964 * DESCRIPTION: Delete a walk state including all internal data structures
966 ******************************************************************************/
969 acpi_ds_delete_walk_state (
970 acpi_walk_state *walk_state)
972 acpi_generic_state *state;
975 FUNCTION_TRACE_PTR ("Ds_delete_walk_state", walk_state);
982 if (walk_state->data_type != ACPI_DESC_TYPE_WALK) {
983 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p is not a valid walk state\n", walk_state));
988 if (walk_state->parser_state.scope) {
989 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p walk still has a scope list\n", walk_state));
992 /* Always must free any linked control states */
994 while (walk_state->control_state) {
995 state = walk_state->control_state;
996 walk_state->control_state = state->common.next;
998 acpi_ut_delete_generic_state (state);
1001 /* Always must free any linked parse states */
1003 while (walk_state->scope_info) {
1004 state = walk_state->scope_info;
1005 walk_state->scope_info = state->common.next;
1007 acpi_ut_delete_generic_state (state);
1010 /* Always must free any stacked result states */
1012 while (walk_state->results) {
1013 state = walk_state->results;
1014 walk_state->results = state->common.next;
1016 acpi_ut_delete_generic_state (state);
1019 acpi_ut_release_to_cache (ACPI_MEM_LIST_WALK, walk_state);
1024 /******************************************************************************
1026 * FUNCTION: Acpi_ds_delete_walk_state_cache
1032 * DESCRIPTION: Purge the global state object cache. Used during subsystem
1035 ******************************************************************************/
1038 acpi_ds_delete_walk_state_cache (
1041 FUNCTION_TRACE ("Ds_delete_walk_state_cache");
1044 acpi_ut_delete_generic_cache (ACPI_MEM_LIST_WALK);