Home | History | Annotate | Line # | Download | only in acpiexec
aecommon.h revision 1.1.1.15
      1 /******************************************************************************
      2  *
      3  * Module Name: aecommon - common include for the AcpiExec utility
      4  *
      5  *****************************************************************************/
      6 
      7 /*
      8  * Copyright (C) 2000 - 2019, Intel Corp.
      9  * All rights reserved.
     10  *
     11  * Redistribution and use in source and binary forms, with or without
     12  * modification, are permitted provided that the following conditions
     13  * are met:
     14  * 1. Redistributions of source code must retain the above copyright
     15  *    notice, this list of conditions, and the following disclaimer,
     16  *    without modification.
     17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18  *    substantially similar to the "NO WARRANTY" disclaimer below
     19  *    ("Disclaimer") and any redistribution must be conditioned upon
     20  *    including a substantially similar Disclaimer requirement for further
     21  *    binary redistribution.
     22  * 3. Neither the names of the above-listed copyright holders nor the names
     23  *    of any contributors may be used to endorse or promote products derived
     24  *    from this software without specific prior written permission.
     25  *
     26  * Alternatively, this software may be distributed under the terms of the
     27  * GNU General Public License ("GPL") version 2 as published by the Free
     28  * Software Foundation.
     29  *
     30  * NO WARRANTY
     31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41  * POSSIBILITY OF SUCH DAMAGES.
     42  */
     43 
     44 #ifndef _AECOMMON
     45 #define _AECOMMON
     46 
     47 #ifdef _MSC_VER                 /* disable some level-4 warnings */
     48 #pragma warning(disable:4100)   /* warning C4100: unreferenced formal parameter */
     49 #endif
     50 
     51 #include "acpi.h"
     52 #include "accommon.h"
     53 #include "acparser.h"
     54 #include "amlcode.h"
     55 #include "acnamesp.h"
     56 #include "acdebug.h"
     57 #include "actables.h"
     58 #include "acinterp.h"
     59 #include "amlresrc.h"
     60 #include "acapps.h"
     61 
     62 
     63 /*
     64  * Debug Regions
     65  */
     66 typedef struct ae_region
     67 {
     68     ACPI_PHYSICAL_ADDRESS   Address;
     69     UINT32                  Length;
     70     void                    *Buffer;
     71     void                    *NextRegion;
     72     UINT8                   SpaceId;
     73 
     74 } AE_REGION;
     75 
     76 typedef struct ae_debug_regions
     77 {
     78     UINT32                  NumberOfRegions;
     79     AE_REGION               *RegionList;
     80 
     81 } AE_DEBUG_REGIONS;
     82 
     83 
     84 /*
     85  * Init file entry
     86  */
     87 typedef struct init_file_entry
     88 {
     89     char                    *Name;
     90     ACPI_OPERAND_OBJECT     *ObjDesc;
     91 
     92 } INIT_FILE_ENTRY;
     93 
     94 extern BOOLEAN              AcpiGbl_UseLocalFaultHandler;
     95 extern BOOLEAN              AcpiGbl_VerboseHandlers;
     96 extern BOOLEAN              AcpiGbl_IgnoreErrors;
     97 extern BOOLEAN              AcpiGbl_AbortLoopOnTimeout;
     98 extern UINT8                AcpiGbl_RegionFillValue;
     99 extern INIT_FILE_ENTRY      *AcpiGbl_InitEntries;
    100 extern UINT32               AcpiGbl_InitFileLineCount;
    101 extern UINT8                AcpiGbl_UseHwReducedFadt;
    102 extern BOOLEAN              AcpiGbl_DisplayRegionAccess;
    103 extern BOOLEAN              AcpiGbl_DoInterfaceTests;
    104 extern BOOLEAN              AcpiGbl_LoadTestTables;
    105 extern FILE                 *AcpiGbl_NamespaceInitFile;
    106 extern ACPI_CONNECTION_INFO AeMyContext;
    107 
    108 extern UINT8                Ssdt2Code[];
    109 extern UINT8                Ssdt3Code[];
    110 extern UINT8                Ssdt4Code[];
    111 
    112 
    113 #define TEST_OUTPUT_LEVEL(lvl)          if ((lvl) & OutputLevel)
    114 
    115 #define OSD_PRINT(lvl,fp)               TEST_OUTPUT_LEVEL(lvl) {\
    116                                             AcpiOsPrintf PARAM_LIST(fp);}
    117 
    118 #define AE_PREFIX                       "ACPI Exec: "
    119 
    120 void ACPI_SYSTEM_XFACE
    121 AeSignalHandler (
    122     int                     Sig);
    123 
    124 ACPI_STATUS
    125 AeExceptionHandler (
    126     ACPI_STATUS             AmlStatus,
    127     ACPI_NAME               Name,
    128     UINT16                  Opcode,
    129     UINT32                  AmlOffset,
    130     void                    *Context);
    131 
    132 ACPI_STATUS
    133 AeBuildLocalTables (
    134     ACPI_NEW_TABLE_DESC     *TableList);
    135 
    136 ACPI_STATUS
    137 AeInstallTables (
    138     void);
    139 
    140 ACPI_STATUS
    141 AeLoadTables (
    142     void);
    143 
    144 void
    145 AeDumpNamespace (
    146     void);
    147 
    148 void
    149 AeDumpObject (
    150     char                    *MethodName,
    151     ACPI_BUFFER             *ReturnObj);
    152 
    153 void
    154 AeDumpBuffer (
    155     UINT32                  Address);
    156 
    157 void
    158 AeExecute (
    159     char                    *Name);
    160 
    161 void
    162 AeSetScope (
    163     char                    *Name);
    164 
    165 void
    166 AeCloseDebugFile (
    167     void);
    168 
    169 void
    170 AeOpenDebugFile (
    171     char                    *Name);
    172 
    173 ACPI_STATUS
    174 AeDisplayAllMethods (
    175     UINT32                  DisplayCount);
    176 
    177 /* aetests */
    178 
    179 void
    180 AeMiscellaneousTests (
    181     void);
    182 
    183 void
    184 AeLateTest (
    185     void);
    186 
    187 /* aeregion */
    188 
    189 ACPI_STATUS
    190 AeRegionHandler (
    191     UINT32                  Function,
    192     ACPI_PHYSICAL_ADDRESS   Address,
    193     UINT32                  BitWidth,
    194     UINT64                  *Value,
    195     void                    *HandlerContext,
    196     void                    *RegionContext);
    197 
    198 /* aeinstall */
    199 
    200 ACPI_STATUS
    201 AeInstallDeviceHandlers (
    202     void);
    203 
    204 void
    205 AeInstallRegionHandlers (
    206     void);
    207 
    208 void
    209 AeOverrideRegionHandlers (
    210     void);
    211 
    212 /* aehandlers */
    213 
    214 ACPI_STATUS
    215 AeInstallEarlyHandlers (
    216     void);
    217 
    218 ACPI_STATUS
    219 AeInstallLateHandlers (
    220     void);
    221 
    222 UINT32
    223 AeGpeHandler (
    224     ACPI_HANDLE             GpeDevice,
    225     UINT32                  GpeNumber,
    226     void                    *Context);
    227 
    228 void
    229 AeGlobalEventHandler (
    230     UINT32                  Type,
    231     ACPI_HANDLE             GpeDevice,
    232     UINT32                  EventNumber,
    233     void                    *Context);
    234 
    235 /* aeinitfile */
    236 
    237 int
    238 AeOpenInitializationFile (
    239     char                    *Filename);
    240 
    241 void
    242 AeProcessInitFile (
    243     void);
    244 
    245 ACPI_STATUS
    246 AeSetupConfiguration (
    247     void                    *RegionAddr);
    248 
    249 ACPI_STATUS
    250 AeLookupInitFileEntry (
    251     char                    *Pathname,
    252     ACPI_OPERAND_OBJECT     **ObjDesc);
    253 
    254 /* aeexec */
    255 
    256 void
    257 AeTestBufferArgument (
    258     void);
    259 
    260 void
    261 AeTestPackageArgument (
    262     void);
    263 
    264 ACPI_STATUS
    265 AeGetDevices (
    266     ACPI_HANDLE             ObjHandle,
    267     UINT32                  NestingLevel,
    268     void                    *Context,
    269     void                    **ReturnValue);
    270 
    271 ACPI_STATUS
    272 ExecuteOSI (
    273     char                    *OsiString,
    274     UINT64                  ExpectedResult);
    275 
    276 void
    277 AeGenericRegisters (
    278     void);
    279 
    280 #if (!ACPI_REDUCED_HARDWARE)
    281 void
    282 AfInstallGpeBlock (
    283     void);
    284 #endif /* !ACPI_REDUCED_HARDWARE */
    285 
    286 #endif /* _AECOMMON */
    287