Home | History | Annotate | Line # | Download | only in acpiexec
aecommon.h revision 1.1.1.10.2.2
      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.10.2.1  pgoyette  * Copyright (C) 2000 - 2018, 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 #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.10.2.2  pgoyette extern BOOLEAN              AcpiGbl_UseLocalFaultHandler;
     85       1.1.1.6  christos extern BOOLEAN              AcpiGbl_IgnoreErrors;
     86      1.1.1.10  christos extern BOOLEAN              AcpiGbl_AbortLoopOnTimeout;
     87       1.1.1.6  christos extern UINT8                AcpiGbl_RegionFillValue;
     88       1.1.1.6  christos extern UINT8                AcpiGbl_UseHwReducedFadt;
     89       1.1.1.6  christos extern BOOLEAN              AcpiGbl_DisplayRegionAccess;
     90       1.1.1.6  christos extern BOOLEAN              AcpiGbl_DoInterfaceTests;
     91       1.1.1.6  christos extern BOOLEAN              AcpiGbl_LoadTestTables;
     92       1.1.1.6  christos extern FILE                 *AcpiGbl_NamespaceInitFile;
     93       1.1.1.6  christos extern ACPI_CONNECTION_INFO AeMyContext;
     94       1.1.1.6  christos 
     95      1.1.1.10  christos extern UINT8                Ssdt2Code[];
     96      1.1.1.10  christos extern UINT8                Ssdt3Code[];
     97      1.1.1.10  christos extern UINT8                Ssdt4Code[];
     98      1.1.1.10  christos 
     99       1.1.1.6  christos 
    100           1.1    jruoho #define TEST_OUTPUT_LEVEL(lvl)          if ((lvl) & OutputLevel)
    101           1.1    jruoho 
    102           1.1    jruoho #define OSD_PRINT(lvl,fp)               TEST_OUTPUT_LEVEL(lvl) {\
    103           1.1    jruoho                                             AcpiOsPrintf PARAM_LIST(fp);}
    104           1.1    jruoho 
    105       1.1.1.9  christos #define AE_PREFIX                       "ACPI Exec: "
    106       1.1.1.9  christos 
    107       1.1.1.2    jruoho void ACPI_SYSTEM_XFACE
    108       1.1.1.9  christos AeSignalHandler (
    109           1.1    jruoho     int                     Sig);
    110           1.1    jruoho 
    111           1.1    jruoho ACPI_STATUS
    112       1.1.1.9  christos AeExceptionHandler (
    113       1.1.1.9  christos     ACPI_STATUS             AmlStatus,
    114       1.1.1.9  christos     ACPI_NAME               Name,
    115       1.1.1.9  christos     UINT16                  Opcode,
    116       1.1.1.9  christos     UINT32                  AmlOffset,
    117       1.1.1.9  christos     void                    *Context);
    118       1.1.1.9  christos 
    119       1.1.1.9  christos ACPI_STATUS
    120           1.1    jruoho AeBuildLocalTables (
    121       1.1.1.6  christos     ACPI_NEW_TABLE_DESC     *TableList);
    122           1.1    jruoho 
    123           1.1    jruoho ACPI_STATUS
    124           1.1    jruoho AeInstallTables (
    125           1.1    jruoho     void);
    126           1.1    jruoho 
    127       1.1.1.6  christos ACPI_STATUS
    128       1.1.1.6  christos AeLoadTables (
    129       1.1.1.6  christos     void);
    130       1.1.1.6  christos 
    131           1.1    jruoho void
    132           1.1    jruoho AeDumpNamespace (
    133           1.1    jruoho     void);
    134           1.1    jruoho 
    135           1.1    jruoho void
    136           1.1    jruoho AeDumpObject (
    137           1.1    jruoho     char                    *MethodName,
    138           1.1    jruoho     ACPI_BUFFER             *ReturnObj);
    139           1.1    jruoho 
    140           1.1    jruoho void
    141           1.1    jruoho AeDumpBuffer (
    142           1.1    jruoho     UINT32                  Address);
    143           1.1    jruoho 
    144           1.1    jruoho void
    145           1.1    jruoho AeExecute (
    146           1.1    jruoho     char                    *Name);
    147           1.1    jruoho 
    148           1.1    jruoho void
    149           1.1    jruoho AeSetScope (
    150           1.1    jruoho     char                    *Name);
    151           1.1    jruoho 
    152           1.1    jruoho void
    153           1.1    jruoho AeCloseDebugFile (
    154           1.1    jruoho     void);
    155           1.1    jruoho 
    156           1.1    jruoho void
    157           1.1    jruoho AeOpenDebugFile (
    158           1.1    jruoho     char                    *Name);
    159           1.1    jruoho 
    160           1.1    jruoho ACPI_STATUS
    161           1.1    jruoho AeDisplayAllMethods (
    162           1.1    jruoho     UINT32                  DisplayCount);
    163           1.1    jruoho 
    164      1.1.1.10  christos /* aetests */
    165           1.1    jruoho 
    166           1.1    jruoho void
    167           1.1    jruoho AeMiscellaneousTests (
    168           1.1    jruoho     void);
    169           1.1    jruoho 
    170      1.1.1.10  christos /* aeregion */
    171      1.1.1.10  christos 
    172           1.1    jruoho ACPI_STATUS
    173           1.1    jruoho AeRegionHandler (
    174           1.1    jruoho     UINT32                  Function,
    175           1.1    jruoho     ACPI_PHYSICAL_ADDRESS   Address,
    176           1.1    jruoho     UINT32                  BitWidth,
    177           1.1    jruoho     UINT64                  *Value,
    178           1.1    jruoho     void                    *HandlerContext,
    179           1.1    jruoho     void                    *RegionContext);
    180           1.1    jruoho 
    181      1.1.1.10  christos /* aeinstall */
    182      1.1.1.10  christos 
    183      1.1.1.10  christos ACPI_STATUS
    184      1.1.1.10  christos AeInstallDeviceHandlers (
    185      1.1.1.10  christos     void);
    186      1.1.1.10  christos 
    187      1.1.1.10  christos void
    188      1.1.1.10  christos AeInstallRegionHandlers (
    189      1.1.1.10  christos     void);
    190      1.1.1.10  christos 
    191      1.1.1.10  christos void
    192      1.1.1.10  christos AeOverrideRegionHandlers (
    193      1.1.1.10  christos     void);
    194      1.1.1.10  christos 
    195      1.1.1.10  christos /* aehandlers */
    196      1.1.1.10  christos 
    197      1.1.1.10  christos ACPI_STATUS
    198      1.1.1.10  christos AeInstallEarlyHandlers (
    199      1.1.1.10  christos     void);
    200      1.1.1.10  christos 
    201      1.1.1.10  christos ACPI_STATUS
    202      1.1.1.10  christos AeInstallLateHandlers (
    203      1.1.1.10  christos     void);
    204      1.1.1.10  christos 
    205           1.1    jruoho UINT32
    206           1.1    jruoho AeGpeHandler (
    207       1.1.1.2    jruoho     ACPI_HANDLE             GpeDevice,
    208       1.1.1.2    jruoho     UINT32                  GpeNumber,
    209       1.1.1.2    jruoho     void                    *Context);
    210       1.1.1.2    jruoho 
    211       1.1.1.2    jruoho void
    212       1.1.1.2    jruoho AeGlobalEventHandler (
    213       1.1.1.2    jruoho     UINT32                  Type,
    214       1.1.1.2    jruoho     ACPI_HANDLE             GpeDevice,
    215       1.1.1.2    jruoho     UINT32                  EventNumber,
    216           1.1    jruoho     void                    *Context);
    217           1.1    jruoho 
    218      1.1.1.10  christos /* aeinitfile */
    219       1.1.1.4  christos 
    220      1.1.1.10  christos int
    221      1.1.1.10  christos AeOpenInitializationFile (
    222      1.1.1.10  christos     char                    *Filename);
    223      1.1.1.10  christos 
    224      1.1.1.10  christos void
    225      1.1.1.10  christos AeDoObjectOverrides (
    226       1.1.1.4  christos     void);
    227       1.1.1.4  christos 
    228      1.1.1.10  christos ACPI_STATUS
    229      1.1.1.10  christos AeSetupConfiguration (
    230      1.1.1.10  christos     void                    *RegionAddr);
    231      1.1.1.10  christos 
    232      1.1.1.10  christos /* aeexec */
    233      1.1.1.10  christos 
    234       1.1.1.4  christos void
    235      1.1.1.10  christos AeTestBufferArgument (
    236       1.1.1.4  christos     void);
    237       1.1.1.4  christos 
    238       1.1.1.4  christos void
    239      1.1.1.10  christos AeTestPackageArgument (
    240       1.1.1.4  christos     void);
    241       1.1.1.4  christos 
    242      1.1.1.10  christos ACPI_STATUS
    243      1.1.1.10  christos AeGetDevices (
    244      1.1.1.10  christos     ACPI_HANDLE             ObjHandle,
    245      1.1.1.10  christos     UINT32                  NestingLevel,
    246      1.1.1.10  christos     void                    *Context,
    247      1.1.1.10  christos     void                    **ReturnValue);
    248       1.1.1.4  christos 
    249      1.1.1.10  christos ACPI_STATUS
    250      1.1.1.10  christos ExecuteOSI (
    251      1.1.1.10  christos     char                    *OsiString,
    252      1.1.1.10  christos     UINT64                  ExpectedResult);
    253       1.1.1.5  christos 
    254      1.1.1.10  christos void
    255      1.1.1.10  christos AeGenericRegisters (
    256      1.1.1.10  christos     void);
    257       1.1.1.5  christos 
    258      1.1.1.10  christos #if (!ACPI_REDUCED_HARDWARE)
    259       1.1.1.5  christos void
    260      1.1.1.10  christos AfInstallGpeBlock (
    261       1.1.1.5  christos     void);
    262      1.1.1.10  christos #endif /* !ACPI_REDUCED_HARDWARE */
    263       1.1.1.5  christos 
    264           1.1    jruoho #endif /* _AECOMMON */
    265