1 /******************************************************************************
2 *
3 * Module Name: dswstate - Dispatcher parse tree walk management routines
4 *
5 *****************************************************************************/
6
7 /*
8 * Copyright (C) 2000 - 2011, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
773 * PARAMETERS: WalkState - State to delete
774 *
775 * RETURN: Status
776 *
777 * DESCRIPTION: Delete a walk state including all internal data structures
778 *
779 ******************************************************************************/
780
781 void
782 AcpiDsDeleteWalkState (
783 ACPI_WALK_STATE *WalkState)
784 {
785 ACPI_GENERIC_STATE *State;
786
787
788 ACPI_FUNCTION_TRACE_PTR (DsDeleteWalkState, WalkState);
789
790
791 if (!WalkState)
792 {
793 return;
794 }
795
796 if (WalkState->DescriptorType != ACPI_DESC_TYPE_WALK)
797 {
798 ACPI_ERROR ((AE_INFO, "%p is not a valid walk state",
799 WalkState));
800 return;
801 }
802
803 /* There should not be any open scopes */
804
805 if (WalkState->ParserState.Scope)
806 {
807 ACPI_ERROR ((AE_INFO, "%p walk still has a scope list",
808 WalkState));
809 AcpiPsCleanupScope (&WalkState->ParserState);
810 }
811
812 /* Always must free any linked control states */
813
814 while (WalkState->ControlState)
815 {
816 State = WalkState->ControlState;
817 WalkState->ControlState = State->Common.Next;
818
819 AcpiUtDeleteGenericState (State);
820 }
825 {
826 State = WalkState->ScopeInfo;
827 WalkState->ScopeInfo = State->Common.Next;
828
829 AcpiUtDeleteGenericState (State);
830 }
831
832 /* Always must free any stacked result states */
833
834 while (WalkState->Results)
835 {
836 State = WalkState->Results;
837 WalkState->Results = State->Common.Next;
838
839 AcpiUtDeleteGenericState (State);
840 }
841
842 ACPI_FREE (WalkState);
843 return_VOID;
844 }
845
846
|
1 /******************************************************************************
2 *
3 * Module Name: dswstate - Dispatcher parse tree walk management routines
4 *
5 *****************************************************************************/
6
7 /*
8 * Copyright (C) 2000 - 2013, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
773 * PARAMETERS: WalkState - State to delete
774 *
775 * RETURN: Status
776 *
777 * DESCRIPTION: Delete a walk state including all internal data structures
778 *
779 ******************************************************************************/
780
781 void
782 AcpiDsDeleteWalkState (
783 ACPI_WALK_STATE *WalkState)
784 {
785 ACPI_GENERIC_STATE *State;
786
787
788 ACPI_FUNCTION_TRACE_PTR (DsDeleteWalkState, WalkState);
789
790
791 if (!WalkState)
792 {
793 return_VOID;
794 }
795
796 if (WalkState->DescriptorType != ACPI_DESC_TYPE_WALK)
797 {
798 ACPI_ERROR ((AE_INFO, "%p is not a valid walk state",
799 WalkState));
800 return_VOID;
801 }
802
803 /* There should not be any open scopes */
804
805 if (WalkState->ParserState.Scope)
806 {
807 ACPI_ERROR ((AE_INFO, "%p walk still has a scope list",
808 WalkState));
809 AcpiPsCleanupScope (&WalkState->ParserState);
810 }
811
812 /* Always must free any linked control states */
813
814 while (WalkState->ControlState)
815 {
816 State = WalkState->ControlState;
817 WalkState->ControlState = State->Common.Next;
818
819 AcpiUtDeleteGenericState (State);
820 }
825 {
826 State = WalkState->ScopeInfo;
827 WalkState->ScopeInfo = State->Common.Next;
828
829 AcpiUtDeleteGenericState (State);
830 }
831
832 /* Always must free any stacked result states */
833
834 while (WalkState->Results)
835 {
836 State = WalkState->Results;
837 WalkState->Results = State->Common.Next;
838
839 AcpiUtDeleteGenericState (State);
840 }
841
842 ACPI_FREE (WalkState);
843 return_VOID;
844 }
|