pswalk.c (4b49587c3dd54aed8eb103d838a89ca79484a9b6) | pswalk.c (3d90091d604146a7c0a7bc071c5b8eba9201531e) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: pswalk - Parser routines to walk parsed op tree(s) 4 * 5 *****************************************************************************/ 6 7/****************************************************************************** 8 * --- 155 unchanged lines hidden (view full) --- 164 * PARAMETERS: SubtreeRoot - Root of tree (or subtree) to delete 165 * 166 * RETURN: None 167 * 168 * DESCRIPTION: Delete a portion of or an entire parse tree. 169 * 170 ******************************************************************************/ 171 | 1/****************************************************************************** 2 * 3 * Module Name: pswalk - Parser routines to walk parsed op tree(s) 4 * 5 *****************************************************************************/ 6 7/****************************************************************************** 8 * --- 155 unchanged lines hidden (view full) --- 164 * PARAMETERS: SubtreeRoot - Root of tree (or subtree) to delete 165 * 166 * RETURN: None 167 * 168 * DESCRIPTION: Delete a portion of or an entire parse tree. 169 * 170 ******************************************************************************/ 171 |
172#include <contrib/dev/acpica/include/amlcode.h> 173 |
|
172void 173AcpiPsDeleteParseTree ( 174 ACPI_PARSE_OBJECT *SubtreeRoot) 175{ 176 ACPI_PARSE_OBJECT *Op = SubtreeRoot; 177 ACPI_PARSE_OBJECT *Next = NULL; 178 ACPI_PARSE_OBJECT *Parent = NULL; | 174void 175AcpiPsDeleteParseTree ( 176 ACPI_PARSE_OBJECT *SubtreeRoot) 177{ 178 ACPI_PARSE_OBJECT *Op = SubtreeRoot; 179 ACPI_PARSE_OBJECT *Next = NULL; 180 ACPI_PARSE_OBJECT *Parent = NULL; |
181 UINT32 Level = 0; |
|
179 180 181 ACPI_FUNCTION_TRACE_PTR (PsDeleteParseTree, SubtreeRoot); 182 | 182 183 184 ACPI_FUNCTION_TRACE_PTR (PsDeleteParseTree, SubtreeRoot); 185 |
186 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE_TREES, 187 " root %p\n", SubtreeRoot)); |
|
183 184 /* Visit all nodes in the subtree */ 185 186 while (Op) 187 { | 188 189 /* Visit all nodes in the subtree */ 190 191 while (Op) 192 { |
188 /* Check if we are not ascending */ 189 | |
190 if (Op != Parent) 191 { | 193 if (Op != Parent) 194 { |
195 /* This is the descending case */ 196 197 if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_PARSE_TREES, _COMPONENT)) 198 { 199 /* This debug option will print the entire parse tree */ 200 201 AcpiOsPrintf (" %*.s%s %p", (Level * 4), " ", 202 AcpiPsGetOpcodeName (Op->Common.AmlOpcode), Op); 203 204 if (Op->Named.AmlOpcode == AML_INT_NAMEPATH_OP) 205 { 206 AcpiOsPrintf (" %4.4s", Op->Common.Value.String); 207 } 208 if (Op->Named.AmlOpcode == AML_STRING_OP) 209 { 210 AcpiOsPrintf (" %s", Op->Common.Value.String); 211 } 212 AcpiOsPrintf ("\n"); 213 } 214 |
|
192 /* Look for an argument or child of the current op */ 193 194 Next = AcpiPsGetArg (Op, 0); 195 if (Next) 196 { 197 /* Still going downward in tree (Op is not completed yet) */ 198 199 Op = Next; | 215 /* Look for an argument or child of the current op */ 216 217 Next = AcpiPsGetArg (Op, 0); 218 if (Next) 219 { 220 /* Still going downward in tree (Op is not completed yet) */ 221 222 Op = Next; |
223 Level++; |
|
200 continue; 201 } 202 } 203 204 /* No more children, this Op is complete. */ 205 206 Next = Op->Common.Next; 207 Parent = Op->Common.Parent; --- 8 unchanged lines hidden (view full) --- 216 } 217 218 if (Next) 219 { 220 Op = Next; 221 } 222 else 223 { | 224 continue; 225 } 226 } 227 228 /* No more children, this Op is complete. */ 229 230 Next = Op->Common.Next; 231 Parent = Op->Common.Parent; --- 8 unchanged lines hidden (view full) --- 240 } 241 242 if (Next) 243 { 244 Op = Next; 245 } 246 else 247 { |
248 Level--; |
|
224 Op = Parent; 225 } 226 } 227 228 return_VOID; 229} | 249 Op = Parent; 250 } 251 } 252 253 return_VOID; 254} |