Home | History | Annotate | Line # | Download | only in acpiexec
aecommon.h revision 1.1.1.4.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.4.2.2     skrll  * Copyright (C) 2000 - 2016, 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.1.2    jruoho #include <stdio.h>
     63      1.1.1.2    jruoho #include <stdlib.h>
     64      1.1.1.2    jruoho #include <string.h>
     65      1.1.1.2    jruoho #include <signal.h>
     66      1.1.1.2    jruoho 
     67          1.1    jruoho 
     68          1.1    jruoho /*
     69          1.1    jruoho  * Debug Regions
     70          1.1    jruoho  */
     71          1.1    jruoho typedef struct ae_region
     72          1.1    jruoho {
     73          1.1    jruoho     ACPI_PHYSICAL_ADDRESS   Address;
     74          1.1    jruoho     UINT32                  Length;
     75          1.1    jruoho     void                    *Buffer;
     76          1.1    jruoho     void                    *NextRegion;
     77          1.1    jruoho     UINT8                   SpaceId;
     78          1.1    jruoho 
     79          1.1    jruoho } AE_REGION;
     80          1.1    jruoho 
     81          1.1    jruoho typedef struct ae_debug_regions
     82          1.1    jruoho {
     83          1.1    jruoho     UINT32                  NumberOfRegions;
     84          1.1    jruoho     AE_REGION               *RegionList;
     85          1.1    jruoho 
     86          1.1    jruoho } AE_DEBUG_REGIONS;
     87          1.1    jruoho 
     88          1.1    jruoho 
     89  1.1.1.4.2.2     skrll extern BOOLEAN              AcpiGbl_IgnoreErrors;
     90  1.1.1.4.2.2     skrll extern UINT8                AcpiGbl_RegionFillValue;
     91  1.1.1.4.2.2     skrll extern UINT8                AcpiGbl_UseHwReducedFadt;
     92  1.1.1.4.2.2     skrll extern BOOLEAN              AcpiGbl_DisplayRegionAccess;
     93  1.1.1.4.2.2     skrll extern BOOLEAN              AcpiGbl_DoInterfaceTests;
     94  1.1.1.4.2.2     skrll extern BOOLEAN              AcpiGbl_LoadTestTables;
     95  1.1.1.4.2.2     skrll extern FILE                 *AcpiGbl_NamespaceInitFile;
     96  1.1.1.4.2.2     skrll extern ACPI_CONNECTION_INFO AeMyContext;
     97  1.1.1.4.2.2     skrll 
     98  1.1.1.4.2.2     skrll 
     99          1.1    jruoho #define TEST_OUTPUT_LEVEL(lvl)          if ((lvl) & OutputLevel)
    100          1.1    jruoho 
    101          1.1    jruoho #define OSD_PRINT(lvl,fp)               TEST_OUTPUT_LEVEL(lvl) {\
    102          1.1    jruoho                                             AcpiOsPrintf PARAM_LIST(fp);}
    103          1.1    jruoho 
    104      1.1.1.2    jruoho void ACPI_SYSTEM_XFACE
    105          1.1    jruoho AeCtrlCHandler (
    106          1.1    jruoho     int                     Sig);
    107          1.1    jruoho 
    108          1.1    jruoho ACPI_STATUS
    109          1.1    jruoho AeBuildLocalTables (
    110  1.1.1.4.2.2     skrll     ACPI_NEW_TABLE_DESC     *TableList);
    111          1.1    jruoho 
    112          1.1    jruoho ACPI_STATUS
    113          1.1    jruoho AeInstallTables (
    114          1.1    jruoho     void);
    115          1.1    jruoho 
    116  1.1.1.4.2.2     skrll ACPI_STATUS
    117  1.1.1.4.2.2     skrll AeLoadTables (
    118  1.1.1.4.2.2     skrll     void);
    119  1.1.1.4.2.2     skrll 
    120          1.1    jruoho void
    121          1.1    jruoho AeDumpNamespace (
    122          1.1    jruoho     void);
    123          1.1    jruoho 
    124          1.1    jruoho void
    125          1.1    jruoho AeDumpObject (
    126          1.1    jruoho     char                    *MethodName,
    127          1.1    jruoho     ACPI_BUFFER             *ReturnObj);
    128          1.1    jruoho 
    129          1.1    jruoho void
    130          1.1    jruoho AeDumpBuffer (
    131          1.1    jruoho     UINT32                  Address);
    132          1.1    jruoho 
    133          1.1    jruoho void
    134          1.1    jruoho AeExecute (
    135          1.1    jruoho     char                    *Name);
    136          1.1    jruoho 
    137          1.1    jruoho void
    138          1.1    jruoho AeSetScope (
    139          1.1    jruoho     char                    *Name);
    140          1.1    jruoho 
    141          1.1    jruoho void
    142          1.1    jruoho AeCloseDebugFile (
    143          1.1    jruoho     void);
    144          1.1    jruoho 
    145          1.1    jruoho void
    146          1.1    jruoho AeOpenDebugFile (
    147          1.1    jruoho     char                    *Name);
    148          1.1    jruoho 
    149          1.1    jruoho ACPI_STATUS
    150          1.1    jruoho AeDisplayAllMethods (
    151          1.1    jruoho     UINT32                  DisplayCount);
    152          1.1    jruoho 
    153          1.1    jruoho ACPI_STATUS
    154      1.1.1.2    jruoho AeInstallEarlyHandlers (
    155      1.1.1.2    jruoho     void);
    156      1.1.1.2    jruoho 
    157      1.1.1.2    jruoho ACPI_STATUS
    158      1.1.1.2    jruoho AeInstallLateHandlers (
    159          1.1    jruoho     void);
    160          1.1    jruoho 
    161          1.1    jruoho void
    162          1.1    jruoho AeMiscellaneousTests (
    163          1.1    jruoho     void);
    164          1.1    jruoho 
    165          1.1    jruoho ACPI_STATUS
    166          1.1    jruoho AeRegionHandler (
    167          1.1    jruoho     UINT32                  Function,
    168          1.1    jruoho     ACPI_PHYSICAL_ADDRESS   Address,
    169          1.1    jruoho     UINT32                  BitWidth,
    170          1.1    jruoho     UINT64                  *Value,
    171          1.1    jruoho     void                    *HandlerContext,
    172          1.1    jruoho     void                    *RegionContext);
    173          1.1    jruoho 
    174          1.1    jruoho UINT32
    175          1.1    jruoho AeGpeHandler (
    176      1.1.1.2    jruoho     ACPI_HANDLE             GpeDevice,
    177      1.1.1.2    jruoho     UINT32                  GpeNumber,
    178      1.1.1.2    jruoho     void                    *Context);
    179      1.1.1.2    jruoho 
    180      1.1.1.2    jruoho void
    181      1.1.1.2    jruoho AeGlobalEventHandler (
    182      1.1.1.2    jruoho     UINT32                  Type,
    183      1.1.1.2    jruoho     ACPI_HANDLE             GpeDevice,
    184      1.1.1.2    jruoho     UINT32                  EventNumber,
    185          1.1    jruoho     void                    *Context);
    186          1.1    jruoho 
    187      1.1.1.4  christos /* aeregion */
    188      1.1.1.4  christos 
    189      1.1.1.4  christos ACPI_STATUS
    190      1.1.1.4  christos AeInstallDeviceHandlers (
    191      1.1.1.4  christos     void);
    192      1.1.1.4  christos 
    193      1.1.1.4  christos void
    194      1.1.1.4  christos AeInstallRegionHandlers (
    195      1.1.1.4  christos     void);
    196      1.1.1.4  christos 
    197      1.1.1.4  christos void
    198      1.1.1.4  christos AeOverrideRegionHandlers (
    199      1.1.1.4  christos     void);
    200      1.1.1.4  christos 
    201      1.1.1.4  christos 
    202  1.1.1.4.2.1     skrll /* aeinitfile */
    203  1.1.1.4.2.1     skrll 
    204  1.1.1.4.2.1     skrll int
    205  1.1.1.4.2.1     skrll AeOpenInitializationFile (
    206  1.1.1.4.2.1     skrll     char                    *Filename);
    207  1.1.1.4.2.1     skrll 
    208  1.1.1.4.2.1     skrll void
    209  1.1.1.4.2.1     skrll AeDoObjectOverrides (
    210  1.1.1.4.2.1     skrll     void);
    211  1.1.1.4.2.1     skrll 
    212          1.1    jruoho #endif /* _AECOMMON */
    213