X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Facpi%2Fparser%2Fpstree.c;h=dd6f16726fc437abab328359d315cc365ee146e1;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=2140bd1ac10b382bdc707ff384aa225edccb4bd3;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/acpi/parser/pstree.c b/drivers/acpi/parser/pstree.c index 2140bd1ac..dd6f16726 100644 --- a/drivers/acpi/parser/pstree.c +++ b/drivers/acpi/parser/pstree.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,14 +41,17 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include #include #include #define _COMPONENT ACPI_PARSER - ACPI_MODULE_NAME ("pstree") +ACPI_MODULE_NAME("pstree") +/* Local prototypes */ +#ifdef ACPI_OBSOLETE_FUNCTIONS +union acpi_parse_object *acpi_ps_get_child(union acpi_parse_object *op); +#endif /******************************************************************************* * @@ -57,27 +60,22 @@ * 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. * ******************************************************************************/ -union acpi_parse_object * -acpi_ps_get_arg ( - union acpi_parse_object *op, - u32 argn) +union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn) { - union acpi_parse_object *arg = NULL; - const struct acpi_opcode_info *op_info; - - - ACPI_FUNCTION_ENTRY (); + union acpi_parse_object *arg = NULL; + const struct acpi_opcode_info *op_info; + ACPI_FUNCTION_ENTRY(); /* Get the info structure for this opcode */ - op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); + op_info = acpi_ps_get_opcode_info(op->common.aml_opcode); if (op_info->class == AML_CLASS_UNKNOWN) { /* Invalid opcode or ASCII character */ @@ -103,7 +101,6 @@ acpi_ps_get_arg ( return (arg); } - /******************************************************************************* * * FUNCTION: acpi_ps_append_arg @@ -118,16 +115,12 @@ acpi_ps_get_arg ( ******************************************************************************/ void -acpi_ps_append_arg ( - union acpi_parse_object *op, - union acpi_parse_object *arg) +acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg) { - union acpi_parse_object *prev_arg; - const struct acpi_opcode_info *op_info; - - - ACPI_FUNCTION_ENTRY (); + union acpi_parse_object *prev_arg; + const struct acpi_opcode_info *op_info; + ACPI_FUNCTION_ENTRY(); if (!op) { return; @@ -135,12 +128,12 @@ acpi_ps_append_arg ( /* Get the info structure for this opcode */ - op_info = acpi_ps_get_opcode_info (op->common.aml_opcode); + op_info = acpi_ps_get_opcode_info(op->common.aml_opcode); if (op_info->class == AML_CLASS_UNKNOWN) { /* Invalid opcode */ - ACPI_REPORT_ERROR (("ps_append_arg: Invalid AML Opcode: 0x%2.2X\n", - op->common.aml_opcode)); + ACPI_ERROR((AE_INFO, "Invalid AML Opcode: 0x%2.2X", + op->common.aml_opcode)); return; } @@ -152,7 +145,6 @@ acpi_ps_append_arg ( return; } - /* Append the argument to the linked argument list */ if (op->common.value.arg) { @@ -163,15 +155,12 @@ acpi_ps_append_arg ( prev_arg = prev_arg->common.next; } prev_arg->common.next = arg; - } - - else { + } else { /* No argument list, this will be the first argument */ op->common.value.arg = arg; } - /* Set the parent in this arg and any args linked after it */ while (arg) { @@ -180,75 +169,7 @@ acpi_ps_append_arg ( } } - #ifdef ACPI_FUTURE_USAGE - -/******************************************************************************* - * - * FUNCTION: acpi_ps_get_child - * - * 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 - * - ******************************************************************************/ -union acpi_parse_object * -acpi_ps_get_child ( - union acpi_parse_object *op) -{ - union acpi_parse_object *child = NULL; - - - ACPI_FUNCTION_ENTRY (); - - - switch (op->common.aml_opcode) { - case AML_SCOPE_OP: - case AML_ELSE_OP: - case AML_DEVICE_OP: - case AML_THERMAL_ZONE_OP: - case AML_INT_METHODCALL_OP: - - child = acpi_ps_get_arg (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 = acpi_ps_get_arg (op, 1); - break; - - - case AML_POWER_RES_OP: - case AML_INDEX_FIELD_OP: - - child = acpi_ps_get_arg (op, 2); - break; - - - case AML_PROCESSOR_OP: - case AML_BANK_FIELD_OP: - - child = acpi_ps_get_arg (op, 3); - break; - - - default: - /* All others have no children */ - break; - } - - return (child); -} - - /******************************************************************************* * * FUNCTION: acpi_ps_get_depth_next @@ -263,55 +184,51 @@ acpi_ps_get_child ( * ******************************************************************************/ -union acpi_parse_object * -acpi_ps_get_depth_next ( - union acpi_parse_object *origin, - union acpi_parse_object *op) +union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin, + union acpi_parse_object *op) { - union acpi_parse_object *next = NULL; - union acpi_parse_object *parent; - union acpi_parse_object *arg; - - - ACPI_FUNCTION_ENTRY (); + union acpi_parse_object *next = NULL; + union acpi_parse_object *parent; + union acpi_parse_object *arg; + ACPI_FUNCTION_ENTRY(); if (!op) { return (NULL); } - /* look for an argument or child */ + /* Look for an argument or child */ - next = acpi_ps_get_arg (op, 0); + next = acpi_ps_get_arg(op, 0); if (next) { return (next); } - /* look for a sibling */ + /* Look for a sibling */ next = op->common.next; if (next) { return (next); } - /* look for a sibling of parent */ + /* Look for a sibling of parent */ parent = op->common.parent; while (parent) { - arg = acpi_ps_get_arg (parent, 0); + arg = acpi_ps_get_arg(parent, 0); while (arg && (arg != origin) && (arg != op)) { arg = arg->common.next; } 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); } @@ -323,5 +240,64 @@ acpi_ps_get_depth_next ( return (next); } -#endif /* ACPI_FUTURE_USAGE */ +#ifdef ACPI_OBSOLETE_FUNCTIONS +/******************************************************************************* + * + * FUNCTION: acpi_ps_get_child + * + * 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 + * + ******************************************************************************/ + +union acpi_parse_object *acpi_ps_get_child(union acpi_parse_object *op) +{ + union acpi_parse_object *child = NULL; + + ACPI_FUNCTION_ENTRY(); + + switch (op->common.aml_opcode) { + case AML_SCOPE_OP: + case AML_ELSE_OP: + case AML_DEVICE_OP: + case AML_THERMAL_ZONE_OP: + case AML_INT_METHODCALL_OP: + + child = acpi_ps_get_arg(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 = acpi_ps_get_arg(op, 1); + break; + + case AML_POWER_RES_OP: + case AML_INDEX_FIELD_OP: + + child = acpi_ps_get_arg(op, 2); + break; + + case AML_PROCESSOR_OP: + case AML_BANK_FIELD_OP: + + child = acpi_ps_get_arg(op, 3); + break; + + default: + /* All others have no children */ + break; + } + + return (child); +} +#endif +#endif /* ACPI_FUTURE_USAGE */