Home | History | Annotate | Line # | Download | only in utilities
utmisc.c revision 1.1.1.10
      1       1.1    jruoho /*******************************************************************************
      2       1.1    jruoho  *
      3       1.1    jruoho  * Module Name: utmisc - common utility procedures
      4       1.1    jruoho  *
      5       1.1    jruoho  ******************************************************************************/
      6       1.1    jruoho 
      7   1.1.1.2    jruoho /*
      8   1.1.1.9  christos  * Copyright (C) 2000 - 2017, Intel Corp.
      9       1.1    jruoho  * All rights reserved.
     10       1.1    jruoho  *
     11   1.1.1.2    jruoho  * Redistribution and use in source and binary forms, with or without
     12   1.1.1.2    jruoho  * modification, are permitted provided that the following conditions
     13   1.1.1.2    jruoho  * are met:
     14   1.1.1.2    jruoho  * 1. Redistributions of source code must retain the above copyright
     15   1.1.1.2    jruoho  *    notice, this list of conditions, and the following disclaimer,
     16   1.1.1.2    jruoho  *    without modification.
     17   1.1.1.2    jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18   1.1.1.2    jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
     19   1.1.1.2    jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
     20   1.1.1.2    jruoho  *    including a substantially similar Disclaimer requirement for further
     21   1.1.1.2    jruoho  *    binary redistribution.
     22   1.1.1.2    jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
     23   1.1.1.2    jruoho  *    of any contributors may be used to endorse or promote products derived
     24   1.1.1.2    jruoho  *    from this software without specific prior written permission.
     25   1.1.1.2    jruoho  *
     26   1.1.1.2    jruoho  * Alternatively, this software may be distributed under the terms of the
     27   1.1.1.2    jruoho  * GNU General Public License ("GPL") version 2 as published by the Free
     28   1.1.1.2    jruoho  * Software Foundation.
     29   1.1.1.2    jruoho  *
     30   1.1.1.2    jruoho  * NO WARRANTY
     31   1.1.1.2    jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32   1.1.1.2    jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33   1.1.1.2    jruoho  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34   1.1.1.2    jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35   1.1.1.2    jruoho  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36   1.1.1.2    jruoho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37   1.1.1.2    jruoho  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38   1.1.1.2    jruoho  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39   1.1.1.2    jruoho  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40   1.1.1.2    jruoho  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41   1.1.1.2    jruoho  * POSSIBILITY OF SUCH DAMAGES.
     42   1.1.1.2    jruoho  */
     43       1.1    jruoho 
     44       1.1    jruoho #include "acpi.h"
     45       1.1    jruoho #include "accommon.h"
     46       1.1    jruoho #include "acnamesp.h"
     47       1.1    jruoho 
     48       1.1    jruoho 
     49       1.1    jruoho #define _COMPONENT          ACPI_UTILITIES
     50       1.1    jruoho         ACPI_MODULE_NAME    ("utmisc")
     51       1.1    jruoho 
     52       1.1    jruoho 
     53       1.1    jruoho /*******************************************************************************
     54       1.1    jruoho  *
     55       1.1    jruoho  * FUNCTION:    AcpiUtIsPciRootBridge
     56       1.1    jruoho  *
     57       1.1    jruoho  * PARAMETERS:  Id              - The HID/CID in string format
     58       1.1    jruoho  *
     59       1.1    jruoho  * RETURN:      TRUE if the Id is a match for a PCI/PCI-Express Root Bridge
     60       1.1    jruoho  *
     61       1.1    jruoho  * DESCRIPTION: Determine if the input ID is a PCI Root Bridge ID.
     62       1.1    jruoho  *
     63       1.1    jruoho  ******************************************************************************/
     64       1.1    jruoho 
     65       1.1    jruoho BOOLEAN
     66       1.1    jruoho AcpiUtIsPciRootBridge (
     67       1.1    jruoho     char                    *Id)
     68       1.1    jruoho {
     69       1.1    jruoho 
     70       1.1    jruoho     /*
     71       1.1    jruoho      * Check if this is a PCI root bridge.
     72       1.1    jruoho      * ACPI 3.0+: check for a PCI Express root also.
     73   1.1.1.3  christos      */
     74   1.1.1.6  christos     if (!(strcmp (Id,
     75   1.1.1.7  christos         PCI_ROOT_HID_STRING)) ||
     76       1.1    jruoho 
     77   1.1.1.6  christos         !(strcmp (Id,
     78   1.1.1.7  christos         PCI_EXPRESS_ROOT_HID_STRING)))
     79       1.1    jruoho     {
     80   1.1.1.3  christos         return (TRUE);
     81       1.1    jruoho     }
     82       1.1    jruoho 
     83   1.1.1.3  christos     return (FALSE);
     84       1.1    jruoho }
     85       1.1    jruoho 
     86       1.1    jruoho 
     87   1.1.1.7  christos #if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP)
     88       1.1    jruoho /*******************************************************************************
     89       1.1    jruoho  *
     90   1.1.1.3  christos  * FUNCTION:    AcpiUtIsAmlTable
     91       1.1    jruoho  *
     92   1.1.1.3  christos  * PARAMETERS:  Table               - An ACPI table
     93       1.1    jruoho  *
     94   1.1.1.3  christos  * RETURN:      TRUE if table contains executable AML; FALSE otherwise
     95       1.1    jruoho  *
     96   1.1.1.3  christos  * DESCRIPTION: Check ACPI Signature for a table that contains AML code.
     97   1.1.1.3  christos  *              Currently, these are DSDT,SSDT,PSDT. All other table types are
     98   1.1.1.3  christos  *              data tables that do not contain AML code.
     99       1.1    jruoho  *
    100       1.1    jruoho  ******************************************************************************/
    101       1.1    jruoho 
    102       1.1    jruoho BOOLEAN
    103   1.1.1.3  christos AcpiUtIsAmlTable (
    104   1.1.1.3  christos     ACPI_TABLE_HEADER       *Table)
    105       1.1    jruoho {
    106       1.1    jruoho 
    107   1.1.1.3  christos     /* These are the only tables that contain executable AML */
    108       1.1    jruoho 
    109   1.1.1.3  christos     if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT) ||
    110   1.1.1.3  christos         ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_PSDT) ||
    111   1.1.1.6  christos         ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT) ||
    112   1.1.1.6  christos         ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_OSDT))
    113       1.1    jruoho     {
    114   1.1.1.3  christos         return (TRUE);
    115       1.1    jruoho     }
    116       1.1    jruoho 
    117   1.1.1.3  christos     return (FALSE);
    118       1.1    jruoho }
    119   1.1.1.5  christos #endif
    120       1.1    jruoho 
    121       1.1    jruoho 
    122       1.1    jruoho /*******************************************************************************
    123       1.1    jruoho  *
    124   1.1.1.3  christos  * FUNCTION:    AcpiUtDwordByteSwap
    125       1.1    jruoho  *
    126   1.1.1.3  christos  * PARAMETERS:  Value           - Value to be converted
    127       1.1    jruoho  *
    128   1.1.1.3  christos  * RETURN:      UINT32 integer with bytes swapped
    129       1.1    jruoho  *
    130   1.1.1.3  christos  * DESCRIPTION: Convert a 32-bit value to big-endian (swap the bytes)
    131       1.1    jruoho  *
    132       1.1    jruoho  ******************************************************************************/
    133       1.1    jruoho 
    134   1.1.1.3  christos UINT32
    135   1.1.1.3  christos AcpiUtDwordByteSwap (
    136   1.1.1.3  christos     UINT32                  Value)
    137       1.1    jruoho {
    138   1.1.1.3  christos     union
    139   1.1.1.3  christos     {
    140   1.1.1.3  christos         UINT32              Value;
    141   1.1.1.3  christos         UINT8               Bytes[4];
    142   1.1.1.3  christos     } Out;
    143   1.1.1.3  christos     union
    144   1.1.1.3  christos     {
    145   1.1.1.3  christos         UINT32              Value;
    146   1.1.1.3  christos         UINT8               Bytes[4];
    147   1.1.1.3  christos     } In;
    148       1.1    jruoho 
    149       1.1    jruoho 
    150   1.1.1.3  christos     ACPI_FUNCTION_ENTRY ();
    151       1.1    jruoho 
    152       1.1    jruoho 
    153   1.1.1.3  christos     In.Value = Value;
    154       1.1    jruoho 
    155   1.1.1.3  christos     Out.Bytes[0] = In.Bytes[3];
    156   1.1.1.3  christos     Out.Bytes[1] = In.Bytes[2];
    157   1.1.1.3  christos     Out.Bytes[2] = In.Bytes[1];
    158   1.1.1.3  christos     Out.Bytes[3] = In.Bytes[0];
    159       1.1    jruoho 
    160   1.1.1.3  christos     return (Out.Value);
    161       1.1    jruoho }
    162       1.1    jruoho 
    163       1.1    jruoho 
    164       1.1    jruoho /*******************************************************************************
    165       1.1    jruoho  *
    166   1.1.1.3  christos  * FUNCTION:    AcpiUtSetIntegerWidth
    167   1.1.1.3  christos  *
    168   1.1.1.3  christos  * PARAMETERS:  Revision            From DSDT header
    169   1.1.1.3  christos  *
    170   1.1.1.3  christos  * RETURN:      None
    171       1.1    jruoho  *
    172   1.1.1.3  christos  * DESCRIPTION: Set the global integer bit width based upon the revision
    173   1.1.1.3  christos  *              of the DSDT. For Revision 1 and 0, Integers are 32 bits.
    174   1.1.1.3  christos  *              For Revision 2 and above, Integers are 64 bits. Yes, this
    175   1.1.1.3  christos  *              makes a difference.
    176       1.1    jruoho  *
    177       1.1    jruoho  ******************************************************************************/
    178       1.1    jruoho 
    179   1.1.1.3  christos void
    180   1.1.1.3  christos AcpiUtSetIntegerWidth (
    181   1.1.1.3  christos     UINT8                   Revision)
    182       1.1    jruoho {
    183       1.1    jruoho 
    184   1.1.1.3  christos     if (Revision < 2)
    185       1.1    jruoho     {
    186   1.1.1.3  christos         /* 32-bit case */
    187       1.1    jruoho 
    188   1.1.1.7  christos         AcpiGbl_IntegerBitWidth = 32;
    189   1.1.1.3  christos         AcpiGbl_IntegerNybbleWidth = 8;
    190   1.1.1.7  christos         AcpiGbl_IntegerByteWidth = 4;
    191       1.1    jruoho     }
    192       1.1    jruoho     else
    193       1.1    jruoho     {
    194   1.1.1.3  christos         /* 64-bit case (ACPI 2.0+) */
    195   1.1.1.3  christos 
    196   1.1.1.7  christos         AcpiGbl_IntegerBitWidth = 64;
    197   1.1.1.3  christos         AcpiGbl_IntegerNybbleWidth = 16;
    198   1.1.1.7  christos         AcpiGbl_IntegerByteWidth = 8;
    199       1.1    jruoho     }
    200       1.1    jruoho }
    201       1.1    jruoho 
    202       1.1    jruoho 
    203       1.1    jruoho /*******************************************************************************
    204       1.1    jruoho  *
    205       1.1    jruoho  * FUNCTION:    AcpiUtCreateUpdateStateAndPush
    206       1.1    jruoho  *
    207       1.1    jruoho  * PARAMETERS:  Object          - Object to be added to the new state
    208       1.1    jruoho  *              Action          - Increment/Decrement
    209       1.1    jruoho  *              StateList       - List the state will be added to
    210       1.1    jruoho  *
    211       1.1    jruoho  * RETURN:      Status
    212       1.1    jruoho  *
    213       1.1    jruoho  * DESCRIPTION: Create a new state and push it
    214       1.1    jruoho  *
    215       1.1    jruoho  ******************************************************************************/
    216       1.1    jruoho 
    217       1.1    jruoho ACPI_STATUS
    218       1.1    jruoho AcpiUtCreateUpdateStateAndPush (
    219       1.1    jruoho     ACPI_OPERAND_OBJECT     *Object,
    220       1.1    jruoho     UINT16                  Action,
    221       1.1    jruoho     ACPI_GENERIC_STATE      **StateList)
    222       1.1    jruoho {
    223       1.1    jruoho     ACPI_GENERIC_STATE       *State;
    224       1.1    jruoho 
    225       1.1    jruoho 
    226       1.1    jruoho     ACPI_FUNCTION_ENTRY ();
    227       1.1    jruoho 
    228       1.1    jruoho 
    229       1.1    jruoho     /* Ignore null objects; these are expected */
    230       1.1    jruoho 
    231       1.1    jruoho     if (!Object)
    232       1.1    jruoho     {
    233       1.1    jruoho         return (AE_OK);
    234       1.1    jruoho     }
    235       1.1    jruoho 
    236       1.1    jruoho     State = AcpiUtCreateUpdateState (Object, Action);
    237       1.1    jruoho     if (!State)
    238       1.1    jruoho     {
    239       1.1    jruoho         return (AE_NO_MEMORY);
    240       1.1    jruoho     }
    241       1.1    jruoho 
    242       1.1    jruoho     AcpiUtPushGenericState (StateList, State);
    243       1.1    jruoho     return (AE_OK);
    244       1.1    jruoho }
    245       1.1    jruoho 
    246       1.1    jruoho 
    247       1.1    jruoho /*******************************************************************************
    248       1.1    jruoho  *
    249       1.1    jruoho  * FUNCTION:    AcpiUtWalkPackageTree
    250       1.1    jruoho  *
    251       1.1    jruoho  * PARAMETERS:  SourceObject        - The package to walk
    252       1.1    jruoho  *              TargetObject        - Target object (if package is being copied)
    253       1.1    jruoho  *              WalkCallback        - Called once for each package element
    254       1.1    jruoho  *              Context             - Passed to the callback function
    255       1.1    jruoho  *
    256       1.1    jruoho  * RETURN:      Status
    257       1.1    jruoho  *
    258  1.1.1.10  christos  * DESCRIPTION: Walk through a package, including subpackages
    259       1.1    jruoho  *
    260       1.1    jruoho  ******************************************************************************/
    261       1.1    jruoho 
    262       1.1    jruoho ACPI_STATUS
    263       1.1    jruoho AcpiUtWalkPackageTree (
    264       1.1    jruoho     ACPI_OPERAND_OBJECT     *SourceObject,
    265       1.1    jruoho     void                    *TargetObject,
    266       1.1    jruoho     ACPI_PKG_CALLBACK       WalkCallback,
    267       1.1    jruoho     void                    *Context)
    268       1.1    jruoho {
    269       1.1    jruoho     ACPI_STATUS             Status = AE_OK;
    270       1.1    jruoho     ACPI_GENERIC_STATE      *StateList = NULL;
    271       1.1    jruoho     ACPI_GENERIC_STATE      *State;
    272       1.1    jruoho     ACPI_OPERAND_OBJECT     *ThisSourceObj;
    273  1.1.1.10  christos     UINT32                  ThisIndex;
    274       1.1    jruoho 
    275       1.1    jruoho 
    276       1.1    jruoho     ACPI_FUNCTION_TRACE (UtWalkPackageTree);
    277       1.1    jruoho 
    278       1.1    jruoho 
    279       1.1    jruoho     State = AcpiUtCreatePkgState (SourceObject, TargetObject, 0);
    280       1.1    jruoho     if (!State)
    281       1.1    jruoho     {
    282       1.1    jruoho         return_ACPI_STATUS (AE_NO_MEMORY);
    283       1.1    jruoho     }
    284       1.1    jruoho 
    285       1.1    jruoho     while (State)
    286       1.1    jruoho     {
    287       1.1    jruoho         /* Get one element of the package */
    288       1.1    jruoho 
    289   1.1.1.7  christos         ThisIndex = State->Pkg.Index;
    290  1.1.1.10  christos         ThisSourceObj =
    291   1.1.1.7  christos             State->Pkg.SourceObject->Package.Elements[ThisIndex];
    292  1.1.1.10  christos         State->Pkg.ThisTargetObj =
    293  1.1.1.10  christos             &State->Pkg.SourceObject->Package.Elements[ThisIndex];
    294       1.1    jruoho 
    295       1.1    jruoho         /*
    296       1.1    jruoho          * Check for:
    297   1.1.1.3  christos          * 1) An uninitialized package element. It is completely
    298       1.1    jruoho          *    legal to declare a package and leave it uninitialized
    299       1.1    jruoho          * 2) Not an internal object - can be a namespace node instead
    300   1.1.1.3  christos          * 3) Any type other than a package. Packages are handled in else
    301       1.1    jruoho          *    case below.
    302       1.1    jruoho          */
    303       1.1    jruoho         if ((!ThisSourceObj) ||
    304   1.1.1.7  christos             (ACPI_GET_DESCRIPTOR_TYPE (ThisSourceObj) !=
    305   1.1.1.7  christos                 ACPI_DESC_TYPE_OPERAND) ||
    306       1.1    jruoho             (ThisSourceObj->Common.Type != ACPI_TYPE_PACKAGE))
    307       1.1    jruoho         {
    308       1.1    jruoho             Status = WalkCallback (ACPI_COPY_TYPE_SIMPLE, ThisSourceObj,
    309  1.1.1.10  christos                 State, Context);
    310       1.1    jruoho             if (ACPI_FAILURE (Status))
    311       1.1    jruoho             {
    312       1.1    jruoho                 return_ACPI_STATUS (Status);
    313       1.1    jruoho             }
    314       1.1    jruoho 
    315       1.1    jruoho             State->Pkg.Index++;
    316   1.1.1.7  christos             while (State->Pkg.Index >=
    317   1.1.1.7  christos                 State->Pkg.SourceObject->Package.Count)
    318       1.1    jruoho             {
    319       1.1    jruoho                 /*
    320       1.1    jruoho                  * We've handled all of the objects at this level,  This means
    321   1.1.1.3  christos                  * that we have just completed a package. That package may
    322       1.1    jruoho                  * have contained one or more packages itself.
    323       1.1    jruoho                  *
    324       1.1    jruoho                  * Delete this state and pop the previous state (package).
    325       1.1    jruoho                  */
    326       1.1    jruoho                 AcpiUtDeleteGenericState (State);
    327       1.1    jruoho                 State = AcpiUtPopGenericState (&StateList);
    328       1.1    jruoho 
    329       1.1    jruoho                 /* Finished when there are no more states */
    330       1.1    jruoho 
    331       1.1    jruoho                 if (!State)
    332       1.1    jruoho                 {
    333       1.1    jruoho                     /*
    334       1.1    jruoho                      * We have handled all of the objects in the top level
    335       1.1    jruoho                      * package just add the length of the package objects
    336       1.1    jruoho                      * and exit
    337       1.1    jruoho                      */
    338       1.1    jruoho                     return_ACPI_STATUS (AE_OK);
    339       1.1    jruoho                 }
    340       1.1    jruoho 
    341       1.1    jruoho                 /*
    342       1.1    jruoho                  * Go back up a level and move the index past the just
    343       1.1    jruoho                  * completed package object.
    344       1.1    jruoho                  */
    345       1.1    jruoho                 State->Pkg.Index++;
    346       1.1    jruoho             }
    347       1.1    jruoho         }
    348       1.1    jruoho         else
    349       1.1    jruoho         {
    350       1.1    jruoho             /* This is a subobject of type package */
    351       1.1    jruoho 
    352   1.1.1.7  christos             Status = WalkCallback (
    353   1.1.1.7  christos                 ACPI_COPY_TYPE_PACKAGE, ThisSourceObj, State, Context);
    354       1.1    jruoho             if (ACPI_FAILURE (Status))
    355       1.1    jruoho             {
    356       1.1    jruoho                 return_ACPI_STATUS (Status);
    357       1.1    jruoho             }
    358       1.1    jruoho 
    359       1.1    jruoho             /*
    360       1.1    jruoho              * Push the current state and create a new one
    361       1.1    jruoho              * The callback above returned a new target package object.
    362       1.1    jruoho              */
    363       1.1    jruoho             AcpiUtPushGenericState (&StateList, State);
    364   1.1.1.7  christos             State = AcpiUtCreatePkgState (
    365   1.1.1.7  christos                 ThisSourceObj, State->Pkg.ThisTargetObj, 0);
    366       1.1    jruoho             if (!State)
    367       1.1    jruoho             {
    368       1.1    jruoho                 /* Free any stacked Update State objects */
    369       1.1    jruoho 
    370       1.1    jruoho                 while (StateList)
    371       1.1    jruoho                 {
    372       1.1    jruoho                     State = AcpiUtPopGenericState (&StateList);
    373       1.1    jruoho                     AcpiUtDeleteGenericState (State);
    374       1.1    jruoho                 }
    375       1.1    jruoho                 return_ACPI_STATUS (AE_NO_MEMORY);
    376       1.1    jruoho             }
    377       1.1    jruoho         }
    378       1.1    jruoho     }
    379       1.1    jruoho 
    380       1.1    jruoho     /* We should never get here */
    381       1.1    jruoho 
    382  1.1.1.10  christos     ACPI_ERROR ((AE_INFO,
    383  1.1.1.10  christos         "State list did not terminate correctly"));
    384  1.1.1.10  christos 
    385       1.1    jruoho     return_ACPI_STATUS (AE_AML_INTERNAL);
    386       1.1    jruoho }
    387       1.1    jruoho 
    388       1.1    jruoho 
    389   1.1.1.3  christos #ifdef ACPI_DEBUG_OUTPUT
    390   1.1.1.3  christos /*******************************************************************************
    391   1.1.1.3  christos  *
    392   1.1.1.3  christos  * FUNCTION:    AcpiUtDisplayInitPathname
    393   1.1.1.3  christos  *
    394   1.1.1.3  christos  * PARAMETERS:  Type                - Object type of the node
    395   1.1.1.3  christos  *              ObjHandle           - Handle whose pathname will be displayed
    396   1.1.1.3  christos  *              Path                - Additional path string to be appended.
    397   1.1.1.3  christos  *                                      (NULL if no extra path)
    398   1.1.1.3  christos  *
    399   1.1.1.3  christos  * RETURN:      ACPI_STATUS
    400   1.1.1.3  christos  *
    401   1.1.1.3  christos  * DESCRIPTION: Display full pathname of an object, DEBUG ONLY
    402   1.1.1.3  christos  *
    403   1.1.1.3  christos  ******************************************************************************/
    404   1.1.1.3  christos 
    405   1.1.1.3  christos void
    406   1.1.1.3  christos AcpiUtDisplayInitPathname (
    407   1.1.1.3  christos     UINT8                   Type,
    408   1.1.1.3  christos     ACPI_NAMESPACE_NODE     *ObjHandle,
    409   1.1.1.8  christos     const char              *Path)
    410   1.1.1.3  christos {
    411   1.1.1.3  christos     ACPI_STATUS             Status;
    412   1.1.1.3  christos     ACPI_BUFFER             Buffer;
    413   1.1.1.3  christos 
    414   1.1.1.3  christos 
    415   1.1.1.3  christos     ACPI_FUNCTION_ENTRY ();
    416   1.1.1.3  christos 
    417   1.1.1.3  christos 
    418   1.1.1.3  christos     /* Only print the path if the appropriate debug level is enabled */
    419   1.1.1.3  christos 
    420   1.1.1.3  christos     if (!(AcpiDbgLevel & ACPI_LV_INIT_NAMES))
    421   1.1.1.3  christos     {
    422   1.1.1.3  christos         return;
    423   1.1.1.3  christos     }
    424   1.1.1.3  christos 
    425   1.1.1.3  christos     /* Get the full pathname to the node */
    426   1.1.1.3  christos 
    427   1.1.1.3  christos     Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
    428   1.1.1.7  christos     Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, TRUE);
    429   1.1.1.3  christos     if (ACPI_FAILURE (Status))
    430   1.1.1.3  christos     {
    431   1.1.1.3  christos         return;
    432   1.1.1.3  christos     }
    433   1.1.1.3  christos 
    434   1.1.1.3  christos     /* Print what we're doing */
    435   1.1.1.3  christos 
    436   1.1.1.3  christos     switch (Type)
    437   1.1.1.3  christos     {
    438   1.1.1.3  christos     case ACPI_TYPE_METHOD:
    439   1.1.1.3  christos 
    440   1.1.1.3  christos         AcpiOsPrintf ("Executing    ");
    441   1.1.1.3  christos         break;
    442   1.1.1.3  christos 
    443   1.1.1.3  christos     default:
    444   1.1.1.3  christos 
    445   1.1.1.3  christos         AcpiOsPrintf ("Initializing ");
    446   1.1.1.3  christos         break;
    447   1.1.1.3  christos     }
    448   1.1.1.3  christos 
    449   1.1.1.3  christos     /* Print the object type and pathname */
    450   1.1.1.3  christos 
    451   1.1.1.3  christos     AcpiOsPrintf ("%-12s  %s",
    452   1.1.1.3  christos         AcpiUtGetTypeName (Type), (char *) Buffer.Pointer);
    453   1.1.1.3  christos 
    454   1.1.1.3  christos     /* Extra path is used to append names like _STA, _INI, etc. */
    455   1.1.1.3  christos 
    456   1.1.1.3  christos     if (Path)
    457   1.1.1.3  christos     {
    458   1.1.1.3  christos         AcpiOsPrintf (".%s", Path);
    459   1.1.1.3  christos     }
    460   1.1.1.3  christos     AcpiOsPrintf ("\n");
    461   1.1.1.3  christos 
    462   1.1.1.3  christos     ACPI_FREE (Buffer.Pointer);
    463   1.1.1.3  christos }
    464   1.1.1.3  christos #endif
    465