Home | History | Annotate | Line # | Download | only in platform
      1       1.1  christos /******************************************************************************
      2       1.1  christos  *
      3       1.1  christos  * Name: acefiex.h - Extra OS specific defines, etc. for EFI
      4       1.1  christos  *
      5       1.1  christos  *****************************************************************************/
      6       1.1  christos 
      7  1.1.1.12  christos /******************************************************************************
      8  1.1.1.12  christos  *
      9  1.1.1.12  christos  * 1. Copyright Notice
     10  1.1.1.12  christos  *
     11  1.1.1.13  christos  * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
     12       1.1  christos  * All rights reserved.
     13       1.1  christos  *
     14  1.1.1.12  christos  * 2. License
     15  1.1.1.12  christos  *
     16  1.1.1.12  christos  * 2.1. This is your license from Intel Corp. under its intellectual property
     17  1.1.1.12  christos  * rights. You may have additional license terms from the party that provided
     18  1.1.1.12  christos  * you this software, covering your right to use that party's intellectual
     19  1.1.1.12  christos  * property rights.
     20  1.1.1.12  christos  *
     21  1.1.1.12  christos  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
     22  1.1.1.12  christos  * copy of the source code appearing in this file ("Covered Code") an
     23  1.1.1.12  christos  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
     24  1.1.1.12  christos  * base code distributed originally by Intel ("Original Intel Code") to copy,
     25  1.1.1.12  christos  * make derivatives, distribute, use and display any portion of the Covered
     26  1.1.1.12  christos  * Code in any form, with the right to sublicense such rights; and
     27  1.1.1.12  christos  *
     28  1.1.1.12  christos  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
     29  1.1.1.12  christos  * license (with the right to sublicense), under only those claims of Intel
     30  1.1.1.12  christos  * patents that are infringed by the Original Intel Code, to make, use, sell,
     31  1.1.1.12  christos  * offer to sell, and import the Covered Code and derivative works thereof
     32  1.1.1.12  christos  * solely to the minimum extent necessary to exercise the above copyright
     33  1.1.1.12  christos  * license, and in no event shall the patent license extend to any additions
     34  1.1.1.12  christos  * to or modifications of the Original Intel Code. No other license or right
     35  1.1.1.12  christos  * is granted directly or by implication, estoppel or otherwise;
     36  1.1.1.12  christos  *
     37  1.1.1.12  christos  * The above copyright and patent license is granted only if the following
     38  1.1.1.12  christos  * conditions are met:
     39  1.1.1.12  christos  *
     40  1.1.1.12  christos  * 3. Conditions
     41  1.1.1.12  christos  *
     42  1.1.1.12  christos  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
     43  1.1.1.12  christos  * Redistribution of source code of any substantial portion of the Covered
     44  1.1.1.12  christos  * Code or modification with rights to further distribute source must include
     45  1.1.1.12  christos  * the above Copyright Notice, the above License, this list of Conditions,
     46  1.1.1.12  christos  * and the following Disclaimer and Export Compliance provision. In addition,
     47  1.1.1.12  christos  * Licensee must cause all Covered Code to which Licensee contributes to
     48  1.1.1.12  christos  * contain a file documenting the changes Licensee made to create that Covered
     49  1.1.1.12  christos  * Code and the date of any change. Licensee must include in that file the
     50  1.1.1.12  christos  * documentation of any changes made by any predecessor Licensee. Licensee
     51  1.1.1.12  christos  * must include a prominent statement that the modification is derived,
     52  1.1.1.12  christos  * directly or indirectly, from Original Intel Code.
     53  1.1.1.12  christos  *
     54  1.1.1.12  christos  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
     55  1.1.1.12  christos  * Redistribution of source code of any substantial portion of the Covered
     56  1.1.1.12  christos  * Code or modification without rights to further distribute source must
     57  1.1.1.12  christos  * include the following Disclaimer and Export Compliance provision in the
     58  1.1.1.12  christos  * documentation and/or other materials provided with distribution. In
     59  1.1.1.12  christos  * addition, Licensee may not authorize further sublicense of source of any
     60  1.1.1.12  christos  * portion of the Covered Code, and must include terms to the effect that the
     61  1.1.1.12  christos  * license from Licensee to its licensee is limited to the intellectual
     62  1.1.1.12  christos  * property embodied in the software Licensee provides to its licensee, and
     63  1.1.1.12  christos  * not to intellectual property embodied in modifications its licensee may
     64  1.1.1.12  christos  * make.
     65  1.1.1.12  christos  *
     66  1.1.1.12  christos  * 3.3. Redistribution of Executable. Redistribution in executable form of any
     67  1.1.1.12  christos  * substantial portion of the Covered Code or modification must reproduce the
     68  1.1.1.12  christos  * above Copyright Notice, and the following Disclaimer and Export Compliance
     69  1.1.1.12  christos  * provision in the documentation and/or other materials provided with the
     70  1.1.1.12  christos  * distribution.
     71  1.1.1.12  christos  *
     72  1.1.1.12  christos  * 3.4. Intel retains all right, title, and interest in and to the Original
     73  1.1.1.12  christos  * Intel Code.
     74  1.1.1.12  christos  *
     75  1.1.1.12  christos  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
     76  1.1.1.12  christos  * Intel shall be used in advertising or otherwise to promote the sale, use or
     77  1.1.1.12  christos  * other dealings in products derived from or relating to the Covered Code
     78  1.1.1.12  christos  * without prior written authorization from Intel.
     79  1.1.1.12  christos  *
     80  1.1.1.12  christos  * 4. Disclaimer and Export Compliance
     81  1.1.1.12  christos  *
     82  1.1.1.12  christos  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
     83  1.1.1.12  christos  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
     84  1.1.1.12  christos  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
     85  1.1.1.12  christos  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
     86  1.1.1.12  christos  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
     87  1.1.1.12  christos  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
     88  1.1.1.12  christos  * PARTICULAR PURPOSE.
     89  1.1.1.12  christos  *
     90  1.1.1.12  christos  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
     91  1.1.1.12  christos  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
     92  1.1.1.12  christos  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
     93  1.1.1.12  christos  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
     94  1.1.1.12  christos  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
     95  1.1.1.12  christos  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
     96  1.1.1.12  christos  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
     97  1.1.1.12  christos  * LIMITED REMEDY.
     98  1.1.1.12  christos  *
     99  1.1.1.12  christos  * 4.3. Licensee shall not export, either directly or indirectly, any of this
    100  1.1.1.12  christos  * software or system incorporating such software without first obtaining any
    101  1.1.1.12  christos  * required license or other approval from the U. S. Department of Commerce or
    102  1.1.1.12  christos  * any other agency or department of the United States Government. In the
    103  1.1.1.12  christos  * event Licensee exports any such software from the United States or
    104  1.1.1.12  christos  * re-exports any such software from a foreign destination, Licensee shall
    105  1.1.1.12  christos  * ensure that the distribution and export/re-export of the software is in
    106  1.1.1.12  christos  * compliance with all laws, regulations, orders, or other restrictions of the
    107  1.1.1.12  christos  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
    108  1.1.1.12  christos  * any of its subsidiaries will export/re-export any technical data, process,
    109  1.1.1.12  christos  * software, or service, directly or indirectly, to any country for which the
    110  1.1.1.12  christos  * United States government or any agency thereof requires an export license,
    111  1.1.1.12  christos  * other governmental approval, or letter of assurance, without first obtaining
    112  1.1.1.12  christos  * such license, approval or letter.
    113  1.1.1.12  christos  *
    114  1.1.1.12  christos  *****************************************************************************
    115  1.1.1.12  christos  *
    116  1.1.1.12  christos  * Alternatively, you may choose to be licensed under the terms of the
    117  1.1.1.12  christos  * following license:
    118  1.1.1.12  christos  *
    119       1.1  christos  * Redistribution and use in source and binary forms, with or without
    120       1.1  christos  * modification, are permitted provided that the following conditions
    121       1.1  christos  * are met:
    122       1.1  christos  * 1. Redistributions of source code must retain the above copyright
    123       1.1  christos  *    notice, this list of conditions, and the following disclaimer,
    124       1.1  christos  *    without modification.
    125       1.1  christos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
    126       1.1  christos  *    substantially similar to the "NO WARRANTY" disclaimer below
    127       1.1  christos  *    ("Disclaimer") and any redistribution must be conditioned upon
    128       1.1  christos  *    including a substantially similar Disclaimer requirement for further
    129       1.1  christos  *    binary redistribution.
    130       1.1  christos  * 3. Neither the names of the above-listed copyright holders nor the names
    131       1.1  christos  *    of any contributors may be used to endorse or promote products derived
    132       1.1  christos  *    from this software without specific prior written permission.
    133       1.1  christos  *
    134       1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    135       1.1  christos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    136   1.1.1.9  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    137       1.1  christos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    138  1.1.1.12  christos  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    139  1.1.1.12  christos  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    140  1.1.1.12  christos  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    141  1.1.1.12  christos  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    142  1.1.1.12  christos  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    143  1.1.1.12  christos  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    144  1.1.1.12  christos  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    145  1.1.1.12  christos  *
    146  1.1.1.12  christos  * Alternatively, you may choose to be licensed under the terms of the
    147  1.1.1.12  christos  * GNU General Public License ("GPL") version 2 as published by the Free
    148  1.1.1.12  christos  * Software Foundation.
    149  1.1.1.12  christos  *
    150  1.1.1.12  christos  *****************************************************************************/
    151       1.1  christos 
    152       1.1  christos #ifndef __ACEFIEX_H__
    153       1.1  christos #define __ACEFIEX_H__
    154       1.1  christos 
    155       1.1  christos 
    156   1.1.1.3  christos #ifndef ACPI_USE_SYSTEM_CLIBRARY
    157   1.1.1.3  christos 
    158   1.1.1.3  christos typedef signed char                     int8_t;
    159   1.1.1.3  christos typedef short int                       int16_t;
    160   1.1.1.3  christos typedef int                             int32_t;
    161   1.1.1.3  christos typedef unsigned char                   uint8_t;
    162   1.1.1.3  christos typedef unsigned short int              uint16_t;
    163   1.1.1.3  christos typedef unsigned int                    uint32_t;
    164   1.1.1.3  christos typedef COMPILER_DEPENDENT_INT64        int64_t;
    165   1.1.1.3  christos typedef COMPILER_DEPENDENT_UINT64       uint64_t;
    166   1.1.1.3  christos 
    167   1.1.1.3  christos #endif /* ACPI_USE_SYSTEM_CLIBRARY */
    168   1.1.1.3  christos 
    169   1.1.1.3  christos #define ACPI_EFI_ERROR(a)               (((INTN) a) < 0)
    170   1.1.1.3  christos #define ACPI_EFI_SUCCESS                0
    171   1.1.1.3  christos #define ACPI_EFI_LOAD_ERROR             ACPI_EFI_ERR(1)
    172   1.1.1.3  christos #define ACPI_EFI_INVALID_PARAMETER      ACPI_EFI_ERR(2)
    173   1.1.1.3  christos #define ACPI_EFI_UNSUPPORTED            ACPI_EFI_ERR(3)
    174   1.1.1.3  christos #define ACPI_EFI_BAD_BUFFER_SIZE        ACPI_EFI_ERR(4)
    175   1.1.1.3  christos #define ACPI_EFI_BUFFER_TOO_SMALL       ACPI_EFI_ERR(5)
    176   1.1.1.3  christos #define ACPI_EFI_NOT_READY              ACPI_EFI_ERR(6)
    177   1.1.1.3  christos #define ACPI_EFI_DEVICE_ERROR           ACPI_EFI_ERR(7)
    178   1.1.1.3  christos #define ACPI_EFI_WRITE_PROTECTED        ACPI_EFI_ERR(8)
    179   1.1.1.3  christos #define ACPI_EFI_OUT_OF_RESOURCES       ACPI_EFI_ERR(9)
    180   1.1.1.3  christos #define ACPI_EFI_VOLUME_CORRUPTED       ACPI_EFI_ERR(10)
    181   1.1.1.3  christos #define ACPI_EFI_VOLUME_FULL            ACPI_EFI_ERR(11)
    182   1.1.1.3  christos #define ACPI_EFI_NO_MEDIA               ACPI_EFI_ERR(12)
    183   1.1.1.3  christos #define ACPI_EFI_MEDIA_CHANGED          ACPI_EFI_ERR(13)
    184   1.1.1.3  christos #define ACPI_EFI_NOT_FOUND              ACPI_EFI_ERR(14)
    185   1.1.1.3  christos #define ACPI_EFI_ACCESS_DENIED          ACPI_EFI_ERR(15)
    186   1.1.1.3  christos #define ACPI_EFI_NO_RESPONSE            ACPI_EFI_ERR(16)
    187   1.1.1.3  christos #define ACPI_EFI_NO_MAPPING             ACPI_EFI_ERR(17)
    188   1.1.1.3  christos #define ACPI_EFI_TIMEOUT                ACPI_EFI_ERR(18)
    189   1.1.1.3  christos #define ACPI_EFI_NOT_STARTED            ACPI_EFI_ERR(19)
    190   1.1.1.3  christos #define ACPI_EFI_ALREADY_STARTED        ACPI_EFI_ERR(20)
    191   1.1.1.3  christos #define ACPI_EFI_ABORTED                ACPI_EFI_ERR(21)
    192   1.1.1.3  christos #define ACPI_EFI_PROTOCOL_ERROR         ACPI_EFI_ERR(24)
    193   1.1.1.3  christos 
    194   1.1.1.3  christos 
    195   1.1.1.3  christos typedef UINTN ACPI_EFI_STATUS;
    196   1.1.1.3  christos typedef VOID *ACPI_EFI_HANDLE;
    197   1.1.1.3  christos typedef VOID *ACPI_EFI_EVENT;
    198       1.1  christos 
    199       1.1  christos typedef struct {
    200       1.1  christos     UINT32  Data1;
    201       1.1  christos     UINT16  Data2;
    202       1.1  christos     UINT16  Data3;
    203       1.1  christos     UINT8   Data4[8];
    204   1.1.1.3  christos } ACPI_EFI_GUID;
    205       1.1  christos 
    206   1.1.1.4  christos typedef struct {
    207   1.1.1.4  christos     UINT16 Year;       /* 1998 - 20XX */
    208   1.1.1.4  christos     UINT8  Month;      /* 1 - 12 */
    209   1.1.1.4  christos     UINT8  Day;        /* 1 - 31 */
    210   1.1.1.4  christos     UINT8  Hour;       /* 0 - 23 */
    211   1.1.1.4  christos     UINT8  Minute;     /* 0 - 59 */
    212   1.1.1.4  christos     UINT8  Second;     /* 0 - 59 */
    213   1.1.1.4  christos     UINT8  Pad1;
    214   1.1.1.4  christos     UINT32 Nanosecond; /* 0 - 999,999,999 */
    215   1.1.1.4  christos     INT16  TimeZone;   /* -1440 to 1440 or 2047 */
    216   1.1.1.4  christos     UINT8  Daylight;
    217   1.1.1.4  christos     UINT8  Pad2;
    218   1.1.1.4  christos } ACPI_EFI_TIME;
    219   1.1.1.4  christos 
    220   1.1.1.3  christos typedef struct _ACPI_EFI_DEVICE_PATH {
    221       1.1  christos         UINT8                           Type;
    222       1.1  christos         UINT8                           SubType;
    223       1.1  christos         UINT8                           Length[2];
    224   1.1.1.3  christos } ACPI_EFI_DEVICE_PATH;
    225       1.1  christos 
    226   1.1.1.3  christos typedef UINT64          ACPI_EFI_PHYSICAL_ADDRESS;
    227   1.1.1.3  christos typedef UINT64          ACPI_EFI_VIRTUAL_ADDRESS;
    228       1.1  christos 
    229       1.1  christos typedef enum {
    230   1.1.1.3  christos     AcpiEfiAllocateAnyPages,
    231   1.1.1.3  christos     AcpiEfiAllocateMaxAddress,
    232   1.1.1.3  christos     AcpiEfiAllocateAddress,
    233   1.1.1.3  christos     AcpiEfiMaxAllocateType
    234   1.1.1.3  christos } ACPI_EFI_ALLOCATE_TYPE;
    235       1.1  christos 
    236       1.1  christos typedef enum {
    237   1.1.1.3  christos     AcpiEfiReservedMemoryType,
    238   1.1.1.3  christos     AcpiEfiLoaderCode,
    239   1.1.1.3  christos     AcpiEfiLoaderData,
    240   1.1.1.3  christos     AcpiEfiBootServicesCode,
    241   1.1.1.3  christos     AcpiEfiBootServicesData,
    242   1.1.1.3  christos     AcpiEfiRuntimeServicesCode,
    243   1.1.1.3  christos     AcpiEfiRuntimeServicesData,
    244   1.1.1.3  christos     AcpiEfiConventionalMemory,
    245   1.1.1.3  christos     AcpiEfiUnusableMemory,
    246   1.1.1.3  christos     AcpiEfiACPIReclaimMemory,
    247   1.1.1.3  christos     AcpiEfiACPIMemoryNVS,
    248   1.1.1.3  christos     AcpiEfiMemoryMappedIO,
    249   1.1.1.3  christos     AcpiEfiMemoryMappedIOPortSpace,
    250   1.1.1.3  christos     AcpiEfiPalCode,
    251   1.1.1.3  christos     AcpiEfiMaxMemoryType
    252   1.1.1.3  christos } ACPI_EFI_MEMORY_TYPE;
    253       1.1  christos 
    254       1.1  christos /* possible caching types for the memory range */
    255   1.1.1.3  christos #define ACPI_EFI_MEMORY_UC      0x0000000000000001
    256   1.1.1.3  christos #define ACPI_EFI_MEMORY_WC      0x0000000000000002
    257   1.1.1.3  christos #define ACPI_EFI_MEMORY_WT      0x0000000000000004
    258   1.1.1.3  christos #define ACPI_EFI_MEMORY_WB      0x0000000000000008
    259   1.1.1.3  christos #define ACPI_EFI_MEMORY_UCE     0x0000000000000010
    260       1.1  christos 
    261       1.1  christos /* physical memory protection on range */
    262   1.1.1.3  christos #define ACPI_EFI_MEMORY_WP      0x0000000000001000
    263   1.1.1.3  christos #define ACPI_EFI_MEMORY_RP      0x0000000000002000
    264   1.1.1.3  christos #define ACPI_EFI_MEMORY_XP      0x0000000000004000
    265       1.1  christos 
    266       1.1  christos /* range requires a runtime mapping */
    267   1.1.1.3  christos #define ACPI_EFI_MEMORY_RUNTIME 0x8000000000000000
    268       1.1  christos 
    269   1.1.1.3  christos #define ACPI_EFI_MEMORY_DESCRIPTOR_VERSION  1
    270       1.1  christos typedef struct {
    271       1.1  christos     UINT32                          Type;
    272       1.1  christos     UINT32                          Pad;
    273   1.1.1.3  christos     ACPI_EFI_PHYSICAL_ADDRESS       PhysicalStart;
    274   1.1.1.3  christos     ACPI_EFI_VIRTUAL_ADDRESS        VirtualStart;
    275       1.1  christos     UINT64                          NumberOfPages;
    276       1.1  christos     UINT64                          Attribute;
    277   1.1.1.3  christos } ACPI_EFI_MEMORY_DESCRIPTOR;
    278       1.1  christos 
    279   1.1.1.3  christos typedef struct _ACPI_EFI_TABLE_HEARDER {
    280       1.1  christos     UINT64                      Signature;
    281       1.1  christos     UINT32                      Revision;
    282       1.1  christos     UINT32                      HeaderSize;
    283       1.1  christos     UINT32                      CRC32;
    284       1.1  christos     UINT32                      Reserved;
    285   1.1.1.3  christos } ACPI_EFI_TABLE_HEADER;
    286       1.1  christos 
    287       1.1  christos typedef
    288   1.1.1.3  christos ACPI_EFI_STATUS
    289   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_UNKNOWN_INTERFACE) (
    290       1.1  christos     void);
    291       1.1  christos 
    292       1.1  christos 
    293       1.1  christos /*
    294       1.1  christos  * Text output protocol
    295       1.1  christos  */
    296   1.1.1.3  christos #define ACPI_SIMPLE_TEXT_OUTPUT_PROTOCOL \
    297       1.1  christos     { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
    298       1.1  christos 
    299       1.1  christos typedef
    300   1.1.1.3  christos ACPI_EFI_STATUS
    301   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_TEXT_RESET) (
    302   1.1.1.3  christos     struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
    303   1.1.1.3  christos     BOOLEAN                                     ExtendedVerification);
    304       1.1  christos 
    305       1.1  christos typedef
    306   1.1.1.3  christos ACPI_EFI_STATUS
    307   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_TEXT_OUTPUT_STRING) (
    308   1.1.1.3  christos     struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
    309   1.1.1.3  christos     CHAR16                                      *String);
    310       1.1  christos 
    311       1.1  christos typedef
    312   1.1.1.3  christos ACPI_EFI_STATUS
    313   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_TEXT_TEST_STRING) (
    314   1.1.1.3  christos     struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
    315   1.1.1.3  christos     CHAR16                                      *String);
    316       1.1  christos 
    317       1.1  christos typedef
    318   1.1.1.3  christos ACPI_EFI_STATUS
    319   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_TEXT_QUERY_MODE) (
    320   1.1.1.3  christos     struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
    321   1.1.1.3  christos     UINTN                                       ModeNumber,
    322   1.1.1.3  christos     UINTN                                       *Columns,
    323   1.1.1.3  christos     UINTN                                       *Rows);
    324       1.1  christos 
    325       1.1  christos typedef
    326   1.1.1.3  christos ACPI_EFI_STATUS
    327   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_TEXT_SET_MODE) (
    328   1.1.1.3  christos     struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
    329   1.1.1.3  christos     UINTN                                       ModeNumber);
    330       1.1  christos 
    331       1.1  christos typedef
    332   1.1.1.3  christos ACPI_EFI_STATUS
    333   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_TEXT_SET_ATTRIBUTE) (
    334   1.1.1.3  christos     struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
    335   1.1.1.3  christos     UINTN                                       Attribute);
    336       1.1  christos 
    337       1.1  christos typedef
    338   1.1.1.3  christos ACPI_EFI_STATUS
    339   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_TEXT_CLEAR_SCREEN) (
    340   1.1.1.3  christos     struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This);
    341       1.1  christos 
    342       1.1  christos typedef
    343   1.1.1.3  christos ACPI_EFI_STATUS
    344   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_TEXT_SET_CURSOR_POSITION) (
    345   1.1.1.3  christos     struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
    346   1.1.1.3  christos     UINTN                                       Column,
    347   1.1.1.3  christos     UINTN                                       Row);
    348       1.1  christos 
    349       1.1  christos typedef
    350   1.1.1.3  christos ACPI_EFI_STATUS
    351   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_TEXT_ENABLE_CURSOR) (
    352   1.1.1.3  christos     struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
    353   1.1.1.3  christos     BOOLEAN                                     Enable);
    354       1.1  christos 
    355       1.1  christos typedef struct {
    356       1.1  christos     INT32                           MaxMode;
    357       1.1  christos     INT32                           Mode;
    358       1.1  christos     INT32                           Attribute;
    359       1.1  christos     INT32                           CursorColumn;
    360       1.1  christos     INT32                           CursorRow;
    361       1.1  christos     BOOLEAN                         CursorVisible;
    362   1.1.1.3  christos } ACPI_SIMPLE_TEXT_OUTPUT_MODE;
    363       1.1  christos 
    364   1.1.1.3  christos typedef struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE {
    365   1.1.1.3  christos     ACPI_EFI_TEXT_RESET                 Reset;
    366       1.1  christos 
    367   1.1.1.3  christos     ACPI_EFI_TEXT_OUTPUT_STRING         OutputString;
    368   1.1.1.3  christos     ACPI_EFI_TEXT_TEST_STRING           TestString;
    369       1.1  christos 
    370   1.1.1.3  christos     ACPI_EFI_TEXT_QUERY_MODE            QueryMode;
    371   1.1.1.3  christos     ACPI_EFI_TEXT_SET_MODE              SetMode;
    372   1.1.1.3  christos     ACPI_EFI_TEXT_SET_ATTRIBUTE         SetAttribute;
    373       1.1  christos 
    374   1.1.1.3  christos     ACPI_EFI_TEXT_CLEAR_SCREEN          ClearScreen;
    375   1.1.1.3  christos     ACPI_EFI_TEXT_SET_CURSOR_POSITION   SetCursorPosition;
    376   1.1.1.3  christos     ACPI_EFI_TEXT_ENABLE_CURSOR         EnableCursor;
    377       1.1  christos 
    378   1.1.1.3  christos     ACPI_SIMPLE_TEXT_OUTPUT_MODE        *Mode;
    379   1.1.1.3  christos } ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE;
    380       1.1  christos 
    381       1.1  christos /*
    382       1.1  christos  * Text input protocol
    383       1.1  christos  */
    384   1.1.1.3  christos #define ACPI_SIMPLE_TEXT_INPUT_PROTOCOL  \
    385       1.1  christos     { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
    386       1.1  christos 
    387       1.1  christos typedef struct {
    388       1.1  christos     UINT16                              ScanCode;
    389       1.1  christos     CHAR16                              UnicodeChar;
    390   1.1.1.3  christos } ACPI_EFI_INPUT_KEY;
    391       1.1  christos 
    392       1.1  christos /*
    393       1.1  christos  * Baseline unicode control chars
    394       1.1  christos  */
    395       1.1  christos #define CHAR_NULL                       0x0000
    396       1.1  christos #define CHAR_BACKSPACE                  0x0008
    397       1.1  christos #define CHAR_TAB                        0x0009
    398       1.1  christos #define CHAR_LINEFEED                   0x000A
    399       1.1  christos #define CHAR_CARRIAGE_RETURN            0x000D
    400       1.1  christos 
    401       1.1  christos typedef
    402   1.1.1.3  christos ACPI_EFI_STATUS
    403   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_INPUT_RESET) (
    404   1.1.1.3  christos     struct _ACPI_SIMPLE_INPUT_INTERFACE         *This,
    405       1.1  christos     BOOLEAN                                     ExtendedVerification);
    406       1.1  christos 
    407       1.1  christos typedef
    408   1.1.1.3  christos ACPI_EFI_STATUS
    409   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_INPUT_READ_KEY) (
    410   1.1.1.3  christos     struct _ACPI_SIMPLE_INPUT_INTERFACE         *This,
    411   1.1.1.3  christos     ACPI_EFI_INPUT_KEY                          *Key);
    412   1.1.1.3  christos 
    413   1.1.1.3  christos typedef struct _ACPI_SIMPLE_INPUT_INTERFACE {
    414   1.1.1.3  christos     ACPI_EFI_INPUT_RESET                    Reset;
    415   1.1.1.3  christos     ACPI_EFI_INPUT_READ_KEY                 ReadKeyStroke;
    416   1.1.1.3  christos     ACPI_EFI_EVENT                          WaitForKey;
    417   1.1.1.3  christos } ACPI_SIMPLE_INPUT_INTERFACE;
    418       1.1  christos 
    419       1.1  christos 
    420       1.1  christos /*
    421       1.1  christos  * Simple file system protocol
    422       1.1  christos  */
    423   1.1.1.3  christos #define ACPI_SIMPLE_FILE_SYSTEM_PROTOCOL \
    424       1.1  christos     { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
    425       1.1  christos 
    426       1.1  christos typedef
    427   1.1.1.3  christos ACPI_EFI_STATUS
    428   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_VOLUME_OPEN) (
    429   1.1.1.3  christos     struct _ACPI_EFI_FILE_IO_INTERFACE          *This,
    430   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                **Root);
    431       1.1  christos 
    432   1.1.1.3  christos #define ACPI_EFI_FILE_IO_INTERFACE_REVISION     0x00010000
    433       1.1  christos 
    434   1.1.1.3  christos typedef struct _ACPI_EFI_FILE_IO_INTERFACE {
    435       1.1  christos     UINT64                  Revision;
    436   1.1.1.3  christos     ACPI_EFI_VOLUME_OPEN    OpenVolume;
    437   1.1.1.3  christos } ACPI_EFI_FILE_IO_INTERFACE;
    438       1.1  christos 
    439       1.1  christos typedef
    440   1.1.1.3  christos ACPI_EFI_STATUS
    441   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FILE_OPEN) (
    442   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                *File,
    443   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                **NewHandle,
    444       1.1  christos     CHAR16                                      *FileName,
    445       1.1  christos     UINT64                                      OpenMode,
    446       1.1  christos     UINT64                                      Attributes);
    447       1.1  christos 
    448       1.1  christos /* Values for OpenMode used above */
    449       1.1  christos 
    450   1.1.1.3  christos #define ACPI_EFI_FILE_MODE_READ     0x0000000000000001
    451   1.1.1.3  christos #define ACPI_EFI_FILE_MODE_WRITE    0x0000000000000002
    452   1.1.1.3  christos #define ACPI_EFI_FILE_MODE_CREATE   0x8000000000000000
    453       1.1  christos 
    454       1.1  christos /* Values for Attribute used above */
    455       1.1  christos 
    456   1.1.1.3  christos #define ACPI_EFI_FILE_READ_ONLY     0x0000000000000001
    457   1.1.1.3  christos #define ACPI_EFI_FILE_HIDDEN        0x0000000000000002
    458   1.1.1.3  christos #define ACPI_EFI_FILE_SYSTEM        0x0000000000000004
    459   1.1.1.3  christos #define ACPI_EFI_FILE_RESERVIED     0x0000000000000008
    460   1.1.1.3  christos #define ACPI_EFI_FILE_DIRECTORY     0x0000000000000010
    461   1.1.1.3  christos #define ACPI_EFI_FILE_ARCHIVE       0x0000000000000020
    462   1.1.1.3  christos #define ACPI_EFI_FILE_VALID_ATTR    0x0000000000000037
    463       1.1  christos 
    464       1.1  christos typedef
    465   1.1.1.3  christos ACPI_EFI_STATUS
    466   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FILE_CLOSE) (
    467   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                *File);
    468       1.1  christos 
    469       1.1  christos typedef
    470   1.1.1.3  christos ACPI_EFI_STATUS
    471   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FILE_DELETE) (
    472   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                *File);
    473       1.1  christos 
    474       1.1  christos typedef
    475   1.1.1.3  christos ACPI_EFI_STATUS
    476   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FILE_READ) (
    477   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                *File,
    478       1.1  christos     UINTN                                       *BufferSize,
    479       1.1  christos     VOID                                        *Buffer);
    480       1.1  christos 
    481       1.1  christos typedef
    482   1.1.1.3  christos ACPI_EFI_STATUS
    483   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FILE_WRITE) (
    484   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                *File,
    485       1.1  christos     UINTN                                       *BufferSize,
    486       1.1  christos     VOID                                        *Buffer);
    487       1.1  christos 
    488       1.1  christos typedef
    489   1.1.1.3  christos ACPI_EFI_STATUS
    490   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FILE_SET_POSITION) (
    491   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                *File,
    492       1.1  christos     UINT64                                      Position);
    493       1.1  christos 
    494       1.1  christos typedef
    495   1.1.1.3  christos ACPI_EFI_STATUS
    496   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FILE_GET_POSITION) (
    497   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                *File,
    498       1.1  christos     UINT64                                      *Position);
    499       1.1  christos 
    500   1.1.1.4  christos #define ACPI_EFI_FILE_INFO_ID \
    501   1.1.1.4  christos     { 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
    502   1.1.1.4  christos 
    503   1.1.1.4  christos typedef struct {
    504   1.1.1.4  christos     UINT64 Size;
    505   1.1.1.4  christos     UINT64 FileSize;
    506   1.1.1.4  christos     UINT64 PhysicalSize;
    507   1.1.1.4  christos     ACPI_EFI_TIME CreateTime;
    508   1.1.1.4  christos     ACPI_EFI_TIME LastAccessTime;
    509   1.1.1.4  christos     ACPI_EFI_TIME ModificationTime;
    510   1.1.1.4  christos     UINT64 Attribute;
    511  1.1.1.11  christos     CHAR16 FileName[];
    512   1.1.1.4  christos } ACPI_EFI_FILE_INFO;
    513   1.1.1.4  christos 
    514   1.1.1.4  christos #define SIZE_OF_ACPI_EFI_FILE_INFO  ACPI_OFFSET(ACPI_EFI_FILE_INFO, FileName)
    515   1.1.1.4  christos 
    516       1.1  christos typedef
    517   1.1.1.3  christos ACPI_EFI_STATUS
    518   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FILE_GET_INFO) (
    519   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                *File,
    520   1.1.1.3  christos     ACPI_EFI_GUID                               *InformationType,
    521       1.1  christos     UINTN                                       *BufferSize,
    522       1.1  christos     VOID                                        *Buffer);
    523       1.1  christos 
    524       1.1  christos typedef
    525   1.1.1.3  christos ACPI_EFI_STATUS
    526   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FILE_SET_INFO) (
    527   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                *File,
    528   1.1.1.3  christos     ACPI_EFI_GUID                               *InformationType,
    529       1.1  christos     UINTN                                       BufferSize,
    530       1.1  christos     VOID                                        *Buffer);
    531       1.1  christos 
    532       1.1  christos typedef
    533   1.1.1.3  christos ACPI_EFI_STATUS
    534   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FILE_FLUSH) (
    535   1.1.1.3  christos     struct _ACPI_EFI_FILE_HANDLE                *File);
    536   1.1.1.3  christos 
    537   1.1.1.3  christos 
    538   1.1.1.3  christos #define ACPI_EFI_FILE_HANDLE_REVISION           0x00010000
    539   1.1.1.3  christos 
    540   1.1.1.3  christos typedef struct _ACPI_EFI_FILE_HANDLE {
    541   1.1.1.3  christos     UINT64                      Revision;
    542   1.1.1.3  christos     ACPI_EFI_FILE_OPEN          Open;
    543   1.1.1.3  christos     ACPI_EFI_FILE_CLOSE         Close;
    544   1.1.1.3  christos     ACPI_EFI_FILE_DELETE        Delete;
    545   1.1.1.3  christos     ACPI_EFI_FILE_READ          Read;
    546   1.1.1.3  christos     ACPI_EFI_FILE_WRITE         Write;
    547   1.1.1.3  christos     ACPI_EFI_FILE_GET_POSITION  GetPosition;
    548   1.1.1.3  christos     ACPI_EFI_FILE_SET_POSITION  SetPosition;
    549   1.1.1.3  christos     ACPI_EFI_FILE_GET_INFO      GetInfo;
    550   1.1.1.3  christos     ACPI_EFI_FILE_SET_INFO      SetInfo;
    551   1.1.1.3  christos     ACPI_EFI_FILE_FLUSH         Flush;
    552   1.1.1.3  christos } ACPI_EFI_FILE_STRUCT, *ACPI_EFI_FILE_HANDLE;
    553       1.1  christos 
    554       1.1  christos 
    555       1.1  christos /*
    556       1.1  christos  * Loaded image protocol
    557       1.1  christos  */
    558   1.1.1.3  christos #define ACPI_EFI_LOADED_IMAGE_PROTOCOL \
    559       1.1  christos     { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
    560       1.1  christos 
    561       1.1  christos typedef
    562   1.1.1.3  christos ACPI_EFI_STATUS
    563   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_IMAGE_ENTRY_POINT) (
    564   1.1.1.3  christos     ACPI_EFI_HANDLE                         ImageHandle,
    565   1.1.1.3  christos     struct _ACPI_EFI_SYSTEM_TABLE           *SystemTable);
    566       1.1  christos 
    567       1.1  christos typedef
    568   1.1.1.3  christos ACPI_EFI_STATUS
    569   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_IMAGE_LOAD) (
    570       1.1  christos     BOOLEAN                         BootPolicy,
    571   1.1.1.3  christos     ACPI_EFI_HANDLE                 ParentImageHandle,
    572   1.1.1.3  christos     ACPI_EFI_DEVICE_PATH            *FilePath,
    573       1.1  christos     VOID                            *SourceBuffer,
    574       1.1  christos     UINTN                           SourceSize,
    575   1.1.1.3  christos     ACPI_EFI_HANDLE                 *ImageHandle);
    576       1.1  christos 
    577       1.1  christos typedef
    578   1.1.1.3  christos ACPI_EFI_STATUS
    579   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_IMAGE_START) (
    580   1.1.1.3  christos     ACPI_EFI_HANDLE                 ImageHandle,
    581       1.1  christos     UINTN                           *ExitDataSize,
    582       1.1  christos     CHAR16                          **ExitData);
    583       1.1  christos 
    584       1.1  christos typedef
    585   1.1.1.3  christos ACPI_EFI_STATUS
    586   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_EXIT) (
    587   1.1.1.3  christos     ACPI_EFI_HANDLE                 ImageHandle,
    588   1.1.1.3  christos     ACPI_EFI_STATUS                 ExitStatus,
    589       1.1  christos     UINTN                           ExitDataSize,
    590       1.1  christos     CHAR16                          *ExitData);
    591       1.1  christos 
    592       1.1  christos typedef
    593   1.1.1.3  christos ACPI_EFI_STATUS
    594   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_IMAGE_UNLOAD) (
    595   1.1.1.3  christos     ACPI_EFI_HANDLE                 ImageHandle);
    596       1.1  christos 
    597       1.1  christos 
    598   1.1.1.4  christos typedef
    599   1.1.1.4  christos ACPI_EFI_STATUS
    600   1.1.1.5  christos (ACPI_EFI_API *ACPI_EFI_STALL) (
    601   1.1.1.5  christos     UINTN                           Microseconds);
    602   1.1.1.5  christos 
    603   1.1.1.5  christos typedef
    604   1.1.1.5  christos ACPI_EFI_STATUS
    605   1.1.1.4  christos (ACPI_EFI_API *ACPI_EFI_SET_WATCHDOG_TIMER) (
    606   1.1.1.4  christos     UINTN                           Timeout,
    607   1.1.1.4  christos     UINT64                          WatchdogCode,
    608   1.1.1.4  christos     UINTN                           DataSize,
    609   1.1.1.4  christos     CHAR16                          *WatchdogData);
    610   1.1.1.4  christos 
    611   1.1.1.4  christos 
    612       1.1  christos #define EFI_IMAGE_INFORMATION_REVISION      0x1000
    613       1.1  christos typedef struct {
    614       1.1  christos     UINT32                          Revision;
    615   1.1.1.3  christos     ACPI_EFI_HANDLE                 ParentHandle;
    616   1.1.1.3  christos     struct _ACPI_EFI_SYSTEM_TABLE   *SystemTable;
    617   1.1.1.3  christos     ACPI_EFI_HANDLE                 DeviceHandle;
    618   1.1.1.3  christos     ACPI_EFI_DEVICE_PATH            *FilePath;
    619       1.1  christos     VOID                            *Reserved;
    620       1.1  christos     UINT32                          LoadOptionsSize;
    621       1.1  christos     VOID                            *LoadOptions;
    622       1.1  christos     VOID                            *ImageBase;
    623       1.1  christos     UINT64                          ImageSize;
    624   1.1.1.3  christos     ACPI_EFI_MEMORY_TYPE            ImageCodeType;
    625   1.1.1.3  christos     ACPI_EFI_MEMORY_TYPE            ImageDataType;
    626   1.1.1.3  christos     ACPI_EFI_IMAGE_UNLOAD           Unload;
    627       1.1  christos 
    628   1.1.1.3  christos } ACPI_EFI_LOADED_IMAGE;
    629       1.1  christos 
    630       1.1  christos 
    631       1.1  christos /*
    632       1.1  christos  * EFI Memory
    633       1.1  christos  */
    634       1.1  christos typedef
    635   1.1.1.3  christos ACPI_EFI_STATUS
    636   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_ALLOCATE_PAGES) (
    637   1.1.1.3  christos     ACPI_EFI_ALLOCATE_TYPE          Type,
    638   1.1.1.3  christos     ACPI_EFI_MEMORY_TYPE            MemoryType,
    639       1.1  christos     UINTN                           NoPages,
    640   1.1.1.3  christos     ACPI_EFI_PHYSICAL_ADDRESS       *Memory);
    641       1.1  christos 
    642       1.1  christos typedef
    643   1.1.1.3  christos ACPI_EFI_STATUS
    644   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FREE_PAGES) (
    645   1.1.1.3  christos     ACPI_EFI_PHYSICAL_ADDRESS       Memory,
    646       1.1  christos     UINTN                           NoPages);
    647       1.1  christos 
    648       1.1  christos typedef
    649   1.1.1.3  christos ACPI_EFI_STATUS
    650   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_GET_MEMORY_MAP) (
    651       1.1  christos     UINTN                           *MemoryMapSize,
    652   1.1.1.3  christos     ACPI_EFI_MEMORY_DESCRIPTOR      *MemoryMap,
    653       1.1  christos     UINTN                           *MapKey,
    654       1.1  christos     UINTN                           *DescriptorSize,
    655       1.1  christos     UINT32                          *DescriptorVersion);
    656       1.1  christos 
    657   1.1.1.3  christos #define NextMemoryDescriptor(Ptr,Size)  ((ACPI_EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) Ptr) + Size))
    658       1.1  christos 
    659       1.1  christos typedef
    660   1.1.1.3  christos ACPI_EFI_STATUS
    661   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_ALLOCATE_POOL) (
    662   1.1.1.3  christos     ACPI_EFI_MEMORY_TYPE            PoolType,
    663       1.1  christos     UINTN                           Size,
    664       1.1  christos     VOID                            **Buffer);
    665       1.1  christos 
    666       1.1  christos typedef
    667   1.1.1.3  christos ACPI_EFI_STATUS
    668   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_FREE_POOL) (
    669       1.1  christos     VOID                            *Buffer);
    670       1.1  christos 
    671       1.1  christos 
    672       1.1  christos /*
    673   1.1.1.5  christos  * EFI Time
    674   1.1.1.5  christos  */
    675   1.1.1.5  christos typedef struct {
    676   1.1.1.5  christos     UINT32 Resolution;
    677   1.1.1.5  christos     UINT32 Accuracy;
    678   1.1.1.5  christos     BOOLEAN SetsToZero;
    679   1.1.1.5  christos } ACPI_EFI_TIME_CAPABILITIES;
    680   1.1.1.5  christos 
    681   1.1.1.5  christos typedef
    682   1.1.1.5  christos ACPI_EFI_STATUS
    683   1.1.1.5  christos (ACPI_EFI_API *ACPI_EFI_GET_TIME) (
    684   1.1.1.5  christos     ACPI_EFI_TIME                   *Time,
    685   1.1.1.5  christos     ACPI_EFI_TIME_CAPABILITIES      *Capabilities);
    686   1.1.1.5  christos 
    687   1.1.1.5  christos typedef
    688   1.1.1.5  christos ACPI_EFI_STATUS
    689   1.1.1.5  christos (ACPI_EFI_API *ACPI_EFI_SET_TIME) (
    690   1.1.1.5  christos     ACPI_EFI_TIME                   *Time);
    691   1.1.1.5  christos 
    692   1.1.1.5  christos 
    693   1.1.1.5  christos /*
    694       1.1  christos  * Protocol handler functions
    695       1.1  christos  */
    696       1.1  christos typedef enum {
    697   1.1.1.3  christos     ACPI_EFI_NATIVE_INTERFACE,
    698   1.1.1.3  christos     ACPI_EFI_PCODE_INTERFACE
    699   1.1.1.3  christos } ACPI_EFI_INTERFACE_TYPE;
    700       1.1  christos 
    701       1.1  christos typedef enum {
    702   1.1.1.3  christos     AcpiEfiAllHandles,
    703   1.1.1.3  christos     AcpiEfiByRegisterNotify,
    704   1.1.1.3  christos     AcpiEfiByProtocol
    705   1.1.1.3  christos } ACPI_EFI_LOCATE_SEARCH_TYPE;
    706       1.1  christos 
    707       1.1  christos typedef
    708   1.1.1.3  christos ACPI_EFI_STATUS
    709   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_INSTALL_PROTOCOL_INTERFACE) (
    710   1.1.1.3  christos     ACPI_EFI_HANDLE                 *Handle,
    711   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    712   1.1.1.3  christos     ACPI_EFI_INTERFACE_TYPE         InterfaceType,
    713       1.1  christos     VOID                            *Interface);
    714       1.1  christos 
    715       1.1  christos typedef
    716   1.1.1.3  christos ACPI_EFI_STATUS
    717   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_REINSTALL_PROTOCOL_INTERFACE) (
    718   1.1.1.3  christos     ACPI_EFI_HANDLE                 Handle,
    719   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    720       1.1  christos     VOID                            *OldInterface,
    721       1.1  christos     VOID                            *NewInterface);
    722       1.1  christos 
    723       1.1  christos typedef
    724   1.1.1.3  christos ACPI_EFI_STATUS
    725   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_UNINSTALL_PROTOCOL_INTERFACE) (
    726   1.1.1.3  christos     ACPI_EFI_HANDLE                 Handle,
    727   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    728       1.1  christos     VOID                            *Interface);
    729       1.1  christos 
    730       1.1  christos typedef
    731   1.1.1.3  christos ACPI_EFI_STATUS
    732   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_HANDLE_PROTOCOL) (
    733   1.1.1.3  christos     ACPI_EFI_HANDLE                 Handle,
    734   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    735       1.1  christos     VOID                            **Interface);
    736       1.1  christos 
    737       1.1  christos typedef
    738   1.1.1.3  christos ACPI_EFI_STATUS
    739   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_REGISTER_PROTOCOL_NOTIFY) (
    740   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    741   1.1.1.3  christos     ACPI_EFI_EVENT                  Event,
    742       1.1  christos     VOID                            **Registration);
    743       1.1  christos 
    744       1.1  christos typedef
    745   1.1.1.3  christos ACPI_EFI_STATUS
    746   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_LOCATE_HANDLE) (
    747   1.1.1.3  christos     ACPI_EFI_LOCATE_SEARCH_TYPE     SearchType,
    748   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    749       1.1  christos     VOID                            *SearchKey,
    750       1.1  christos     UINTN                           *BufferSize,
    751   1.1.1.3  christos     ACPI_EFI_HANDLE                 *Buffer);
    752       1.1  christos 
    753       1.1  christos typedef
    754   1.1.1.3  christos ACPI_EFI_STATUS
    755   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_LOCATE_DEVICE_PATH) (
    756   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    757   1.1.1.3  christos     ACPI_EFI_DEVICE_PATH            **DevicePath,
    758   1.1.1.3  christos     ACPI_EFI_HANDLE                 *Device);
    759       1.1  christos 
    760       1.1  christos typedef
    761   1.1.1.3  christos ACPI_EFI_STATUS
    762   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_INSTALL_CONFIGURATION_TABLE) (
    763   1.1.1.3  christos     ACPI_EFI_GUID                   *Guid,
    764       1.1  christos     VOID                            *Table);
    765       1.1  christos 
    766   1.1.1.3  christos #define ACPI_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL  0x00000001
    767   1.1.1.3  christos #define ACPI_EFI_OPEN_PROTOCOL_GET_PROTOCOL        0x00000002
    768   1.1.1.3  christos #define ACPI_EFI_OPEN_PROTOCOL_TEST_PROTOCOL       0x00000004
    769   1.1.1.3  christos #define ACPI_EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
    770   1.1.1.3  christos #define ACPI_EFI_OPEN_PROTOCOL_BY_DRIVER           0x00000010
    771   1.1.1.3  christos #define ACPI_EFI_OPEN_PROTOCOL_EXCLUSIVE           0x00000020
    772       1.1  christos 
    773       1.1  christos typedef
    774   1.1.1.3  christos ACPI_EFI_STATUS
    775   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_OPEN_PROTOCOL) (
    776   1.1.1.3  christos     ACPI_EFI_HANDLE                 Handle,
    777   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    778       1.1  christos     VOID                            **Interface,
    779   1.1.1.3  christos     ACPI_EFI_HANDLE                 AgentHandle,
    780   1.1.1.3  christos     ACPI_EFI_HANDLE                 ControllerHandle,
    781       1.1  christos     UINT32                          Attributes);
    782       1.1  christos 
    783       1.1  christos typedef
    784   1.1.1.3  christos ACPI_EFI_STATUS
    785   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_CLOSE_PROTOCOL) (
    786   1.1.1.3  christos     ACPI_EFI_HANDLE                 Handle,
    787   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    788   1.1.1.3  christos     ACPI_EFI_HANDLE                 AgentHandle,
    789   1.1.1.3  christos     ACPI_EFI_HANDLE                 ControllerHandle);
    790       1.1  christos 
    791       1.1  christos typedef struct {
    792   1.1.1.3  christos     ACPI_EFI_HANDLE                 AgentHandle;
    793   1.1.1.3  christos     ACPI_EFI_HANDLE                 ControllerHandle;
    794   1.1.1.3  christos     UINT32                          Attributes;
    795   1.1.1.3  christos     UINT32                          OpenCount;
    796   1.1.1.3  christos } ACPI_EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
    797       1.1  christos 
    798       1.1  christos typedef
    799   1.1.1.3  christos ACPI_EFI_STATUS
    800   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_OPEN_PROTOCOL_INFORMATION) (
    801   1.1.1.3  christos     ACPI_EFI_HANDLE                 Handle,
    802   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    803   1.1.1.3  christos     ACPI_EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
    804       1.1  christos     UINTN                           *EntryCount);
    805       1.1  christos 
    806       1.1  christos typedef
    807   1.1.1.3  christos ACPI_EFI_STATUS
    808   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_PROTOCOLS_PER_HANDLE) (
    809   1.1.1.3  christos     ACPI_EFI_HANDLE                 Handle,
    810   1.1.1.3  christos     ACPI_EFI_GUID                   ***ProtocolBuffer,
    811       1.1  christos     UINTN                           *ProtocolBufferCount);
    812       1.1  christos 
    813       1.1  christos typedef
    814   1.1.1.3  christos ACPI_EFI_STATUS
    815   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_LOCATE_HANDLE_BUFFER) (
    816   1.1.1.3  christos     ACPI_EFI_LOCATE_SEARCH_TYPE     SearchType,
    817   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    818       1.1  christos     VOID                            *SearchKey,
    819       1.1  christos     UINTN                           *NoHandles,
    820   1.1.1.3  christos     ACPI_EFI_HANDLE                 **Buffer);
    821       1.1  christos 
    822       1.1  christos typedef
    823   1.1.1.3  christos ACPI_EFI_STATUS
    824   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_LOCATE_PROTOCOL) (
    825   1.1.1.3  christos     ACPI_EFI_GUID                   *Protocol,
    826       1.1  christos     VOID                            *Registration,
    827       1.1  christos     VOID                            **Interface);
    828       1.1  christos 
    829       1.1  christos typedef
    830   1.1.1.3  christos ACPI_EFI_STATUS
    831   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
    832   1.1.1.3  christos     ACPI_EFI_HANDLE                 *Handle,
    833       1.1  christos     ...);
    834       1.1  christos 
    835       1.1  christos typedef
    836   1.1.1.3  christos ACPI_EFI_STATUS
    837   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
    838   1.1.1.3  christos     ACPI_EFI_HANDLE                 Handle,
    839       1.1  christos     ...);
    840       1.1  christos 
    841       1.1  christos typedef
    842   1.1.1.3  christos ACPI_EFI_STATUS
    843   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_CALCULATE_CRC32) (
    844       1.1  christos     VOID                            *Data,
    845       1.1  christos     UINTN                           DataSize,
    846       1.1  christos     UINT32                          *Crc32);
    847       1.1  christos 
    848       1.1  christos typedef
    849       1.1  christos VOID
    850   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_COPY_MEM) (
    851       1.1  christos     VOID                            *Destination,
    852       1.1  christos     VOID                            *Source,
    853       1.1  christos     UINTN                           Length);
    854       1.1  christos 
    855       1.1  christos typedef
    856       1.1  christos VOID
    857   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_SET_MEM) (
    858       1.1  christos     VOID                            *Buffer,
    859       1.1  christos     UINTN                           Size,
    860       1.1  christos     UINT8                           Value);
    861       1.1  christos 
    862       1.1  christos /*
    863       1.1  christos  * EFI Boot Services Table
    864       1.1  christos  */
    865   1.1.1.3  christos #define ACPI_EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42
    866   1.1.1.3  christos #define ACPI_EFI_BOOT_SERVICES_REVISION  (ACPI_EFI_SPECIFICATION_MAJOR_REVISION<<16) | (ACPI_EFI_SPECIFICATION_MINOR_REVISION)
    867       1.1  christos 
    868   1.1.1.3  christos typedef struct _ACPI_EFI_BOOT_SERVICES {
    869   1.1.1.3  christos     ACPI_EFI_TABLE_HEADER               Hdr;
    870       1.1  christos 
    871       1.1  christos #if 0
    872   1.1.1.3  christos     ACPI_EFI_RAISE_TPL                  RaiseTPL;
    873   1.1.1.3  christos     ACPI_EFI_RESTORE_TPL                RestoreTPL;
    874       1.1  christos #else
    875   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          RaiseTPL;
    876   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          RestoreTPL;
    877       1.1  christos #endif
    878       1.1  christos 
    879   1.1.1.3  christos     ACPI_EFI_ALLOCATE_PAGES             AllocatePages;
    880   1.1.1.3  christos     ACPI_EFI_FREE_PAGES                 FreePages;
    881   1.1.1.3  christos     ACPI_EFI_GET_MEMORY_MAP             GetMemoryMap;
    882   1.1.1.3  christos     ACPI_EFI_ALLOCATE_POOL              AllocatePool;
    883   1.1.1.3  christos     ACPI_EFI_FREE_POOL                  FreePool;
    884       1.1  christos 
    885       1.1  christos #if 0
    886   1.1.1.3  christos     ACPI_EFI_CREATE_EVENT               CreateEvent;
    887   1.1.1.3  christos     ACPI_EFI_SET_TIMER                  SetTimer;
    888   1.1.1.3  christos     ACPI_EFI_WAIT_FOR_EVENT             WaitForEvent;
    889   1.1.1.3  christos     ACPI_EFI_SIGNAL_EVENT               SignalEvent;
    890   1.1.1.3  christos     ACPI_EFI_CLOSE_EVENT                CloseEvent;
    891   1.1.1.3  christos     ACPI_EFI_CHECK_EVENT                CheckEvent;
    892       1.1  christos #else
    893   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          CreateEvent;
    894   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          SetTimer;
    895   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          WaitForEvent;
    896   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          SignalEvent;
    897   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          CloseEvent;
    898   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          CheckEvent;
    899       1.1  christos #endif
    900       1.1  christos 
    901   1.1.1.3  christos     ACPI_EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;
    902   1.1.1.3  christos     ACPI_EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
    903   1.1.1.3  christos     ACPI_EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
    904   1.1.1.3  christos     ACPI_EFI_HANDLE_PROTOCOL            HandleProtocol;
    905   1.1.1.3  christos     ACPI_EFI_HANDLE_PROTOCOL            PCHandleProtocol;
    906   1.1.1.3  christos     ACPI_EFI_REGISTER_PROTOCOL_NOTIFY   RegisterProtocolNotify;
    907   1.1.1.3  christos     ACPI_EFI_LOCATE_HANDLE              LocateHandle;
    908   1.1.1.3  christos     ACPI_EFI_LOCATE_DEVICE_PATH         LocateDevicePath;
    909   1.1.1.3  christos     ACPI_EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
    910   1.1.1.3  christos 
    911   1.1.1.3  christos     ACPI_EFI_IMAGE_LOAD                 LoadImage;
    912   1.1.1.3  christos     ACPI_EFI_IMAGE_START                StartImage;
    913   1.1.1.3  christos     ACPI_EFI_EXIT                       Exit;
    914   1.1.1.3  christos     ACPI_EFI_IMAGE_UNLOAD               UnloadImage;
    915       1.1  christos 
    916       1.1  christos #if 0
    917   1.1.1.3  christos     ACPI_EFI_EXIT_BOOT_SERVICES         ExitBootServices;
    918   1.1.1.3  christos     ACPI_EFI_GET_NEXT_MONOTONIC_COUNT   GetNextMonotonicCount;
    919       1.1  christos #else
    920   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          ExitBootServices;
    921   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          GetNextMonotonicCount;
    922       1.1  christos #endif
    923   1.1.1.5  christos     ACPI_EFI_STALL                      Stall;
    924   1.1.1.4  christos     ACPI_EFI_SET_WATCHDOG_TIMER         SetWatchdogTimer;
    925       1.1  christos 
    926       1.1  christos #if 0
    927   1.1.1.3  christos     ACPI_EFI_CONNECT_CONTROLLER         ConnectController;
    928   1.1.1.3  christos     ACPI_EFI_DISCONNECT_CONTROLLER      DisconnectController;
    929       1.1  christos #else
    930   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          ConnectController;
    931   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          DisconnectController;
    932       1.1  christos #endif
    933       1.1  christos 
    934   1.1.1.3  christos     ACPI_EFI_OPEN_PROTOCOL              OpenProtocol;
    935   1.1.1.3  christos     ACPI_EFI_CLOSE_PROTOCOL             CloseProtocol;
    936   1.1.1.3  christos     ACPI_EFI_OPEN_PROTOCOL_INFORMATION  OpenProtocolInformation;
    937   1.1.1.3  christos     ACPI_EFI_PROTOCOLS_PER_HANDLE       ProtocolsPerHandle;
    938   1.1.1.3  christos     ACPI_EFI_LOCATE_HANDLE_BUFFER       LocateHandleBuffer;
    939   1.1.1.3  christos     ACPI_EFI_LOCATE_PROTOCOL            LocateProtocol;
    940   1.1.1.3  christos     ACPI_EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
    941   1.1.1.3  christos     ACPI_EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;
    942       1.1  christos 
    943   1.1.1.3  christos     ACPI_EFI_CALCULATE_CRC32        CalculateCrc32;
    944       1.1  christos 
    945   1.1.1.3  christos     ACPI_EFI_COPY_MEM               CopyMem;
    946   1.1.1.3  christos     ACPI_EFI_SET_MEM                SetMem;
    947       1.1  christos 
    948       1.1  christos #if 0
    949   1.1.1.3  christos     ACPI_EFI_CREATE_EVENT_EX        CreateEventEx;
    950       1.1  christos #else
    951   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE      CreateEventEx;
    952       1.1  christos #endif
    953   1.1.1.3  christos } ACPI_EFI_BOOT_SERVICES;
    954       1.1  christos 
    955       1.1  christos 
    956       1.1  christos /*
    957   1.1.1.5  christos  * EFI Runtime Services Table
    958   1.1.1.5  christos  */
    959   1.1.1.5  christos #define ACPI_EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552
    960   1.1.1.5  christos #define ACPI_EFI_RUNTIME_SERVICES_REVISION  (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
    961   1.1.1.5  christos 
    962   1.1.1.5  christos typedef struct _ACPI_EFI_RUNTIME_SERVICES {
    963   1.1.1.5  christos     ACPI_EFI_TABLE_HEADER               Hdr;
    964   1.1.1.5  christos 
    965   1.1.1.5  christos     ACPI_EFI_GET_TIME                   GetTime;
    966   1.1.1.5  christos     ACPI_EFI_SET_TIME                   SetTime;
    967   1.1.1.5  christos #if 0
    968   1.1.1.5  christos     ACPI_EFI_GET_WAKEUP_TIME            GetWakeupTime;
    969   1.1.1.5  christos     ACPI_EFI_SET_WAKEUP_TIME            SetWakeupTime;
    970   1.1.1.5  christos #else
    971   1.1.1.5  christos     ACPI_EFI_UNKNOWN_INTERFACE          GetWakeupTime;
    972   1.1.1.5  christos     ACPI_EFI_UNKNOWN_INTERFACE          SetWakeupTime;
    973   1.1.1.5  christos #endif
    974   1.1.1.5  christos 
    975   1.1.1.5  christos #if 0
    976   1.1.1.5  christos     ACPI_EFI_SET_VIRTUAL_ADDRESS_MAP    SetVirtualAddressMap;
    977   1.1.1.5  christos     ACPI_EFI_CONVERT_POINTER            ConvertPointer;
    978   1.1.1.5  christos #else
    979   1.1.1.5  christos     ACPI_EFI_UNKNOWN_INTERFACE          SetVirtualAddressMap;
    980   1.1.1.5  christos     ACPI_EFI_UNKNOWN_INTERFACE          ConvertPointer;
    981   1.1.1.5  christos #endif
    982   1.1.1.5  christos 
    983   1.1.1.5  christos #if 0
    984   1.1.1.5  christos     ACPI_EFI_GET_VARIABLE               GetVariable;
    985   1.1.1.5  christos     ACPI_EFI_GET_NEXT_VARIABLE_NAME     GetNextVariableName;
    986   1.1.1.5  christos     ACPI_EFI_SET_VARIABLE               SetVariable;
    987   1.1.1.5  christos #else
    988   1.1.1.5  christos     ACPI_EFI_UNKNOWN_INTERFACE          GetVariable;
    989   1.1.1.5  christos     ACPI_EFI_UNKNOWN_INTERFACE          GetNextVariableName;
    990   1.1.1.5  christos     ACPI_EFI_UNKNOWN_INTERFACE          SetVariable;
    991   1.1.1.5  christos #endif
    992   1.1.1.5  christos 
    993   1.1.1.5  christos #if 0
    994   1.1.1.5  christos     ACPI_EFI_GET_NEXT_HIGH_MONO_COUNT   GetNextHighMonotonicCount;
    995   1.1.1.5  christos     ACPI_EFI_RESET_SYSTEM               ResetSystem;
    996   1.1.1.5  christos #else
    997   1.1.1.5  christos     ACPI_EFI_UNKNOWN_INTERFACE          GetNextHighMonotonicCount;
    998   1.1.1.5  christos     ACPI_EFI_UNKNOWN_INTERFACE          ResetSystem;
    999   1.1.1.5  christos #endif
   1000   1.1.1.5  christos 
   1001   1.1.1.5  christos } ACPI_EFI_RUNTIME_SERVICES;
   1002   1.1.1.5  christos 
   1003   1.1.1.5  christos 
   1004   1.1.1.5  christos /*
   1005       1.1  christos  * EFI System Table
   1006       1.1  christos  */
   1007       1.1  christos 
   1008       1.1  christos /*
   1009       1.1  christos  * EFI Configuration Table and GUID definitions
   1010       1.1  christos  */
   1011   1.1.1.3  christos #define ACPI_TABLE_GUID \
   1012       1.1  christos     { 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
   1013   1.1.1.3  christos #define ACPI_20_TABLE_GUID \
   1014       1.1  christos     { 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} }
   1015       1.1  christos 
   1016   1.1.1.3  christos typedef struct _ACPI_EFI_CONFIGURATION_TABLE {
   1017   1.1.1.3  christos     ACPI_EFI_GUID           VendorGuid;
   1018       1.1  christos     VOID                    *VendorTable;
   1019   1.1.1.3  christos } ACPI_EFI_CONFIGURATION_TABLE;
   1020       1.1  christos 
   1021       1.1  christos 
   1022   1.1.1.3  christos #define ACPI_EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249
   1023   1.1.1.3  christos #define ACPI_EFI_SYSTEM_TABLE_REVISION  (ACPI_EFI_SPECIFICATION_MAJOR_REVISION<<16) | (ACPI_EFI_SPECIFICATION_MINOR_REVISION)
   1024       1.1  christos 
   1025   1.1.1.3  christos typedef struct _ACPI_EFI_SYSTEM_TABLE {
   1026   1.1.1.3  christos     ACPI_EFI_TABLE_HEADER               Hdr;
   1027       1.1  christos 
   1028   1.1.1.3  christos     CHAR16                              *FirmwareVendor;
   1029   1.1.1.3  christos     UINT32                              FirmwareRevision;
   1030       1.1  christos 
   1031   1.1.1.3  christos     ACPI_EFI_HANDLE                     ConsoleInHandle;
   1032   1.1.1.3  christos     ACPI_SIMPLE_INPUT_INTERFACE         *ConIn;
   1033       1.1  christos 
   1034   1.1.1.3  christos     ACPI_EFI_HANDLE                     ConsoleOutHandle;
   1035   1.1.1.3  christos     ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *ConOut;
   1036       1.1  christos 
   1037   1.1.1.3  christos     ACPI_EFI_HANDLE                     StandardErrorHandle;
   1038   1.1.1.3  christos     ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *StdErr;
   1039       1.1  christos 
   1040   1.1.1.3  christos     ACPI_EFI_RUNTIME_SERVICES           *RuntimeServices;
   1041   1.1.1.3  christos     ACPI_EFI_BOOT_SERVICES              *BootServices;
   1042   1.1.1.3  christos 
   1043   1.1.1.3  christos     UINTN                               NumberOfTableEntries;
   1044   1.1.1.3  christos     ACPI_EFI_CONFIGURATION_TABLE        *ConfigurationTable;
   1045       1.1  christos 
   1046   1.1.1.3  christos } ACPI_EFI_SYSTEM_TABLE;
   1047       1.1  christos 
   1048       1.1  christos 
   1049   1.1.1.3  christos /*
   1050   1.1.1.3  christos  * EFI PCI I/O Protocol
   1051   1.1.1.3  christos  */
   1052   1.1.1.3  christos #define ACPI_EFI_PCI_IO_PROTOCOL \
   1053   1.1.1.3  christos     { 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a} }
   1054   1.1.1.3  christos 
   1055   1.1.1.3  christos typedef enum {
   1056   1.1.1.3  christos     AcpiEfiPciIoWidthUint8 = 0,
   1057   1.1.1.3  christos     AcpiEfiPciIoWidthUint16,
   1058   1.1.1.3  christos     AcpiEfiPciIoWidthUint32,
   1059   1.1.1.3  christos     AcpiEfiPciIoWidthUint64,
   1060   1.1.1.3  christos     AcpiEfiPciIoWidthFifoUint8,
   1061   1.1.1.3  christos     AcpiEfiPciIoWidthFifoUint16,
   1062   1.1.1.3  christos     AcpiEfiPciIoWidthFifoUint32,
   1063   1.1.1.3  christos     AcpiEfiPciIoWidthFifoUint64,
   1064   1.1.1.3  christos     AcpiEfiPciIoWidthFillUint8,
   1065   1.1.1.3  christos     AcpiEfiPciIoWidthFillUint16,
   1066   1.1.1.3  christos     AcpiEfiPciIoWidthFillUint32,
   1067   1.1.1.3  christos     AcpiEfiPciIoWidthFillUint64,
   1068   1.1.1.3  christos     AcpiEfiPciIoWidthMaximum
   1069   1.1.1.3  christos } ACPI_EFI_PCI_IO_PROTOCOL_WIDTH;
   1070   1.1.1.3  christos 
   1071   1.1.1.3  christos typedef
   1072   1.1.1.3  christos ACPI_EFI_STATUS
   1073   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_PCI_IO_PROTOCOL_CONFIG)(
   1074   1.1.1.3  christos     struct _ACPI_EFI_PCI_IO             *This,
   1075   1.1.1.3  christos     ACPI_EFI_PCI_IO_PROTOCOL_WIDTH      Width,
   1076   1.1.1.3  christos     UINT32                              Offset,
   1077   1.1.1.3  christos     UINTN                               Count,
   1078   1.1.1.3  christos     VOID                                *Buffer);
   1079   1.1.1.3  christos 
   1080   1.1.1.3  christos typedef struct {
   1081   1.1.1.3  christos     ACPI_EFI_PCI_IO_PROTOCOL_CONFIG     Read;
   1082   1.1.1.3  christos     ACPI_EFI_PCI_IO_PROTOCOL_CONFIG     Write;
   1083   1.1.1.3  christos } ACPI_EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;
   1084   1.1.1.3  christos 
   1085   1.1.1.3  christos typedef
   1086   1.1.1.3  christos ACPI_EFI_STATUS
   1087   1.1.1.3  christos (ACPI_EFI_API *ACPI_EFI_PCI_IO_PROTOCOL_GET_LOCATION)(
   1088   1.1.1.3  christos     struct _ACPI_EFI_PCI_IO             *This,
   1089   1.1.1.3  christos     UINTN                               *SegmentNumber,
   1090   1.1.1.3  christos     UINTN                               *BusNumber,
   1091   1.1.1.3  christos     UINTN                               *DeviceNumber,
   1092   1.1.1.3  christos     UINTN                               *FunctionNumber);
   1093   1.1.1.3  christos 
   1094   1.1.1.3  christos typedef struct _ACPI_EFI_PCI_IO {
   1095   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          PollMem;
   1096   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          PollIo;
   1097   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          Mem;
   1098   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          Io;
   1099   1.1.1.3  christos     ACPI_EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci;
   1100   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          CopyMem;
   1101   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          Map;
   1102   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          Unmap;
   1103   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          AllocateBuffer;
   1104   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          FreeBuffer;
   1105   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          Flush;
   1106   1.1.1.3  christos     ACPI_EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation;
   1107   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          Attributes;
   1108   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          GetBarAttributes;
   1109   1.1.1.3  christos     ACPI_EFI_UNKNOWN_INTERFACE          SetBarAttributes;
   1110   1.1.1.3  christos     UINT64                              RomSize;
   1111   1.1.1.3  christos     VOID                                *RomImage;
   1112   1.1.1.3  christos } ACPI_EFI_PCI_IO;
   1113       1.1  christos 
   1114   1.1.1.4  christos /* FILE abstraction */
   1115   1.1.1.4  christos 
   1116   1.1.1.4  christos union acpi_efi_file {
   1117   1.1.1.4  christos     struct _ACPI_EFI_FILE_HANDLE File;
   1118   1.1.1.4  christos     struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE ConOut;
   1119   1.1.1.4  christos     struct _ACPI_SIMPLE_INPUT_INTERFACE ConIn;
   1120   1.1.1.4  christos };
   1121   1.1.1.4  christos 
   1122   1.1.1.4  christos 
   1123   1.1.1.5  christos /* EFI definitions */
   1124       1.1  christos 
   1125   1.1.1.5  christos #if defined(_GNU_EFI) || defined(_EDK2_EFI)
   1126       1.1  christos 
   1127       1.1  christos /*
   1128       1.1  christos  * This is needed to hide platform specific code from ACPICA
   1129       1.1  christos  */
   1130   1.1.1.5  christos UINT64 ACPI_EFI_API
   1131       1.1  christos DivU64x32 (
   1132       1.1  christos     UINT64                  Dividend,
   1133       1.1  christos     UINTN                   Divisor,
   1134       1.1  christos     UINTN                   *Remainder);
   1135       1.1  christos 
   1136   1.1.1.5  christos UINT64 ACPI_EFI_API
   1137   1.1.1.5  christos MultU64x32 (
   1138   1.1.1.5  christos     UINT64                  Multiplicand,
   1139   1.1.1.5  christos     UINTN                   Multiplier);
   1140   1.1.1.5  christos 
   1141   1.1.1.5  christos UINT64 ACPI_EFI_API
   1142   1.1.1.5  christos LShiftU64 (
   1143   1.1.1.5  christos     UINT64                  Operand,
   1144   1.1.1.5  christos     UINTN                   Count);
   1145   1.1.1.5  christos 
   1146   1.1.1.5  christos UINT64 ACPI_EFI_API
   1147   1.1.1.5  christos RShiftU64 (
   1148   1.1.1.5  christos     UINT64                  Operand,
   1149   1.1.1.5  christos     UINTN                   Count);
   1150   1.1.1.5  christos 
   1151       1.1  christos /*
   1152       1.1  christos  * EFI specific prototypes
   1153       1.1  christos  */
   1154   1.1.1.3  christos ACPI_EFI_STATUS
   1155       1.1  christos efi_main (
   1156   1.1.1.3  christos     ACPI_EFI_HANDLE         Image,
   1157   1.1.1.3  christos     ACPI_EFI_SYSTEM_TABLE   *SystemTab);
   1158       1.1  christos 
   1159       1.1  christos int
   1160       1.1  christos acpi_main (
   1161       1.1  christos     int                     argc,
   1162       1.1  christos     char                    *argv[]);
   1163       1.1  christos 
   1164       1.1  christos #endif
   1165       1.1  christos 
   1166   1.1.1.3  christos extern ACPI_EFI_GUID AcpiGbl_LoadedImageProtocol;
   1167   1.1.1.3  christos extern ACPI_EFI_GUID AcpiGbl_TextInProtocol;
   1168   1.1.1.3  christos extern ACPI_EFI_GUID AcpiGbl_TextOutProtocol;
   1169   1.1.1.3  christos extern ACPI_EFI_GUID AcpiGbl_FileSystemProtocol;
   1170   1.1.1.4  christos extern ACPI_EFI_GUID AcpiGbl_GenericFileInfo;
   1171       1.1  christos 
   1172       1.1  christos #endif /* __ACEFIEX_H__ */
   1173