Home | History | Annotate | Line # | Download | only in acpiexec
aecommon.h revision 1.1.1.16.6.1
      1           1.1    jruoho /******************************************************************************
      2           1.1    jruoho  *
      3           1.1    jruoho  * Module Name: aecommon - common include for the AcpiExec utility
      4           1.1    jruoho  *
      5           1.1    jruoho  *****************************************************************************/
      6           1.1    jruoho 
      7       1.1.1.2    jruoho /*
      8  1.1.1.16.6.1   thorpej  * Copyright (C) 2000 - 2021, 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.16.6.1   thorpej  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 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 #ifndef _AECOMMON
     45           1.1    jruoho #define _AECOMMON
     46           1.1    jruoho 
     47           1.1    jruoho #ifdef _MSC_VER                 /* disable some level-4 warnings */
     48           1.1    jruoho #pragma warning(disable:4100)   /* warning C4100: unreferenced formal parameter */
     49           1.1    jruoho #endif
     50           1.1    jruoho 
     51           1.1    jruoho #include "acpi.h"
     52           1.1    jruoho #include "accommon.h"
     53           1.1    jruoho #include "acparser.h"
     54           1.1    jruoho #include "amlcode.h"
     55           1.1    jruoho #include "acnamesp.h"
     56           1.1    jruoho #include "acdebug.h"
     57           1.1    jruoho #include "actables.h"
     58           1.1    jruoho #include "acinterp.h"
     59       1.1.1.4  christos #include "amlresrc.h"
     60           1.1    jruoho #include "acapps.h"
     61           1.1    jruoho 
     62           1.1    jruoho 
     63           1.1    jruoho /*
     64           1.1    jruoho  * Debug Regions
     65           1.1    jruoho  */
     66           1.1    jruoho typedef struct ae_region
     67           1.1    jruoho {
     68           1.1    jruoho     ACPI_PHYSICAL_ADDRESS   Address;
     69           1.1    jruoho     UINT32                  Length;
     70           1.1    jruoho     void                    *Buffer;
     71           1.1    jruoho     void                    *NextRegion;
     72           1.1    jruoho     UINT8                   SpaceId;
     73           1.1    jruoho 
     74           1.1    jruoho } AE_REGION;
     75           1.1    jruoho 
     76           1.1    jruoho typedef struct ae_debug_regions
     77           1.1    jruoho {
     78           1.1    jruoho     UINT32                  NumberOfRegions;
     79           1.1    jruoho     AE_REGION               *RegionList;
     80           1.1    jruoho 
     81           1.1    jruoho } AE_DEBUG_REGIONS;
     82           1.1    jruoho 
     83           1.1    jruoho 
     84      1.1.1.13  christos /*
     85      1.1.1.13  christos  * Init file entry
     86      1.1.1.13  christos  */
     87      1.1.1.13  christos typedef struct init_file_entry
     88      1.1.1.13  christos {
     89      1.1.1.13  christos     char                    *Name;
     90      1.1.1.16  christos     char                    *Value;
     91      1.1.1.15  christos     ACPI_OPERAND_OBJECT     *ObjDesc;
     92      1.1.1.16  christos     BOOLEAN                 IsUsed;
     93      1.1.1.15  christos 
     94      1.1.1.13  christos } INIT_FILE_ENTRY;
     95      1.1.1.13  christos 
     96      1.1.1.12  christos extern BOOLEAN              AcpiGbl_UseLocalFaultHandler;
     97      1.1.1.13  christos extern BOOLEAN              AcpiGbl_VerboseHandlers;
     98       1.1.1.6  christos extern BOOLEAN              AcpiGbl_IgnoreErrors;
     99      1.1.1.10  christos extern BOOLEAN              AcpiGbl_AbortLoopOnTimeout;
    100       1.1.1.6  christos extern UINT8                AcpiGbl_RegionFillValue;
    101      1.1.1.13  christos extern INIT_FILE_ENTRY      *AcpiGbl_InitEntries;
    102      1.1.1.13  christos extern UINT32               AcpiGbl_InitFileLineCount;
    103       1.1.1.6  christos extern UINT8                AcpiGbl_UseHwReducedFadt;
    104       1.1.1.6  christos extern BOOLEAN              AcpiGbl_DisplayRegionAccess;
    105       1.1.1.6  christos extern BOOLEAN              AcpiGbl_DoInterfaceTests;
    106       1.1.1.6  christos extern BOOLEAN              AcpiGbl_LoadTestTables;
    107       1.1.1.6  christos extern FILE                 *AcpiGbl_NamespaceInitFile;
    108       1.1.1.6  christos extern ACPI_CONNECTION_INFO AeMyContext;
    109       1.1.1.6  christos 
    110      1.1.1.10  christos extern UINT8                Ssdt2Code[];
    111      1.1.1.10  christos extern UINT8                Ssdt3Code[];
    112      1.1.1.10  christos extern UINT8                Ssdt4Code[];
    113      1.1.1.10  christos 
    114       1.1.1.6  christos 
    115           1.1    jruoho #define TEST_OUTPUT_LEVEL(lvl)          if ((lvl) & OutputLevel)
    116           1.1    jruoho 
    117           1.1    jruoho #define OSD_PRINT(lvl,fp)               TEST_OUTPUT_LEVEL(lvl) {\
    118           1.1    jruoho                                             AcpiOsPrintf PARAM_LIST(fp);}
    119           1.1    jruoho 
    120       1.1.1.9  christos #define AE_PREFIX                       "ACPI Exec: "
    121       1.1.1.9  christos 
    122       1.1.1.2    jruoho void ACPI_SYSTEM_XFACE
    123       1.1.1.9  christos AeSignalHandler (
    124           1.1    jruoho     int                     Sig);
    125           1.1    jruoho 
    126           1.1    jruoho ACPI_STATUS
    127       1.1.1.9  christos AeExceptionHandler (
    128       1.1.1.9  christos     ACPI_STATUS             AmlStatus,
    129       1.1.1.9  christos     ACPI_NAME               Name,
    130       1.1.1.9  christos     UINT16                  Opcode,
    131       1.1.1.9  christos     UINT32                  AmlOffset,
    132       1.1.1.9  christos     void                    *Context);
    133       1.1.1.9  christos 
    134       1.1.1.9  christos ACPI_STATUS
    135           1.1    jruoho AeBuildLocalTables (
    136       1.1.1.6  christos     ACPI_NEW_TABLE_DESC     *TableList);
    137           1.1    jruoho 
    138           1.1    jruoho ACPI_STATUS
    139           1.1    jruoho AeInstallTables (
    140           1.1    jruoho     void);
    141           1.1    jruoho 
    142       1.1.1.6  christos ACPI_STATUS
    143       1.1.1.6  christos AeLoadTables (
    144       1.1.1.6  christos     void);
    145       1.1.1.6  christos 
    146           1.1    jruoho void
    147           1.1    jruoho AeDumpNamespace (
    148           1.1    jruoho     void);
    149           1.1    jruoho 
    150           1.1    jruoho void
    151           1.1    jruoho AeDumpObject (
    152           1.1    jruoho     char                    *MethodName,
    153           1.1    jruoho     ACPI_BUFFER             *ReturnObj);
    154           1.1    jruoho 
    155           1.1    jruoho void
    156           1.1    jruoho AeDumpBuffer (
    157           1.1    jruoho     UINT32                  Address);
    158           1.1    jruoho 
    159           1.1    jruoho void
    160           1.1    jruoho AeExecute (
    161           1.1    jruoho     char                    *Name);
    162           1.1    jruoho 
    163           1.1    jruoho void
    164           1.1    jruoho AeSetScope (
    165           1.1    jruoho     char                    *Name);
    166           1.1    jruoho 
    167           1.1    jruoho void
    168           1.1    jruoho AeCloseDebugFile (
    169           1.1    jruoho     void);
    170           1.1    jruoho 
    171           1.1    jruoho void
    172           1.1    jruoho AeOpenDebugFile (
    173           1.1    jruoho     char                    *Name);
    174           1.1    jruoho 
    175           1.1    jruoho ACPI_STATUS
    176           1.1    jruoho AeDisplayAllMethods (
    177           1.1    jruoho     UINT32                  DisplayCount);
    178           1.1    jruoho 
    179      1.1.1.10  christos /* aetests */
    180           1.1    jruoho 
    181           1.1    jruoho void
    182           1.1    jruoho AeMiscellaneousTests (
    183           1.1    jruoho     void);
    184           1.1    jruoho 
    185      1.1.1.14  christos void
    186      1.1.1.14  christos AeLateTest (
    187      1.1.1.14  christos     void);
    188      1.1.1.14  christos 
    189      1.1.1.10  christos /* aeregion */
    190      1.1.1.10  christos 
    191           1.1    jruoho ACPI_STATUS
    192           1.1    jruoho AeRegionHandler (
    193           1.1    jruoho     UINT32                  Function,
    194           1.1    jruoho     ACPI_PHYSICAL_ADDRESS   Address,
    195           1.1    jruoho     UINT32                  BitWidth,
    196           1.1    jruoho     UINT64                  *Value,
    197           1.1    jruoho     void                    *HandlerContext,
    198           1.1    jruoho     void                    *RegionContext);
    199           1.1    jruoho 
    200      1.1.1.10  christos /* aeinstall */
    201      1.1.1.10  christos 
    202      1.1.1.10  christos ACPI_STATUS
    203      1.1.1.10  christos AeInstallDeviceHandlers (
    204      1.1.1.10  christos     void);
    205      1.1.1.10  christos 
    206      1.1.1.10  christos void
    207      1.1.1.10  christos AeInstallRegionHandlers (
    208      1.1.1.10  christos     void);
    209      1.1.1.10  christos 
    210      1.1.1.10  christos void
    211      1.1.1.10  christos AeOverrideRegionHandlers (
    212      1.1.1.10  christos     void);
    213      1.1.1.10  christos 
    214      1.1.1.10  christos /* aehandlers */
    215      1.1.1.10  christos 
    216      1.1.1.10  christos ACPI_STATUS
    217      1.1.1.10  christos AeInstallEarlyHandlers (
    218      1.1.1.10  christos     void);
    219      1.1.1.10  christos 
    220      1.1.1.10  christos ACPI_STATUS
    221      1.1.1.10  christos AeInstallLateHandlers (
    222      1.1.1.10  christos     void);
    223      1.1.1.10  christos 
    224           1.1    jruoho UINT32
    225           1.1    jruoho AeGpeHandler (
    226       1.1.1.2    jruoho     ACPI_HANDLE             GpeDevice,
    227       1.1.1.2    jruoho     UINT32                  GpeNumber,
    228       1.1.1.2    jruoho     void                    *Context);
    229       1.1.1.2    jruoho 
    230       1.1.1.2    jruoho void
    231       1.1.1.2    jruoho AeGlobalEventHandler (
    232       1.1.1.2    jruoho     UINT32                  Type,
    233       1.1.1.2    jruoho     ACPI_HANDLE             GpeDevice,
    234       1.1.1.2    jruoho     UINT32                  EventNumber,
    235           1.1    jruoho     void                    *Context);
    236           1.1    jruoho 
    237      1.1.1.10  christos /* aeinitfile */
    238       1.1.1.4  christos 
    239      1.1.1.10  christos int
    240      1.1.1.10  christos AeOpenInitializationFile (
    241      1.1.1.10  christos     char                    *Filename);
    242      1.1.1.10  christos 
    243      1.1.1.16  christos ACPI_STATUS
    244      1.1.1.13  christos AeProcessInitFile (
    245       1.1.1.4  christos     void);
    246       1.1.1.4  christos 
    247      1.1.1.10  christos ACPI_STATUS
    248      1.1.1.13  christos AeLookupInitFileEntry (
    249      1.1.1.13  christos     char                    *Pathname,
    250      1.1.1.15  christos     ACPI_OPERAND_OBJECT     **ObjDesc);
    251      1.1.1.13  christos 
    252      1.1.1.16  christos void
    253      1.1.1.16  christos AeDisplayUnusedInitFileItems (
    254      1.1.1.16  christos     void);
    255      1.1.1.16  christos 
    256      1.1.1.16  christos void
    257      1.1.1.16  christos AeDeleteInitFileList (
    258      1.1.1.16  christos     void);
    259      1.1.1.16  christos 
    260      1.1.1.10  christos /* aeexec */
    261      1.1.1.10  christos 
    262       1.1.1.4  christos void
    263      1.1.1.10  christos AeTestBufferArgument (
    264       1.1.1.4  christos     void);
    265       1.1.1.4  christos 
    266       1.1.1.4  christos void
    267      1.1.1.10  christos AeTestPackageArgument (
    268       1.1.1.4  christos     void);
    269       1.1.1.4  christos 
    270      1.1.1.10  christos ACPI_STATUS
    271      1.1.1.10  christos AeGetDevices (
    272      1.1.1.10  christos     ACPI_HANDLE             ObjHandle,
    273      1.1.1.10  christos     UINT32                  NestingLevel,
    274      1.1.1.10  christos     void                    *Context,
    275      1.1.1.10  christos     void                    **ReturnValue);
    276       1.1.1.4  christos 
    277      1.1.1.10  christos ACPI_STATUS
    278      1.1.1.16  christos AeSetupConfiguration (
    279      1.1.1.16  christos     void                    *RegionAddr);
    280      1.1.1.16  christos 
    281      1.1.1.16  christos ACPI_STATUS
    282      1.1.1.10  christos ExecuteOSI (
    283      1.1.1.10  christos     char                    *OsiString,
    284      1.1.1.10  christos     UINT64                  ExpectedResult);
    285       1.1.1.5  christos 
    286      1.1.1.10  christos void
    287      1.1.1.10  christos AeGenericRegisters (
    288      1.1.1.10  christos     void);
    289       1.1.1.5  christos 
    290      1.1.1.10  christos #if (!ACPI_REDUCED_HARDWARE)
    291       1.1.1.5  christos void
    292      1.1.1.10  christos AfInstallGpeBlock (
    293       1.1.1.5  christos     void);
    294      1.1.1.10  christos #endif /* !ACPI_REDUCED_HARDWARE */
    295       1.1.1.5  christos 
    296           1.1    jruoho #endif /* _AECOMMON */
    297