diff options
Diffstat (limited to 'sys/contrib/dev/acpica/pstree.c')
-rw-r--r-- | sys/contrib/dev/acpica/pstree.c | 165 |
1 files changed, 86 insertions, 79 deletions
diff --git a/sys/contrib/dev/acpica/pstree.c b/sys/contrib/dev/acpica/pstree.c index bcd7414..61e0602 100644 --- a/sys/contrib/dev/acpica/pstree.c +++ b/sys/contrib/dev/acpica/pstree.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: pstree - Parser op tree manipulation/traversal/search - * $Revision: 42 $ + * $Revision: 1.46 $ * *****************************************************************************/ @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp. * All rights reserved. * * 2. License @@ -124,6 +124,14 @@ #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("pstree") +/* Local prototypes */ + +#ifdef ACPI_OBSOLETE_FUNCTIONS +ACPI_PARSE_OBJECT * +AcpiPsGetChild ( + ACPI_PARSE_OBJECT *op); +#endif + /******************************************************************************* * @@ -132,7 +140,7 @@ * PARAMETERS: Op - Get an argument for this op * Argn - Nth argument to get * - * RETURN: The argument (as an Op object). NULL if argument does not exist + * RETURN: The argument (as an Op object). NULL if argument does not exist * * DESCRIPTION: Get the specified op's argument. * @@ -233,7 +241,6 @@ AcpiPsAppendArg ( return; } - /* Append the argument to the linked argument list */ if (Op->Common.Value.Arg) @@ -247,7 +254,6 @@ AcpiPsAppendArg ( } PrevArg->Common.Next = Arg; } - else { /* No argument list, this will be the first argument */ @@ -255,7 +261,6 @@ AcpiPsAppendArg ( Op->Common.Value.Arg = Arg; } - /* Set the parent in this arg and any args linked after it */ while (Arg) @@ -268,74 +273,6 @@ AcpiPsAppendArg ( /******************************************************************************* * - * FUNCTION: AcpiPsGetChild - * - * PARAMETERS: Op - Get the child of this Op - * - * RETURN: Child Op, Null if none is found. - * - * DESCRIPTION: Get op's children or NULL if none - * - ******************************************************************************/ - -ACPI_PARSE_OBJECT * -AcpiPsGetChild ( - ACPI_PARSE_OBJECT *Op) -{ - ACPI_PARSE_OBJECT *Child = NULL; - - - ACPI_FUNCTION_ENTRY (); - - - switch (Op->Common.AmlOpcode) - { - case AML_SCOPE_OP: - case AML_ELSE_OP: - case AML_DEVICE_OP: - case AML_THERMAL_ZONE_OP: - case AML_INT_METHODCALL_OP: - - Child = AcpiPsGetArg (Op, 0); - break; - - - case AML_BUFFER_OP: - case AML_PACKAGE_OP: - case AML_METHOD_OP: - case AML_IF_OP: - case AML_WHILE_OP: - case AML_FIELD_OP: - - Child = AcpiPsGetArg (Op, 1); - break; - - - case AML_POWER_RES_OP: - case AML_INDEX_FIELD_OP: - - Child = AcpiPsGetArg (Op, 2); - break; - - - case AML_PROCESSOR_OP: - case AML_BANK_FIELD_OP: - - Child = AcpiPsGetArg (Op, 3); - break; - - - default: - /* All others have no children */ - break; - } - - return (Child); -} - - -/******************************************************************************* - * * FUNCTION: AcpiPsGetDepthNext * * PARAMETERS: Origin - Root of subtree to search @@ -366,7 +303,7 @@ AcpiPsGetDepthNext ( return (NULL); } - /* look for an argument or child */ + /* Look for an argument or child */ Next = AcpiPsGetArg (Op, 0); if (Next) @@ -374,7 +311,7 @@ AcpiPsGetDepthNext ( return (Next); } - /* look for a sibling */ + /* Look for a sibling */ Next = Op->Common.Next; if (Next) @@ -382,7 +319,7 @@ AcpiPsGetDepthNext ( return (Next); } - /* look for a sibling of parent */ + /* Look for a sibling of parent */ Parent = Op->Common.Parent; @@ -396,14 +333,14 @@ AcpiPsGetDepthNext ( if (Arg == Origin) { - /* reached parent of origin, end search */ + /* Reached parent of origin, end search */ return (NULL); } if (Parent->Common.Next) { - /* found sibling of parent */ + /* Found sibling of parent */ return (Parent->Common.Next); } @@ -416,3 +353,73 @@ AcpiPsGetDepthNext ( } +#ifdef ACPI_OBSOLETE_FUNCTIONS +/******************************************************************************* + * + * FUNCTION: AcpiPsGetChild + * + * PARAMETERS: Op - Get the child of this Op + * + * RETURN: Child Op, Null if none is found. + * + * DESCRIPTION: Get op's children or NULL if none + * + ******************************************************************************/ + +ACPI_PARSE_OBJECT * +AcpiPsGetChild ( + ACPI_PARSE_OBJECT *Op) +{ + ACPI_PARSE_OBJECT *Child = NULL; + + + ACPI_FUNCTION_ENTRY (); + + + switch (Op->Common.AmlOpcode) + { + case AML_SCOPE_OP: + case AML_ELSE_OP: + case AML_DEVICE_OP: + case AML_THERMAL_ZONE_OP: + case AML_INT_METHODCALL_OP: + + Child = AcpiPsGetArg (Op, 0); + break; + + + case AML_BUFFER_OP: + case AML_PACKAGE_OP: + case AML_METHOD_OP: + case AML_IF_OP: + case AML_WHILE_OP: + case AML_FIELD_OP: + + Child = AcpiPsGetArg (Op, 1); + break; + + + case AML_POWER_RES_OP: + case AML_INDEX_FIELD_OP: + + Child = AcpiPsGetArg (Op, 2); + break; + + + case AML_PROCESSOR_OP: + case AML_BANK_FIELD_OP: + + Child = AcpiPsGetArg (Op, 3); + break; + + + default: + /* All others have no children */ + break; + } + + return (Child); +} +#endif + + |