Home | History | Annotate | Line # | Download | only in debugger
dbcmds.c revision 1.3.4.2
      1  1.3.4.2  rmind /*******************************************************************************
      2  1.3.4.2  rmind  *
      3  1.3.4.2  rmind  * Module Name: dbcmds - Miscellaneous debug commands and output routines
      4  1.3.4.2  rmind  *
      5  1.3.4.2  rmind  ******************************************************************************/
      6  1.3.4.2  rmind 
      7  1.3.4.2  rmind /*
      8  1.3.4.2  rmind  * Copyright (C) 2000 - 2011, Intel Corp.
      9  1.3.4.2  rmind  * All rights reserved.
     10  1.3.4.2  rmind  *
     11  1.3.4.2  rmind  * Redistribution and use in source and binary forms, with or without
     12  1.3.4.2  rmind  * modification, are permitted provided that the following conditions
     13  1.3.4.2  rmind  * are met:
     14  1.3.4.2  rmind  * 1. Redistributions of source code must retain the above copyright
     15  1.3.4.2  rmind  *    notice, this list of conditions, and the following disclaimer,
     16  1.3.4.2  rmind  *    without modification.
     17  1.3.4.2  rmind  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18  1.3.4.2  rmind  *    substantially similar to the "NO WARRANTY" disclaimer below
     19  1.3.4.2  rmind  *    ("Disclaimer") and any redistribution must be conditioned upon
     20  1.3.4.2  rmind  *    including a substantially similar Disclaimer requirement for further
     21  1.3.4.2  rmind  *    binary redistribution.
     22  1.3.4.2  rmind  * 3. Neither the names of the above-listed copyright holders nor the names
     23  1.3.4.2  rmind  *    of any contributors may be used to endorse or promote products derived
     24  1.3.4.2  rmind  *    from this software without specific prior written permission.
     25  1.3.4.2  rmind  *
     26  1.3.4.2  rmind  * Alternatively, this software may be distributed under the terms of the
     27  1.3.4.2  rmind  * GNU General Public License ("GPL") version 2 as published by the Free
     28  1.3.4.2  rmind  * Software Foundation.
     29  1.3.4.2  rmind  *
     30  1.3.4.2  rmind  * NO WARRANTY
     31  1.3.4.2  rmind  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32  1.3.4.2  rmind  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33  1.3.4.2  rmind  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34  1.3.4.2  rmind  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35  1.3.4.2  rmind  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36  1.3.4.2  rmind  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37  1.3.4.2  rmind  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38  1.3.4.2  rmind  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39  1.3.4.2  rmind  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40  1.3.4.2  rmind  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41  1.3.4.2  rmind  * POSSIBILITY OF SUCH DAMAGES.
     42  1.3.4.2  rmind  */
     43  1.3.4.2  rmind 
     44  1.3.4.2  rmind 
     45  1.3.4.2  rmind #include "acpi.h"
     46  1.3.4.2  rmind #include "accommon.h"
     47  1.3.4.2  rmind #include "acevents.h"
     48  1.3.4.2  rmind #include "acdebug.h"
     49  1.3.4.2  rmind #include "acresrc.h"
     50  1.3.4.2  rmind #include "actables.h"
     51  1.3.4.2  rmind 
     52  1.3.4.2  rmind #ifdef ACPI_DEBUGGER
     53  1.3.4.2  rmind 
     54  1.3.4.2  rmind #define _COMPONENT          ACPI_CA_DEBUGGER
     55  1.3.4.2  rmind         ACPI_MODULE_NAME    ("dbcmds")
     56  1.3.4.2  rmind 
     57  1.3.4.2  rmind 
     58  1.3.4.2  rmind /* Local prototypes */
     59  1.3.4.2  rmind 
     60  1.3.4.2  rmind static void
     61  1.3.4.2  rmind AcpiDmCompareAmlResources (
     62  1.3.4.2  rmind     UINT8                   *Aml1Buffer,
     63  1.3.4.2  rmind     ACPI_RSDESC_SIZE        Aml1BufferLength,
     64  1.3.4.2  rmind     UINT8                   *Aml2Buffer,
     65  1.3.4.2  rmind     ACPI_RSDESC_SIZE        Aml2BufferLength);
     66  1.3.4.2  rmind 
     67  1.3.4.2  rmind static ACPI_STATUS
     68  1.3.4.2  rmind AcpiDmTestResourceConversion (
     69  1.3.4.2  rmind     ACPI_NAMESPACE_NODE     *Node,
     70  1.3.4.2  rmind     char                    *Name);
     71  1.3.4.2  rmind 
     72  1.3.4.2  rmind 
     73  1.3.4.2  rmind /*******************************************************************************
     74  1.3.4.2  rmind  *
     75  1.3.4.2  rmind  * FUNCTION:    AcpiDbConvertToNode
     76  1.3.4.2  rmind  *
     77  1.3.4.2  rmind  * PARAMETERS:  InString        - String to convert
     78  1.3.4.2  rmind  *
     79  1.3.4.2  rmind  * RETURN:      Pointer to a NS node
     80  1.3.4.2  rmind  *
     81  1.3.4.2  rmind  * DESCRIPTION: Convert a string to a valid NS pointer.  Handles numeric or
     82  1.3.4.2  rmind  *              alpha strings.
     83  1.3.4.2  rmind  *
     84  1.3.4.2  rmind  ******************************************************************************/
     85  1.3.4.2  rmind 
     86  1.3.4.2  rmind ACPI_NAMESPACE_NODE *
     87  1.3.4.2  rmind AcpiDbConvertToNode (
     88  1.3.4.2  rmind     char                    *InString)
     89  1.3.4.2  rmind {
     90  1.3.4.2  rmind     ACPI_NAMESPACE_NODE     *Node;
     91  1.3.4.2  rmind 
     92  1.3.4.2  rmind 
     93  1.3.4.2  rmind     if ((*InString >= 0x30) && (*InString <= 0x39))
     94  1.3.4.2  rmind     {
     95  1.3.4.2  rmind         /* Numeric argument, convert */
     96  1.3.4.2  rmind 
     97  1.3.4.2  rmind         Node = ACPI_TO_POINTER (ACPI_STRTOUL (InString, NULL, 16));
     98  1.3.4.2  rmind         if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
     99  1.3.4.2  rmind         {
    100  1.3.4.2  rmind             AcpiOsPrintf ("Address %p is invalid in this address space\n",
    101  1.3.4.2  rmind                 Node);
    102  1.3.4.2  rmind             return (NULL);
    103  1.3.4.2  rmind         }
    104  1.3.4.2  rmind 
    105  1.3.4.2  rmind         /* Make sure pointer is valid NS node */
    106  1.3.4.2  rmind 
    107  1.3.4.2  rmind         if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
    108  1.3.4.2  rmind         {
    109  1.3.4.2  rmind             AcpiOsPrintf ("Address %p is not a valid NS node [%s]\n",
    110  1.3.4.2  rmind                     Node, AcpiUtGetDescriptorName (Node));
    111  1.3.4.2  rmind             return (NULL);
    112  1.3.4.2  rmind         }
    113  1.3.4.2  rmind     }
    114  1.3.4.2  rmind     else
    115  1.3.4.2  rmind     {
    116  1.3.4.2  rmind         /* Alpha argument */
    117  1.3.4.2  rmind         /* The parameter is a name string that must be resolved to a
    118  1.3.4.2  rmind          * Named obj
    119  1.3.4.2  rmind          */
    120  1.3.4.2  rmind         Node = AcpiDbLocalNsLookup (InString);
    121  1.3.4.2  rmind         if (!Node)
    122  1.3.4.2  rmind         {
    123  1.3.4.2  rmind             Node = AcpiGbl_RootNode;
    124  1.3.4.2  rmind         }
    125  1.3.4.2  rmind     }
    126  1.3.4.2  rmind 
    127  1.3.4.2  rmind     return (Node);
    128  1.3.4.2  rmind }
    129  1.3.4.2  rmind 
    130  1.3.4.2  rmind 
    131  1.3.4.2  rmind /*******************************************************************************
    132  1.3.4.2  rmind  *
    133  1.3.4.2  rmind  * FUNCTION:    AcpiDbSleep
    134  1.3.4.2  rmind  *
    135  1.3.4.2  rmind  * PARAMETERS:  ObjectArg       - Desired sleep state (0-5)
    136  1.3.4.2  rmind  *
    137  1.3.4.2  rmind  * RETURN:      Status
    138  1.3.4.2  rmind  *
    139  1.3.4.2  rmind  * DESCRIPTION: Simulate a sleep/wake sequence
    140  1.3.4.2  rmind  *
    141  1.3.4.2  rmind  ******************************************************************************/
    142  1.3.4.2  rmind 
    143  1.3.4.2  rmind ACPI_STATUS
    144  1.3.4.2  rmind AcpiDbSleep (
    145  1.3.4.2  rmind     char                    *ObjectArg)
    146  1.3.4.2  rmind {
    147  1.3.4.2  rmind     ACPI_STATUS             Status;
    148  1.3.4.2  rmind     UINT8                   SleepState;
    149  1.3.4.2  rmind 
    150  1.3.4.2  rmind 
    151  1.3.4.2  rmind     SleepState = (UINT8) ACPI_STRTOUL (ObjectArg, NULL, 0);
    152  1.3.4.2  rmind 
    153  1.3.4.2  rmind     AcpiOsPrintf ("**** Prepare to sleep ****\n");
    154  1.3.4.2  rmind     Status = AcpiEnterSleepStatePrep (SleepState);
    155  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    156  1.3.4.2  rmind     {
    157  1.3.4.2  rmind         return (Status);
    158  1.3.4.2  rmind     }
    159  1.3.4.2  rmind 
    160  1.3.4.2  rmind     AcpiOsPrintf ("**** Going to sleep ****\n");
    161  1.3.4.2  rmind     Status = AcpiEnterSleepState (SleepState);
    162  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    163  1.3.4.2  rmind     {
    164  1.3.4.2  rmind         return (Status);
    165  1.3.4.2  rmind     }
    166  1.3.4.2  rmind 
    167  1.3.4.2  rmind     AcpiOsPrintf ("**** returning from sleep ****\n");
    168  1.3.4.2  rmind     Status = AcpiLeaveSleepState (SleepState);
    169  1.3.4.2  rmind 
    170  1.3.4.2  rmind     return (Status);
    171  1.3.4.2  rmind }
    172  1.3.4.2  rmind 
    173  1.3.4.2  rmind /*******************************************************************************
    174  1.3.4.2  rmind  *
    175  1.3.4.2  rmind  * FUNCTION:    AcpiDbDisplayLocks
    176  1.3.4.2  rmind  *
    177  1.3.4.2  rmind  * PARAMETERS:  None
    178  1.3.4.2  rmind  *
    179  1.3.4.2  rmind  * RETURN:      None
    180  1.3.4.2  rmind  *
    181  1.3.4.2  rmind  * DESCRIPTION: Display information about internal mutexes.
    182  1.3.4.2  rmind  *
    183  1.3.4.2  rmind  ******************************************************************************/
    184  1.3.4.2  rmind 
    185  1.3.4.2  rmind void
    186  1.3.4.2  rmind AcpiDbDisplayLocks (
    187  1.3.4.2  rmind     void)
    188  1.3.4.2  rmind {
    189  1.3.4.2  rmind     UINT32                  i;
    190  1.3.4.2  rmind 
    191  1.3.4.2  rmind 
    192  1.3.4.2  rmind     for (i = 0; i < ACPI_MAX_MUTEX; i++)
    193  1.3.4.2  rmind     {
    194  1.3.4.2  rmind         AcpiOsPrintf ("%26s : %s\n", AcpiUtGetMutexName (i),
    195  1.3.4.2  rmind             AcpiGbl_MutexInfo[i].ThreadId == ACPI_MUTEX_NOT_ACQUIRED
    196  1.3.4.2  rmind                 ? "Locked" : "Unlocked");
    197  1.3.4.2  rmind     }
    198  1.3.4.2  rmind }
    199  1.3.4.2  rmind 
    200  1.3.4.2  rmind 
    201  1.3.4.2  rmind /*******************************************************************************
    202  1.3.4.2  rmind  *
    203  1.3.4.2  rmind  * FUNCTION:    AcpiDbDisplayTableInfo
    204  1.3.4.2  rmind  *
    205  1.3.4.2  rmind  * PARAMETERS:  TableArg        - String with name of table to be displayed
    206  1.3.4.2  rmind  *
    207  1.3.4.2  rmind  * RETURN:      None
    208  1.3.4.2  rmind  *
    209  1.3.4.2  rmind  * DESCRIPTION: Display information about loaded tables.  Current
    210  1.3.4.2  rmind  *              implementation displays all loaded tables.
    211  1.3.4.2  rmind  *
    212  1.3.4.2  rmind  ******************************************************************************/
    213  1.3.4.2  rmind 
    214  1.3.4.2  rmind void
    215  1.3.4.2  rmind AcpiDbDisplayTableInfo (
    216  1.3.4.2  rmind     char                    *TableArg)
    217  1.3.4.2  rmind {
    218  1.3.4.2  rmind     UINT32                  i;
    219  1.3.4.2  rmind     ACPI_TABLE_DESC         *TableDesc;
    220  1.3.4.2  rmind     ACPI_STATUS             Status;
    221  1.3.4.2  rmind 
    222  1.3.4.2  rmind 
    223  1.3.4.2  rmind     /* Walk the entire root table list */
    224  1.3.4.2  rmind 
    225  1.3.4.2  rmind     for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
    226  1.3.4.2  rmind     {
    227  1.3.4.2  rmind         TableDesc = &AcpiGbl_RootTableList.Tables[i];
    228  1.3.4.2  rmind         AcpiOsPrintf ("%u ", i);
    229  1.3.4.2  rmind 
    230  1.3.4.2  rmind         /* Make sure that the table is mapped */
    231  1.3.4.2  rmind 
    232  1.3.4.2  rmind         Status = AcpiTbVerifyTable (TableDesc);
    233  1.3.4.2  rmind         if (ACPI_FAILURE (Status))
    234  1.3.4.2  rmind         {
    235  1.3.4.2  rmind             return;
    236  1.3.4.2  rmind         }
    237  1.3.4.2  rmind 
    238  1.3.4.2  rmind         /* Dump the table header */
    239  1.3.4.2  rmind 
    240  1.3.4.2  rmind         if (TableDesc->Pointer)
    241  1.3.4.2  rmind         {
    242  1.3.4.2  rmind             AcpiTbPrintTableHeader (TableDesc->Address, TableDesc->Pointer);
    243  1.3.4.2  rmind         }
    244  1.3.4.2  rmind         else
    245  1.3.4.2  rmind         {
    246  1.3.4.2  rmind             /* If the pointer is null, the table has been unloaded */
    247  1.3.4.2  rmind 
    248  1.3.4.2  rmind             ACPI_INFO ((AE_INFO, "%4.4s - Table has been unloaded",
    249  1.3.4.2  rmind                 TableDesc->Signature.Ascii));
    250  1.3.4.2  rmind         }
    251  1.3.4.2  rmind     }
    252  1.3.4.2  rmind }
    253  1.3.4.2  rmind 
    254  1.3.4.2  rmind 
    255  1.3.4.2  rmind /*******************************************************************************
    256  1.3.4.2  rmind  *
    257  1.3.4.2  rmind  * FUNCTION:    AcpiDbUnloadAcpiTable
    258  1.3.4.2  rmind  *
    259  1.3.4.2  rmind  * PARAMETERS:  TableArg        - Name of the table to be unloaded
    260  1.3.4.2  rmind  *              InstanceArg     - Which instance of the table to unload (if
    261  1.3.4.2  rmind  *                                there are multiple tables of the same type)
    262  1.3.4.2  rmind  *
    263  1.3.4.2  rmind  * RETURN:      Nonde
    264  1.3.4.2  rmind  *
    265  1.3.4.2  rmind  * DESCRIPTION: Unload an ACPI table.
    266  1.3.4.2  rmind  *              Instance is not implemented
    267  1.3.4.2  rmind  *
    268  1.3.4.2  rmind  ******************************************************************************/
    269  1.3.4.2  rmind 
    270  1.3.4.2  rmind void
    271  1.3.4.2  rmind AcpiDbUnloadAcpiTable (
    272  1.3.4.2  rmind     char                    *TableArg,
    273  1.3.4.2  rmind     char                    *InstanceArg)
    274  1.3.4.2  rmind {
    275  1.3.4.2  rmind /* TBD: Need to reimplement for new data structures */
    276  1.3.4.2  rmind 
    277  1.3.4.2  rmind #if 0
    278  1.3.4.2  rmind     UINT32                  i;
    279  1.3.4.2  rmind     ACPI_STATUS             Status;
    280  1.3.4.2  rmind 
    281  1.3.4.2  rmind 
    282  1.3.4.2  rmind     /* Search all tables for the target type */
    283  1.3.4.2  rmind 
    284  1.3.4.2  rmind     for (i = 0; i < (ACPI_TABLE_ID_MAX+1); i++)
    285  1.3.4.2  rmind     {
    286  1.3.4.2  rmind         if (!ACPI_STRNCMP (TableArg, AcpiGbl_TableData[i].Signature,
    287  1.3.4.2  rmind                 AcpiGbl_TableData[i].SigLength))
    288  1.3.4.2  rmind         {
    289  1.3.4.2  rmind             /* Found the table, unload it */
    290  1.3.4.2  rmind 
    291  1.3.4.2  rmind             Status = AcpiUnloadTable (i);
    292  1.3.4.2  rmind             if (ACPI_SUCCESS (Status))
    293  1.3.4.2  rmind             {
    294  1.3.4.2  rmind                 AcpiOsPrintf ("[%s] unloaded and uninstalled\n", TableArg);
    295  1.3.4.2  rmind             }
    296  1.3.4.2  rmind             else
    297  1.3.4.2  rmind             {
    298  1.3.4.2  rmind                 AcpiOsPrintf ("%s, while unloading [%s]\n",
    299  1.3.4.2  rmind                     AcpiFormatException (Status), TableArg);
    300  1.3.4.2  rmind             }
    301  1.3.4.2  rmind 
    302  1.3.4.2  rmind             return;
    303  1.3.4.2  rmind         }
    304  1.3.4.2  rmind     }
    305  1.3.4.2  rmind 
    306  1.3.4.2  rmind     AcpiOsPrintf ("Unknown table type [%s]\n", TableArg);
    307  1.3.4.2  rmind #endif
    308  1.3.4.2  rmind }
    309  1.3.4.2  rmind 
    310  1.3.4.2  rmind 
    311  1.3.4.2  rmind /*******************************************************************************
    312  1.3.4.2  rmind  *
    313  1.3.4.2  rmind  * FUNCTION:    AcpiDbSendNotify
    314  1.3.4.2  rmind  *
    315  1.3.4.2  rmind  * PARAMETERS:  Name            - Name of ACPI object to send the notify to
    316  1.3.4.2  rmind  *              Value           - Value of the notify to send.
    317  1.3.4.2  rmind  *
    318  1.3.4.2  rmind  * RETURN:      None
    319  1.3.4.2  rmind  *
    320  1.3.4.2  rmind  * DESCRIPTION: Send an ACPI notification.  The value specified is sent to the
    321  1.3.4.2  rmind  *              named object as an ACPI notify.
    322  1.3.4.2  rmind  *
    323  1.3.4.2  rmind  ******************************************************************************/
    324  1.3.4.2  rmind 
    325  1.3.4.2  rmind void
    326  1.3.4.2  rmind AcpiDbSendNotify (
    327  1.3.4.2  rmind     char                    *Name,
    328  1.3.4.2  rmind     UINT32                  Value)
    329  1.3.4.2  rmind {
    330  1.3.4.2  rmind     ACPI_NAMESPACE_NODE     *Node;
    331  1.3.4.2  rmind     ACPI_STATUS             Status;
    332  1.3.4.2  rmind 
    333  1.3.4.2  rmind 
    334  1.3.4.2  rmind     /* Translate name to an Named object */
    335  1.3.4.2  rmind 
    336  1.3.4.2  rmind     Node = AcpiDbConvertToNode (Name);
    337  1.3.4.2  rmind     if (!Node)
    338  1.3.4.2  rmind     {
    339  1.3.4.2  rmind         return;
    340  1.3.4.2  rmind     }
    341  1.3.4.2  rmind 
    342  1.3.4.2  rmind     /* Decode Named object type */
    343  1.3.4.2  rmind 
    344  1.3.4.2  rmind     switch (Node->Type)
    345  1.3.4.2  rmind     {
    346  1.3.4.2  rmind     case ACPI_TYPE_DEVICE:
    347  1.3.4.2  rmind     case ACPI_TYPE_THERMAL:
    348  1.3.4.2  rmind 
    349  1.3.4.2  rmind          /* Send the notify */
    350  1.3.4.2  rmind 
    351  1.3.4.2  rmind         Status = AcpiEvQueueNotifyRequest (Node, Value);
    352  1.3.4.2  rmind         if (ACPI_FAILURE (Status))
    353  1.3.4.2  rmind         {
    354  1.3.4.2  rmind             AcpiOsPrintf ("Could not queue notify\n");
    355  1.3.4.2  rmind         }
    356  1.3.4.2  rmind         break;
    357  1.3.4.2  rmind 
    358  1.3.4.2  rmind     default:
    359  1.3.4.2  rmind         AcpiOsPrintf ("Named object is not a device or a thermal object\n");
    360  1.3.4.2  rmind         break;
    361  1.3.4.2  rmind     }
    362  1.3.4.2  rmind }
    363  1.3.4.2  rmind 
    364  1.3.4.2  rmind 
    365  1.3.4.2  rmind /*******************************************************************************
    366  1.3.4.2  rmind  *
    367  1.3.4.2  rmind  * FUNCTION:    AcpiDbDisplayInterfaces
    368  1.3.4.2  rmind  *
    369  1.3.4.2  rmind  * PARAMETERS:  ActionArg           - Null, "install", or "remove"
    370  1.3.4.2  rmind  *              InterfaceNameArg    - Name for install/remove options
    371  1.3.4.2  rmind  *
    372  1.3.4.2  rmind  * RETURN:      None
    373  1.3.4.2  rmind  *
    374  1.3.4.2  rmind  * DESCRIPTION: Display or modify the global _OSI interface list
    375  1.3.4.2  rmind  *
    376  1.3.4.2  rmind  ******************************************************************************/
    377  1.3.4.2  rmind 
    378  1.3.4.2  rmind void
    379  1.3.4.2  rmind AcpiDbDisplayInterfaces (
    380  1.3.4.2  rmind     char                    *ActionArg,
    381  1.3.4.2  rmind     char                    *InterfaceNameArg)
    382  1.3.4.2  rmind {
    383  1.3.4.2  rmind     ACPI_INTERFACE_INFO     *NextInterface;
    384  1.3.4.2  rmind     char                    *SubString;
    385  1.3.4.2  rmind     ACPI_STATUS             Status;
    386  1.3.4.2  rmind 
    387  1.3.4.2  rmind 
    388  1.3.4.2  rmind     /* If no arguments, just display current interface list */
    389  1.3.4.2  rmind 
    390  1.3.4.2  rmind     if (!ActionArg)
    391  1.3.4.2  rmind     {
    392  1.3.4.2  rmind         (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex,
    393  1.3.4.2  rmind                     ACPI_WAIT_FOREVER);
    394  1.3.4.2  rmind 
    395  1.3.4.2  rmind         NextInterface = AcpiGbl_SupportedInterfaces;
    396  1.3.4.2  rmind 
    397  1.3.4.2  rmind         while (NextInterface)
    398  1.3.4.2  rmind         {
    399  1.3.4.2  rmind             if (!(NextInterface->Flags & ACPI_OSI_INVALID))
    400  1.3.4.2  rmind             {
    401  1.3.4.2  rmind                 AcpiOsPrintf ("%s\n", NextInterface->Name);
    402  1.3.4.2  rmind             }
    403  1.3.4.2  rmind             NextInterface = NextInterface->Next;
    404  1.3.4.2  rmind         }
    405  1.3.4.2  rmind 
    406  1.3.4.2  rmind         AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
    407  1.3.4.2  rmind         return;
    408  1.3.4.2  rmind     }
    409  1.3.4.2  rmind 
    410  1.3.4.2  rmind     /* If ActionArg exists, so must InterfaceNameArg */
    411  1.3.4.2  rmind 
    412  1.3.4.2  rmind     if (!InterfaceNameArg)
    413  1.3.4.2  rmind     {
    414  1.3.4.2  rmind         AcpiOsPrintf ("Missing Interface Name argument\n");
    415  1.3.4.2  rmind         return;
    416  1.3.4.2  rmind     }
    417  1.3.4.2  rmind 
    418  1.3.4.2  rmind     /* Uppercase the action for match below */
    419  1.3.4.2  rmind 
    420  1.3.4.2  rmind     AcpiUtStrupr (ActionArg);
    421  1.3.4.2  rmind 
    422  1.3.4.2  rmind     /* Install - install an interface */
    423  1.3.4.2  rmind 
    424  1.3.4.2  rmind     SubString = ACPI_STRSTR ("INSTALL", ActionArg);
    425  1.3.4.2  rmind     if (SubString)
    426  1.3.4.2  rmind     {
    427  1.3.4.2  rmind         Status = AcpiInstallInterface (InterfaceNameArg);
    428  1.3.4.2  rmind         if (ACPI_FAILURE (Status))
    429  1.3.4.2  rmind         {
    430  1.3.4.2  rmind             AcpiOsPrintf ("%s, while installing \"%s\"\n",
    431  1.3.4.2  rmind                 AcpiFormatException (Status), InterfaceNameArg);
    432  1.3.4.2  rmind         }
    433  1.3.4.2  rmind         return;
    434  1.3.4.2  rmind     }
    435  1.3.4.2  rmind 
    436  1.3.4.2  rmind     /* Remove - remove an interface */
    437  1.3.4.2  rmind 
    438  1.3.4.2  rmind     SubString = ACPI_STRSTR ("REMOVE", ActionArg);
    439  1.3.4.2  rmind     if (SubString)
    440  1.3.4.2  rmind     {
    441  1.3.4.2  rmind         Status = AcpiRemoveInterface (InterfaceNameArg);
    442  1.3.4.2  rmind         if (ACPI_FAILURE (Status))
    443  1.3.4.2  rmind         {
    444  1.3.4.2  rmind             AcpiOsPrintf ("%s, while removing \"%s\"\n",
    445  1.3.4.2  rmind                 AcpiFormatException (Status), InterfaceNameArg);
    446  1.3.4.2  rmind         }
    447  1.3.4.2  rmind         return;
    448  1.3.4.2  rmind     }
    449  1.3.4.2  rmind 
    450  1.3.4.2  rmind     /* Invalid ActionArg */
    451  1.3.4.2  rmind 
    452  1.3.4.2  rmind     AcpiOsPrintf ("Invalid action argument: %s\n", ActionArg);
    453  1.3.4.2  rmind     return;
    454  1.3.4.2  rmind }
    455  1.3.4.2  rmind 
    456  1.3.4.2  rmind 
    457  1.3.4.2  rmind /*******************************************************************************
    458  1.3.4.2  rmind  *
    459  1.3.4.2  rmind  * FUNCTION:    AcpiDmCompareAmlResources
    460  1.3.4.2  rmind  *
    461  1.3.4.2  rmind  * PARAMETERS:  Aml1Buffer          - Contains first resource list
    462  1.3.4.2  rmind  *              Aml1BufferLength    - Length of first resource list
    463  1.3.4.2  rmind  *              Aml2Buffer          - Contains second resource list
    464  1.3.4.2  rmind  *              Aml2BufferLength    - Length of second resource list
    465  1.3.4.2  rmind  *
    466  1.3.4.2  rmind  * RETURN:      None
    467  1.3.4.2  rmind  *
    468  1.3.4.2  rmind  * DESCRIPTION: Compare two AML resource lists, descriptor by descriptor (in
    469  1.3.4.2  rmind  *              order to isolate a miscompare to an individual resource)
    470  1.3.4.2  rmind  *
    471  1.3.4.2  rmind  ******************************************************************************/
    472  1.3.4.2  rmind 
    473  1.3.4.2  rmind static void
    474  1.3.4.2  rmind AcpiDmCompareAmlResources (
    475  1.3.4.2  rmind     UINT8                   *Aml1Buffer,
    476  1.3.4.2  rmind     ACPI_RSDESC_SIZE        Aml1BufferLength,
    477  1.3.4.2  rmind     UINT8                   *Aml2Buffer,
    478  1.3.4.2  rmind     ACPI_RSDESC_SIZE        Aml2BufferLength)
    479  1.3.4.2  rmind {
    480  1.3.4.2  rmind     UINT8                   *Aml1;
    481  1.3.4.2  rmind     UINT8                   *Aml2;
    482  1.3.4.2  rmind     ACPI_RSDESC_SIZE        Aml1Length;
    483  1.3.4.2  rmind     ACPI_RSDESC_SIZE        Aml2Length;
    484  1.3.4.2  rmind     ACPI_RSDESC_SIZE        Offset = 0;
    485  1.3.4.2  rmind     UINT8                   ResourceType;
    486  1.3.4.2  rmind     UINT32                  Count = 0;
    487  1.3.4.2  rmind 
    488  1.3.4.2  rmind 
    489  1.3.4.2  rmind     /* Compare overall buffer sizes (may be different due to size rounding) */
    490  1.3.4.2  rmind 
    491  1.3.4.2  rmind     if (Aml1BufferLength != Aml2BufferLength)
    492  1.3.4.2  rmind     {
    493  1.3.4.2  rmind         AcpiOsPrintf (
    494  1.3.4.2  rmind             "**** Buffer length mismatch in converted AML: original %X new %X ****\n",
    495  1.3.4.2  rmind             Aml1BufferLength, Aml2BufferLength);
    496  1.3.4.2  rmind     }
    497  1.3.4.2  rmind 
    498  1.3.4.2  rmind     Aml1 = Aml1Buffer;
    499  1.3.4.2  rmind     Aml2 = Aml2Buffer;
    500  1.3.4.2  rmind 
    501  1.3.4.2  rmind     /* Walk the descriptor lists, comparing each descriptor */
    502  1.3.4.2  rmind 
    503  1.3.4.2  rmind     while (Aml1 < (Aml1Buffer + Aml1BufferLength))
    504  1.3.4.2  rmind     {
    505  1.3.4.2  rmind         /* Get the lengths of each descriptor */
    506  1.3.4.2  rmind 
    507  1.3.4.2  rmind         Aml1Length = AcpiUtGetDescriptorLength (Aml1);
    508  1.3.4.2  rmind         Aml2Length = AcpiUtGetDescriptorLength (Aml2);
    509  1.3.4.2  rmind         ResourceType = AcpiUtGetResourceType (Aml1);
    510  1.3.4.2  rmind 
    511  1.3.4.2  rmind         /* Check for descriptor length match */
    512  1.3.4.2  rmind 
    513  1.3.4.2  rmind         if (Aml1Length != Aml2Length)
    514  1.3.4.2  rmind         {
    515  1.3.4.2  rmind             AcpiOsPrintf (
    516  1.3.4.2  rmind                 "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X L1 %X L2 %X ****\n",
    517  1.3.4.2  rmind                 Count, ResourceType, Offset, Aml1Length, Aml2Length);
    518  1.3.4.2  rmind         }
    519  1.3.4.2  rmind 
    520  1.3.4.2  rmind         /* Check for descriptor byte match */
    521  1.3.4.2  rmind 
    522  1.3.4.2  rmind         else if (ACPI_MEMCMP (Aml1, Aml2, Aml1Length))
    523  1.3.4.2  rmind         {
    524  1.3.4.2  rmind             AcpiOsPrintf (
    525  1.3.4.2  rmind                 "**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n",
    526  1.3.4.2  rmind                 Count, ResourceType, Offset);
    527  1.3.4.2  rmind         }
    528  1.3.4.2  rmind 
    529  1.3.4.2  rmind         /* Exit on EndTag descriptor */
    530  1.3.4.2  rmind 
    531  1.3.4.2  rmind         if (ResourceType == ACPI_RESOURCE_NAME_END_TAG)
    532  1.3.4.2  rmind         {
    533  1.3.4.2  rmind             return;
    534  1.3.4.2  rmind         }
    535  1.3.4.2  rmind 
    536  1.3.4.2  rmind         /* Point to next descriptor in each buffer */
    537  1.3.4.2  rmind 
    538  1.3.4.2  rmind         Count++;
    539  1.3.4.2  rmind         Offset += Aml1Length;
    540  1.3.4.2  rmind         Aml1 += Aml1Length;
    541  1.3.4.2  rmind         Aml2 += Aml2Length;
    542  1.3.4.2  rmind     }
    543  1.3.4.2  rmind }
    544  1.3.4.2  rmind 
    545  1.3.4.2  rmind 
    546  1.3.4.2  rmind /*******************************************************************************
    547  1.3.4.2  rmind  *
    548  1.3.4.2  rmind  * FUNCTION:    AcpiDmTestResourceConversion
    549  1.3.4.2  rmind  *
    550  1.3.4.2  rmind  * PARAMETERS:  Node            - Parent device node
    551  1.3.4.2  rmind  *              Name            - resource method name (_CRS)
    552  1.3.4.2  rmind  *
    553  1.3.4.2  rmind  * RETURN:      Status
    554  1.3.4.2  rmind  *
    555  1.3.4.2  rmind  * DESCRIPTION: Compare the original AML with a conversion of the AML to
    556  1.3.4.2  rmind  *              internal resource list, then back to AML.
    557  1.3.4.2  rmind  *
    558  1.3.4.2  rmind  ******************************************************************************/
    559  1.3.4.2  rmind 
    560  1.3.4.2  rmind static ACPI_STATUS
    561  1.3.4.2  rmind AcpiDmTestResourceConversion (
    562  1.3.4.2  rmind     ACPI_NAMESPACE_NODE     *Node,
    563  1.3.4.2  rmind     char                    *Name)
    564  1.3.4.2  rmind {
    565  1.3.4.2  rmind     ACPI_STATUS             Status;
    566  1.3.4.2  rmind     ACPI_BUFFER             ReturnObj;
    567  1.3.4.2  rmind     ACPI_BUFFER             ResourceObj;
    568  1.3.4.2  rmind     ACPI_BUFFER             NewAml;
    569  1.3.4.2  rmind     ACPI_OBJECT             *OriginalAml;
    570  1.3.4.2  rmind 
    571  1.3.4.2  rmind 
    572  1.3.4.2  rmind     AcpiOsPrintf ("Resource Conversion Comparison:\n");
    573  1.3.4.2  rmind 
    574  1.3.4.2  rmind     NewAml.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
    575  1.3.4.2  rmind     ReturnObj.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
    576  1.3.4.2  rmind     ResourceObj.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
    577  1.3.4.2  rmind 
    578  1.3.4.2  rmind     /* Get the original _CRS AML resource template */
    579  1.3.4.2  rmind 
    580  1.3.4.2  rmind     Status = AcpiEvaluateObject (Node, Name, NULL, &ReturnObj);
    581  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    582  1.3.4.2  rmind     {
    583  1.3.4.2  rmind         AcpiOsPrintf ("Could not obtain %s: %s\n",
    584  1.3.4.2  rmind             Name, AcpiFormatException (Status));
    585  1.3.4.2  rmind         return (Status);
    586  1.3.4.2  rmind     }
    587  1.3.4.2  rmind 
    588  1.3.4.2  rmind     /* Get the AML resource template, converted to internal resource structs */
    589  1.3.4.2  rmind 
    590  1.3.4.2  rmind     Status = AcpiGetCurrentResources (Node, &ResourceObj);
    591  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    592  1.3.4.2  rmind     {
    593  1.3.4.2  rmind         AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n",
    594  1.3.4.2  rmind             AcpiFormatException (Status));
    595  1.3.4.2  rmind         goto Exit1;
    596  1.3.4.2  rmind     }
    597  1.3.4.2  rmind 
    598  1.3.4.2  rmind     /* Convert internal resource list to external AML resource template */
    599  1.3.4.2  rmind 
    600  1.3.4.2  rmind     Status = AcpiRsCreateAmlResources (ResourceObj.Pointer, &NewAml);
    601  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    602  1.3.4.2  rmind     {
    603  1.3.4.2  rmind         AcpiOsPrintf ("AcpiRsCreateAmlResources failed: %s\n",
    604  1.3.4.2  rmind             AcpiFormatException (Status));
    605  1.3.4.2  rmind         goto Exit2;
    606  1.3.4.2  rmind     }
    607  1.3.4.2  rmind 
    608  1.3.4.2  rmind     /* Compare original AML to the newly created AML resource list */
    609  1.3.4.2  rmind 
    610  1.3.4.2  rmind     OriginalAml = ReturnObj.Pointer;
    611  1.3.4.2  rmind 
    612  1.3.4.2  rmind     AcpiDmCompareAmlResources (
    613  1.3.4.2  rmind         OriginalAml->Buffer.Pointer, (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
    614  1.3.4.2  rmind         NewAml.Pointer, (ACPI_RSDESC_SIZE) NewAml.Length);
    615  1.3.4.2  rmind 
    616  1.3.4.2  rmind     /* Cleanup and exit */
    617  1.3.4.2  rmind 
    618  1.3.4.2  rmind     ACPI_FREE (NewAml.Pointer);
    619  1.3.4.2  rmind Exit2:
    620  1.3.4.2  rmind     ACPI_FREE (ResourceObj.Pointer);
    621  1.3.4.2  rmind Exit1:
    622  1.3.4.2  rmind     ACPI_FREE (ReturnObj.Pointer);
    623  1.3.4.2  rmind     return (Status);
    624  1.3.4.2  rmind }
    625  1.3.4.2  rmind 
    626  1.3.4.2  rmind 
    627  1.3.4.2  rmind /*******************************************************************************
    628  1.3.4.2  rmind  *
    629  1.3.4.2  rmind  * FUNCTION:    AcpiDbDisplayResources
    630  1.3.4.2  rmind  *
    631  1.3.4.2  rmind  * PARAMETERS:  ObjectArg       - String with hex value of the object
    632  1.3.4.2  rmind  *
    633  1.3.4.2  rmind  * RETURN:      None
    634  1.3.4.2  rmind  *
    635  1.3.4.2  rmind  * DESCRIPTION: Display the resource objects associated with a device.
    636  1.3.4.2  rmind  *
    637  1.3.4.2  rmind  ******************************************************************************/
    638  1.3.4.2  rmind 
    639  1.3.4.2  rmind void
    640  1.3.4.2  rmind AcpiDbDisplayResources (
    641  1.3.4.2  rmind     char                    *ObjectArg)
    642  1.3.4.2  rmind {
    643  1.3.4.2  rmind     ACPI_NAMESPACE_NODE     *Node;
    644  1.3.4.2  rmind     ACPI_STATUS             Status;
    645  1.3.4.2  rmind     ACPI_BUFFER             ReturnObj;
    646  1.3.4.2  rmind 
    647  1.3.4.2  rmind 
    648  1.3.4.2  rmind     AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
    649  1.3.4.2  rmind     AcpiDbgLevel |= ACPI_LV_RESOURCES;
    650  1.3.4.2  rmind 
    651  1.3.4.2  rmind     /* Convert string to object pointer */
    652  1.3.4.2  rmind 
    653  1.3.4.2  rmind     Node = AcpiDbConvertToNode (ObjectArg);
    654  1.3.4.2  rmind     if (!Node)
    655  1.3.4.2  rmind     {
    656  1.3.4.2  rmind         return;
    657  1.3.4.2  rmind     }
    658  1.3.4.2  rmind 
    659  1.3.4.2  rmind     /* Prepare for a return object of arbitrary size */
    660  1.3.4.2  rmind 
    661  1.3.4.2  rmind     ReturnObj.Pointer = AcpiGbl_DbBuffer;
    662  1.3.4.2  rmind     ReturnObj.Length  = ACPI_DEBUG_BUFFER_SIZE;
    663  1.3.4.2  rmind 
    664  1.3.4.2  rmind     /* _PRT */
    665  1.3.4.2  rmind 
    666  1.3.4.2  rmind     AcpiOsPrintf ("Evaluating _PRT\n");
    667  1.3.4.2  rmind 
    668  1.3.4.2  rmind     /* Check if _PRT exists */
    669  1.3.4.2  rmind 
    670  1.3.4.2  rmind     Status = AcpiEvaluateObject (Node, METHOD_NAME__PRT, NULL, &ReturnObj);
    671  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    672  1.3.4.2  rmind     {
    673  1.3.4.2  rmind         AcpiOsPrintf ("Could not obtain _PRT: %s\n",
    674  1.3.4.2  rmind             AcpiFormatException (Status));
    675  1.3.4.2  rmind         goto GetCrs;
    676  1.3.4.2  rmind     }
    677  1.3.4.2  rmind 
    678  1.3.4.2  rmind     ReturnObj.Pointer = AcpiGbl_DbBuffer;
    679  1.3.4.2  rmind     ReturnObj.Length  = ACPI_DEBUG_BUFFER_SIZE;
    680  1.3.4.2  rmind 
    681  1.3.4.2  rmind     Status = AcpiGetIrqRoutingTable (Node, &ReturnObj);
    682  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    683  1.3.4.2  rmind     {
    684  1.3.4.2  rmind         AcpiOsPrintf ("GetIrqRoutingTable failed: %s\n",
    685  1.3.4.2  rmind             AcpiFormatException (Status));
    686  1.3.4.2  rmind         goto GetCrs;
    687  1.3.4.2  rmind     }
    688  1.3.4.2  rmind 
    689  1.3.4.2  rmind     AcpiRsDumpIrqList (ACPI_CAST_PTR (UINT8, AcpiGbl_DbBuffer));
    690  1.3.4.2  rmind 
    691  1.3.4.2  rmind 
    692  1.3.4.2  rmind     /* _CRS */
    693  1.3.4.2  rmind 
    694  1.3.4.2  rmind GetCrs:
    695  1.3.4.2  rmind     AcpiOsPrintf ("Evaluating _CRS\n");
    696  1.3.4.2  rmind 
    697  1.3.4.2  rmind     ReturnObj.Pointer = AcpiGbl_DbBuffer;
    698  1.3.4.2  rmind     ReturnObj.Length  = ACPI_DEBUG_BUFFER_SIZE;
    699  1.3.4.2  rmind 
    700  1.3.4.2  rmind     /* Check if _CRS exists */
    701  1.3.4.2  rmind 
    702  1.3.4.2  rmind     Status = AcpiEvaluateObject (Node, METHOD_NAME__CRS, NULL, &ReturnObj);
    703  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    704  1.3.4.2  rmind     {
    705  1.3.4.2  rmind         AcpiOsPrintf ("Could not obtain _CRS: %s\n",
    706  1.3.4.2  rmind             AcpiFormatException (Status));
    707  1.3.4.2  rmind         goto GetPrs;
    708  1.3.4.2  rmind     }
    709  1.3.4.2  rmind 
    710  1.3.4.2  rmind     /* Get the _CRS resource list */
    711  1.3.4.2  rmind 
    712  1.3.4.2  rmind     ReturnObj.Pointer = AcpiGbl_DbBuffer;
    713  1.3.4.2  rmind     ReturnObj.Length  = ACPI_DEBUG_BUFFER_SIZE;
    714  1.3.4.2  rmind 
    715  1.3.4.2  rmind     Status = AcpiGetCurrentResources (Node, &ReturnObj);
    716  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    717  1.3.4.2  rmind     {
    718  1.3.4.2  rmind         AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n",
    719  1.3.4.2  rmind             AcpiFormatException (Status));
    720  1.3.4.2  rmind         goto GetPrs;
    721  1.3.4.2  rmind     }
    722  1.3.4.2  rmind 
    723  1.3.4.2  rmind     /* Dump the _CRS resource list */
    724  1.3.4.2  rmind 
    725  1.3.4.2  rmind     AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE,
    726  1.3.4.2  rmind         ReturnObj.Pointer));
    727  1.3.4.2  rmind 
    728  1.3.4.2  rmind     /*
    729  1.3.4.2  rmind      * Perform comparison of original AML to newly created AML. This tests both
    730  1.3.4.2  rmind      * the AML->Resource conversion and the Resource->Aml conversion.
    731  1.3.4.2  rmind      */
    732  1.3.4.2  rmind     Status = AcpiDmTestResourceConversion (Node, __UNCONST(METHOD_NAME__CRS));
    733  1.3.4.2  rmind 
    734  1.3.4.2  rmind     /* Execute _SRS with the resource list */
    735  1.3.4.2  rmind 
    736  1.3.4.2  rmind     Status = AcpiSetCurrentResources (Node, &ReturnObj);
    737  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    738  1.3.4.2  rmind     {
    739  1.3.4.2  rmind         AcpiOsPrintf ("AcpiSetCurrentResources failed: %s\n",
    740  1.3.4.2  rmind             AcpiFormatException (Status));
    741  1.3.4.2  rmind         goto GetPrs;
    742  1.3.4.2  rmind     }
    743  1.3.4.2  rmind 
    744  1.3.4.2  rmind 
    745  1.3.4.2  rmind     /* _PRS */
    746  1.3.4.2  rmind 
    747  1.3.4.2  rmind GetPrs:
    748  1.3.4.2  rmind     AcpiOsPrintf ("Evaluating _PRS\n");
    749  1.3.4.2  rmind 
    750  1.3.4.2  rmind     ReturnObj.Pointer = AcpiGbl_DbBuffer;
    751  1.3.4.2  rmind     ReturnObj.Length  = ACPI_DEBUG_BUFFER_SIZE;
    752  1.3.4.2  rmind 
    753  1.3.4.2  rmind     /* Check if _PRS exists */
    754  1.3.4.2  rmind 
    755  1.3.4.2  rmind     Status = AcpiEvaluateObject (Node, METHOD_NAME__PRS, NULL, &ReturnObj);
    756  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    757  1.3.4.2  rmind     {
    758  1.3.4.2  rmind         AcpiOsPrintf ("Could not obtain _PRS: %s\n",
    759  1.3.4.2  rmind             AcpiFormatException (Status));
    760  1.3.4.2  rmind         goto Cleanup;
    761  1.3.4.2  rmind     }
    762  1.3.4.2  rmind 
    763  1.3.4.2  rmind     ReturnObj.Pointer = AcpiGbl_DbBuffer;
    764  1.3.4.2  rmind     ReturnObj.Length  = ACPI_DEBUG_BUFFER_SIZE;
    765  1.3.4.2  rmind 
    766  1.3.4.2  rmind     Status = AcpiGetPossibleResources (Node, &ReturnObj);
    767  1.3.4.2  rmind     if (ACPI_FAILURE (Status))
    768  1.3.4.2  rmind     {
    769  1.3.4.2  rmind         AcpiOsPrintf ("AcpiGetPossibleResources failed: %s\n",
    770  1.3.4.2  rmind             AcpiFormatException (Status));
    771  1.3.4.2  rmind         goto Cleanup;
    772  1.3.4.2  rmind     }
    773  1.3.4.2  rmind 
    774  1.3.4.2  rmind     AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer));
    775  1.3.4.2  rmind 
    776  1.3.4.2  rmind Cleanup:
    777  1.3.4.2  rmind 
    778  1.3.4.2  rmind     AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
    779  1.3.4.2  rmind     return;
    780  1.3.4.2  rmind }
    781  1.3.4.2  rmind 
    782  1.3.4.2  rmind 
    783  1.3.4.2  rmind /*******************************************************************************
    784  1.3.4.2  rmind  *
    785  1.3.4.2  rmind  * FUNCTION:    AcpiDbGenerateGpe
    786  1.3.4.2  rmind  *
    787  1.3.4.2  rmind  * PARAMETERS:  GpeArg          - Raw GPE number, ascii string
    788  1.3.4.2  rmind  *              BlockArg        - GPE block number, ascii string
    789  1.3.4.2  rmind  *                                0 or 1 for FADT GPE blocks
    790  1.3.4.2  rmind  *
    791  1.3.4.2  rmind  * RETURN:      None
    792  1.3.4.2  rmind  *
    793  1.3.4.2  rmind  * DESCRIPTION: Generate a GPE
    794  1.3.4.2  rmind  *
    795  1.3.4.2  rmind  ******************************************************************************/
    796  1.3.4.2  rmind 
    797  1.3.4.2  rmind void
    798  1.3.4.2  rmind AcpiDbGenerateGpe (
    799  1.3.4.2  rmind     char                    *GpeArg,
    800  1.3.4.2  rmind     char                    *BlockArg)
    801  1.3.4.2  rmind {
    802  1.3.4.2  rmind     UINT32                  BlockNumber;
    803  1.3.4.2  rmind     UINT32                  GpeNumber;
    804  1.3.4.2  rmind     ACPI_GPE_EVENT_INFO     *GpeEventInfo;
    805  1.3.4.2  rmind 
    806  1.3.4.2  rmind 
    807  1.3.4.2  rmind     GpeNumber   = ACPI_STRTOUL (GpeArg, NULL, 0);
    808  1.3.4.2  rmind     BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
    809  1.3.4.2  rmind 
    810  1.3.4.2  rmind 
    811  1.3.4.2  rmind     GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
    812  1.3.4.2  rmind         GpeNumber);
    813  1.3.4.2  rmind     if (!GpeEventInfo)
    814  1.3.4.2  rmind     {
    815  1.3.4.2  rmind         AcpiOsPrintf ("Invalid GPE\n");
    816  1.3.4.2  rmind         return;
    817  1.3.4.2  rmind     }
    818  1.3.4.2  rmind 
    819  1.3.4.2  rmind     (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber);
    820  1.3.4.2  rmind }
    821  1.3.4.2  rmind 
    822  1.3.4.2  rmind #endif /* ACPI_DEBUGGER */
    823