17b1019aJerry Jelinek/******************************************************************************
27b1019aJerry Jelinek *
37b1019aJerry Jelinek * Name: acefiex.h - Extra OS specific defines, etc. for EFI
47b1019aJerry Jelinek *
57b1019aJerry Jelinek *****************************************************************************/
67b1019aJerry Jelinek
735786f6Robert Mustacchi/******************************************************************************
835786f6Robert Mustacchi *
935786f6Robert Mustacchi * 1. Copyright Notice
1035786f6Robert Mustacchi *
1135786f6Robert Mustacchi * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
127b1019aJerry Jelinek * All rights reserved.
137b1019aJerry Jelinek *
1435786f6Robert Mustacchi * 2. License
1535786f6Robert Mustacchi *
1635786f6Robert Mustacchi * 2.1. This is your license from Intel Corp. under its intellectual property
1735786f6Robert Mustacchi * rights. You may have additional license terms from the party that provided
1835786f6Robert Mustacchi * you this software, covering your right to use that party's intellectual
1935786f6Robert Mustacchi * property rights.
2035786f6Robert Mustacchi *
2135786f6Robert Mustacchi * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
2235786f6Robert Mustacchi * copy of the source code appearing in this file ("Covered Code") an
2335786f6Robert Mustacchi * irrevocable, perpetual, worldwide license under Intel's copyrights in the
2435786f6Robert Mustacchi * base code distributed originally by Intel ("Original Intel Code") to copy,
2535786f6Robert Mustacchi * make derivatives, distribute, use and display any portion of the Covered
2635786f6Robert Mustacchi * Code in any form, with the right to sublicense such rights; and
2735786f6Robert Mustacchi *
2835786f6Robert Mustacchi * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
2935786f6Robert Mustacchi * license (with the right to sublicense), under only those claims of Intel
3035786f6Robert Mustacchi * patents that are infringed by the Original Intel Code, to make, use, sell,
3135786f6Robert Mustacchi * offer to sell, and import the Covered Code and derivative works thereof
3235786f6Robert Mustacchi * solely to the minimum extent necessary to exercise the above copyright
3335786f6Robert Mustacchi * license, and in no event shall the patent license extend to any additions
3435786f6Robert Mustacchi * to or modifications of the Original Intel Code. No other license or right
3535786f6Robert Mustacchi * is granted directly or by implication, estoppel or otherwise;
3635786f6Robert Mustacchi *
3735786f6Robert Mustacchi * The above copyright and patent license is granted only if the following
3835786f6Robert Mustacchi * conditions are met:
3935786f6Robert Mustacchi *
4035786f6Robert Mustacchi * 3. Conditions
4135786f6Robert Mustacchi *
4235786f6Robert Mustacchi * 3.1. Redistribution of Source with Rights to Further Distribute Source.
4335786f6Robert Mustacchi * Redistribution of source code of any substantial portion of the Covered
4435786f6Robert Mustacchi * Code or modification with rights to further distribute source must include
4535786f6Robert Mustacchi * the above Copyright Notice, the above License, this list of Conditions,
4635786f6Robert Mustacchi * and the following Disclaimer and Export Compliance provision. In addition,
4735786f6Robert Mustacchi * Licensee must cause all Covered Code to which Licensee contributes to
4835786f6Robert Mustacchi * contain a file documenting the changes Licensee made to create that Covered
4935786f6Robert Mustacchi * Code and the date of any change. Licensee must include in that file the
5035786f6Robert Mustacchi * documentation of any changes made by any predecessor Licensee. Licensee
5135786f6Robert Mustacchi * must include a prominent statement that the modification is derived,
5235786f6Robert Mustacchi * directly or indirectly, from Original Intel Code.
5335786f6Robert Mustacchi *
5435786f6Robert Mustacchi * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
5535786f6Robert Mustacchi * Redistribution of source code of any substantial portion of the Covered
5635786f6Robert Mustacchi * Code or modification without rights to further distribute source must
5735786f6Robert Mustacchi * include the following Disclaimer and Export Compliance provision in the
5835786f6Robert Mustacchi * documentation and/or other materials provided with distribution. In
5935786f6Robert Mustacchi * addition, Licensee may not authorize further sublicense of source of any
6035786f6Robert Mustacchi * portion of the Covered Code, and must include terms to the effect that the
6135786f6Robert Mustacchi * license from Licensee to its licensee is limited to the intellectual
6235786f6Robert Mustacchi * property embodied in the software Licensee provides to its licensee, and
6335786f6Robert Mustacchi * not to intellectual property embodied in modifications its licensee may
6435786f6Robert Mustacchi * make.
6535786f6Robert Mustacchi *
6635786f6Robert Mustacchi * 3.3. Redistribution of Executable. Redistribution in executable form of any
6735786f6Robert Mustacchi * substantial portion of the Covered Code or modification must reproduce the
6835786f6Robert Mustacchi * above Copyright Notice, and the following Disclaimer and Export Compliance
6935786f6Robert Mustacchi * provision in the documentation and/or other materials provided with the
7035786f6Robert Mustacchi * distribution.
7135786f6Robert Mustacchi *
7235786f6Robert Mustacchi * 3.4. Intel retains all right, title, and interest in and to the Original
7335786f6Robert Mustacchi * Intel Code.
7435786f6Robert Mustacchi *
7535786f6Robert Mustacchi * 3.5. Neither the name Intel nor any other trademark owned or controlled by
7635786f6Robert Mustacchi * Intel shall be used in advertising or otherwise to promote the sale, use or
7735786f6Robert Mustacchi * other dealings in products derived from or relating to the Covered Code
7835786f6Robert Mustacchi * without prior written authorization from Intel.
7935786f6Robert Mustacchi *
8035786f6Robert Mustacchi * 4. Disclaimer and Export Compliance
8135786f6Robert Mustacchi *
8235786f6Robert Mustacchi * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
8335786f6Robert Mustacchi * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
8435786f6Robert Mustacchi * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
8535786f6Robert Mustacchi * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
8635786f6Robert Mustacchi * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
8735786f6Robert Mustacchi * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
8835786f6Robert Mustacchi * PARTICULAR PURPOSE.
8935786f6Robert Mustacchi *
9035786f6Robert Mustacchi * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
9135786f6Robert Mustacchi * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
9235786f6Robert Mustacchi * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
9335786f6Robert Mustacchi * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
9435786f6Robert Mustacchi * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
9535786f6Robert Mustacchi * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
9635786f6Robert Mustacchi * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
9735786f6Robert Mustacchi * LIMITED REMEDY.
9835786f6Robert Mustacchi *
9935786f6Robert Mustacchi * 4.3. Licensee shall not export, either directly or indirectly, any of this
10035786f6Robert Mustacchi * software or system incorporating such software without first obtaining any
10135786f6Robert Mustacchi * required license or other approval from the U. S. Department of Commerce or
10235786f6Robert Mustacchi * any other agency or department of the United States Government. In the
10335786f6Robert Mustacchi * event Licensee exports any such software from the United States or
10435786f6Robert Mustacchi * re-exports any such software from a foreign destination, Licensee shall
10535786f6Robert Mustacchi * ensure that the distribution and export/re-export of the software is in
10635786f6Robert Mustacchi * compliance with all laws, regulations, orders, or other restrictions of the
10735786f6Robert Mustacchi * U.S. Export Administration Regulations. Licensee agrees that neither it nor
10835786f6Robert Mustacchi * any of its subsidiaries will export/re-export any technical data, process,
10935786f6Robert Mustacchi * software, or service, directly or indirectly, to any country for which the
11035786f6Robert Mustacchi * United States government or any agency thereof requires an export license,
11135786f6Robert Mustacchi * other governmental approval, or letter of assurance, without first obtaining
11235786f6Robert Mustacchi * such license, approval or letter.
11335786f6Robert Mustacchi *
11435786f6Robert Mustacchi *****************************************************************************
11535786f6Robert Mustacchi *
11635786f6Robert Mustacchi * Alternatively, you may choose to be licensed under the terms of the
11735786f6Robert Mustacchi * following license:
11835786f6Robert Mustacchi *
1197b1019aJerry Jelinek * Redistribution and use in source and binary forms, with or without
1207b1019aJerry Jelinek * modification, are permitted provided that the following conditions
1217b1019aJerry Jelinek * are met:
1227b1019aJerry Jelinek * 1. Redistributions of source code must retain the above copyright
1237b1019aJerry Jelinek *    notice, this list of conditions, and the following disclaimer,
1247b1019aJerry Jelinek *    without modification.
1257b1019aJerry Jelinek * 2. Redistributions in binary form must reproduce at minimum a disclaimer
1267b1019aJerry Jelinek *    substantially similar to the "NO WARRANTY" disclaimer below
1277b1019aJerry Jelinek *    ("Disclaimer") and any redistribution must be conditioned upon
1287b1019aJerry Jelinek *    including a substantially similar Disclaimer requirement for further
1297b1019aJerry Jelinek *    binary redistribution.
1307b1019aJerry Jelinek * 3. Neither the names of the above-listed copyright holders nor the names
1317b1019aJerry Jelinek *    of any contributors may be used to endorse or promote products derived
1327b1019aJerry Jelinek *    from this software without specific prior written permission.
1337b1019aJerry Jelinek *
1347b1019aJerry Jelinek * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1357b1019aJerry Jelinek * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
13635786f6Robert Mustacchi * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1377b1019aJerry Jelinek * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
13835786f6Robert Mustacchi * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
13935786f6Robert Mustacchi * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
14035786f6Robert Mustacchi * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
14135786f6Robert Mustacchi * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
14235786f6Robert Mustacchi * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14335786f6Robert Mustacchi * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14435786f6Robert Mustacchi * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14535786f6Robert Mustacchi *
14635786f6Robert Mustacchi * Alternatively, you may choose to be licensed under the terms of the
14735786f6Robert Mustacchi * GNU General Public License ("GPL") version 2 as published by the Free
14835786f6Robert Mustacchi * Software Foundation.
14935786f6Robert Mustacchi *
15035786f6Robert Mustacchi *****************************************************************************/
1517b1019aJerry Jelinek
1527b1019aJerry Jelinek#ifndef __ACEFIEX_H__
1537b1019aJerry Jelinek#define __ACEFIEX_H__
1547b1019aJerry Jelinek
1557b1019aJerry Jelinek
15635786f6Robert Mustacchi#ifndef ACPI_USE_SYSTEM_CLIBRARY
15735786f6Robert Mustacchi
15835786f6Robert Mustacchitypedef signed char                     int8_t;
15935786f6Robert Mustacchitypedef short int                       int16_t;
16035786f6Robert Mustacchitypedef int                             int32_t;
16135786f6Robert Mustacchitypedef unsigned char                   uint8_t;
16235786f6Robert Mustacchitypedef unsigned short int              uint16_t;
16335786f6Robert Mustacchitypedef unsigned int                    uint32_t;
16435786f6Robert Mustacchitypedef COMPILER_DEPENDENT_INT64        int64_t;
16535786f6Robert Mustacchitypedef COMPILER_DEPENDENT_UINT64       uint64_t;
16635786f6Robert Mustacchi
16735786f6Robert Mustacchi#endif /* ACPI_USE_SYSTEM_CLIBRARY */
16835786f6Robert Mustacchi
16935786f6Robert Mustacchi#define ACPI_EFI_ERROR(a)               (((INTN) a) < 0)
17035786f6Robert Mustacchi#define ACPI_EFI_SUCCESS                0
17135786f6Robert Mustacchi#define ACPI_EFI_LOAD_ERROR             ACPI_EFI_ERR(1)
17235786f6Robert Mustacchi#define ACPI_EFI_INVALID_PARAMETER      ACPI_EFI_ERR(2)
17335786f6Robert Mustacchi#define ACPI_EFI_UNSUPPORTED            ACPI_EFI_ERR(3)
17435786f6Robert Mustacchi#define ACPI_EFI_BAD_BUFFER_SIZE        ACPI_EFI_ERR(4)
17535786f6Robert Mustacchi#define ACPI_EFI_BUFFER_TOO_SMALL       ACPI_EFI_ERR(5)
17635786f6Robert Mustacchi#define ACPI_EFI_NOT_READY              ACPI_EFI_ERR(6)
17735786f6Robert Mustacchi#define ACPI_EFI_DEVICE_ERROR           ACPI_EFI_ERR(7)
17835786f6Robert Mustacchi#define ACPI_EFI_WRITE_PROTECTED        ACPI_EFI_ERR(8)
17935786f6Robert Mustacchi#define ACPI_EFI_OUT_OF_RESOURCES       ACPI_EFI_ERR(9)
18035786f6Robert Mustacchi#define ACPI_EFI_VOLUME_CORRUPTED       ACPI_EFI_ERR(10)
18135786f6Robert Mustacchi#define ACPI_EFI_VOLUME_FULL            ACPI_EFI_ERR(11)
18235786f6Robert Mustacchi#define ACPI_EFI_NO_MEDIA               ACPI_EFI_ERR(12)
18335786f6Robert Mustacchi#define ACPI_EFI_MEDIA_CHANGED          ACPI_EFI_ERR(13)
18435786f6Robert Mustacchi#define ACPI_EFI_NOT_FOUND              ACPI_EFI_ERR(14)
18535786f6Robert Mustacchi#define ACPI_EFI_ACCESS_DENIED          ACPI_EFI_ERR(15)
18635786f6Robert Mustacchi#define ACPI_EFI_NO_RESPONSE            ACPI_EFI_ERR(16)
18735786f6Robert Mustacchi#define ACPI_EFI_NO_MAPPING             ACPI_EFI_ERR(17)
18835786f6Robert Mustacchi#define ACPI_EFI_TIMEOUT                ACPI_EFI_ERR(18)
18935786f6Robert Mustacchi#define ACPI_EFI_NOT_STARTED            ACPI_EFI_ERR(19)
19035786f6Robert Mustacchi#define ACPI_EFI_ALREADY_STARTED        ACPI_EFI_ERR(20)
19135786f6Robert Mustacchi#define ACPI_EFI_ABORTED                ACPI_EFI_ERR(21)
19235786f6Robert Mustacchi#define ACPI_EFI_PROTOCOL_ERROR         ACPI_EFI_ERR(24)
19335786f6Robert Mustacchi
19435786f6Robert Mustacchi
19535786f6Robert Mustacchitypedef UINTN ACPI_EFI_STATUS;
19635786f6Robert Mustacchitypedef VOID *ACPI_EFI_HANDLE;
19735786f6Robert Mustacchitypedef VOID *ACPI_EFI_EVENT;
1987b1019aJerry Jelinek
1997b1019aJerry Jelinektypedef struct {
2007b1019aJerry Jelinek    UINT32  Data1;
2017b1019aJerry Jelinek    UINT16  Data2;
2027b1019aJerry Jelinek    UINT16  Data3;
2037b1019aJerry Jelinek    UINT8   Data4[8];
20435786f6Robert Mustacchi} ACPI_EFI_GUID;
2057b1019aJerry Jelinek
20635786f6Robert Mustacchitypedef struct {
20735786f6Robert Mustacchi    UINT16 Year;       /* 1998 - 20XX */
20835786f6Robert Mustacchi    UINT8  Month;      /* 1 - 12 */
20935786f6Robert Mustacchi    UINT8  Day;        /* 1 - 31 */
21035786f6Robert Mustacchi    UINT8  Hour;       /* 0 - 23 */
21135786f6Robert Mustacchi    UINT8  Minute;     /* 0 - 59 */
21235786f6Robert Mustacchi    UINT8  Second;     /* 0 - 59 */
21335786f6Robert Mustacchi    UINT8  Pad1;
21435786f6Robert Mustacchi    UINT32 Nanosecond; /* 0 - 999,999,999 */
21535786f6Robert Mustacchi    INT16  TimeZone;   /* -1440 to 1440 or 2047 */
21635786f6Robert Mustacchi    UINT8  Daylight;
21735786f6Robert Mustacchi    UINT8  Pad2;
21835786f6Robert Mustacchi} ACPI_EFI_TIME;
21935786f6Robert Mustacchi
22035786f6Robert Mustacchitypedef struct _ACPI_EFI_DEVICE_PATH {
2217b1019aJerry Jelinek        UINT8                           Type;
2227b1019aJerry Jelinek        UINT8                           SubType;
2237b1019aJerry Jelinek        UINT8                           Length[2];
22435786f6Robert Mustacchi} ACPI_EFI_DEVICE_PATH;
2257b1019aJerry Jelinek
22635786f6Robert Mustacchitypedef UINT64          ACPI_EFI_PHYSICAL_ADDRESS;
22735786f6Robert Mustacchitypedef UINT64          ACPI_EFI_VIRTUAL_ADDRESS;
2287b1019aJerry Jelinek
2297b1019aJerry Jelinektypedef enum {
23035786f6Robert Mustacchi    AcpiEfiAllocateAnyPages,
23135786f6Robert Mustacchi    AcpiEfiAllocateMaxAddress,
23235786f6Robert Mustacchi    AcpiEfiAllocateAddress,
23335786f6Robert Mustacchi    AcpiEfiMaxAllocateType
23435786f6Robert Mustacchi} ACPI_EFI_ALLOCATE_TYPE;
2357b1019aJerry Jelinek
2367b1019aJerry Jelinektypedef enum {
23735786f6Robert Mustacchi    AcpiEfiReservedMemoryType,
23835786f6Robert Mustacchi    AcpiEfiLoaderCode,
23935786f6Robert Mustacchi    AcpiEfiLoaderData,
24035786f6Robert Mustacchi    AcpiEfiBootServicesCode,
24135786f6Robert Mustacchi    AcpiEfiBootServicesData,
24235786f6Robert Mustacchi    AcpiEfiRuntimeServicesCode,
24335786f6Robert Mustacchi    AcpiEfiRuntimeServicesData,
24435786f6Robert Mustacchi    AcpiEfiConventionalMemory,
24535786f6Robert Mustacchi    AcpiEfiUnusableMemory,
24635786f6Robert Mustacchi    AcpiEfiACPIReclaimMemory,
24735786f6Robert Mustacchi    AcpiEfiACPIMemoryNVS,
24835786f6Robert Mustacchi    AcpiEfiMemoryMappedIO,
24935786f6Robert Mustacchi    AcpiEfiMemoryMappedIOPortSpace,
25035786f6Robert Mustacchi    AcpiEfiPalCode,
25135786f6Robert Mustacchi    AcpiEfiMaxMemoryType
25235786f6Robert Mustacchi} ACPI_EFI_MEMORY_TYPE;
2537b1019aJerry Jelinek
2547b1019aJerry Jelinek/* possible caching types for the memory range */
25535786f6Robert Mustacchi#define ACPI_EFI_MEMORY_UC      0x0000000000000001
25635786f6Robert Mustacchi#define ACPI_EFI_MEMORY_WC      0x0000000000000002
25735786f6Robert Mustacchi#define ACPI_EFI_MEMORY_WT      0x0000000000000004
25835786f6Robert Mustacchi#define ACPI_EFI_MEMORY_WB      0x0000000000000008
25935786f6Robert Mustacchi#define ACPI_EFI_MEMORY_UCE     0x0000000000000010
2607b1019aJerry Jelinek
2617b1019aJerry Jelinek/* physical memory protection on range */
26235786f6Robert Mustacchi#define ACPI_EFI_MEMORY_WP      0x0000000000001000
26335786f6Robert Mustacchi#define ACPI_EFI_MEMORY_RP      0x0000000000002000
26435786f6Robert Mustacchi#define ACPI_EFI_MEMORY_XP      0x0000000000004000
2657b1019aJerry Jelinek
2667b1019aJerry Jelinek/* range requires a runtime mapping */
26735786f6Robert Mustacchi#define ACPI_EFI_MEMORY_RUNTIME 0x8000000000000000
2687b1019aJerry Jelinek
26935786f6Robert Mustacchi#define ACPI_EFI_MEMORY_DESCRIPTOR_VERSION  1
2707b1019aJerry Jelinektypedef struct {
2717b1019aJerry Jelinek    UINT32                          Type;
2727b1019aJerry Jelinek    UINT32                          Pad;
27335786f6Robert Mustacchi    ACPI_EFI_PHYSICAL_ADDRESS       PhysicalStart;
27435786f6Robert Mustacchi    ACPI_EFI_VIRTUAL_ADDRESS        VirtualStart;
2757b1019aJerry Jelinek    UINT64                          NumberOfPages;
2767b1019aJerry Jelinek    UINT64                          Attribute;
27735786f6Robert Mustacchi} ACPI_EFI_MEMORY_DESCRIPTOR;
2787b1019aJerry Jelinek
27935786f6Robert Mustacchitypedef struct _ACPI_EFI_TABLE_HEARDER {
2807b1019aJerry Jelinek    UINT64                      Signature;
2817b1019aJerry Jelinek    UINT32                      Revision;
2827b1019aJerry Jelinek    UINT32                      HeaderSize;
2837b1019aJerry Jelinek    UINT32                      CRC32;
2847b1019aJerry Jelinek    UINT32                      Reserved;
28535786f6Robert Mustacchi} ACPI_EFI_TABLE_HEADER;
2867b1019aJerry Jelinek
2877b1019aJerry Jelinektypedef
28835786f6Robert MustacchiACPI_EFI_STATUS
28935786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_UNKNOWN_INTERFACE) (
2907b1019aJerry Jelinek    void);
2917b1019aJerry Jelinek
2927b1019aJerry Jelinek
2937b1019aJerry Jelinek/*
2947b1019aJerry Jelinek * Text output protocol
2957b1019aJerry Jelinek */
29635786f6Robert Mustacchi#define ACPI_SIMPLE_TEXT_OUTPUT_PROTOCOL \
2977b1019aJerry Jelinek    { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
2987b1019aJerry Jelinek
2997b1019aJerry Jelinektypedef
30035786f6Robert MustacchiACPI_EFI_STATUS
30135786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_TEXT_RESET) (
30235786f6Robert Mustacchi    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
30335786f6Robert Mustacchi    BOOLEAN                                     ExtendedVerification);
3047b1019aJerry Jelinek
3057b1019aJerry Jelinektypedef
30635786f6Robert MustacchiACPI_EFI_STATUS
30735786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_TEXT_OUTPUT_STRING) (
30835786f6Robert Mustacchi    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
30935786f6Robert Mustacchi    CHAR16                                      *String);
3107b1019aJerry Jelinek
3117b1019aJerry Jelinektypedef
31235786f6Robert MustacchiACPI_EFI_STATUS
31335786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_TEXT_TEST_STRING) (
31435786f6Robert Mustacchi    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
31535786f6Robert Mustacchi    CHAR16                                      *String);
3167b1019aJerry Jelinek
3177b1019aJerry Jelinektypedef
31835786f6Robert MustacchiACPI_EFI_STATUS
31935786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_TEXT_QUERY_MODE) (
32035786f6Robert Mustacchi    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
32135786f6Robert Mustacchi    UINTN                                       ModeNumber,
32235786f6Robert Mustacchi    UINTN                                       *Columns,
32335786f6Robert Mustacchi    UINTN                                       *Rows);
3247b1019aJerry Jelinek
3257b1019aJerry Jelinektypedef
32635786f6Robert MustacchiACPI_EFI_STATUS
32735786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_TEXT_SET_MODE) (
32835786f6Robert Mustacchi    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
32935786f6Robert Mustacchi    UINTN                                       ModeNumber);
3307b1019aJerry Jelinek
3317b1019aJerry Jelinektypedef
33235786f6Robert MustacchiACPI_EFI_STATUS
33335786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_TEXT_SET_ATTRIBUTE) (
33435786f6Robert Mustacchi    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
33535786f6Robert Mustacchi    UINTN                                       Attribute);
3367b1019aJerry Jelinek
3377b1019aJerry Jelinektypedef
33835786f6Robert MustacchiACPI_EFI_STATUS
33935786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_TEXT_CLEAR_SCREEN) (
34035786f6Robert Mustacchi    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This);
3417b1019aJerry Jelinek
3427b1019aJerry Jelinektypedef
34335786f6Robert MustacchiACPI_EFI_STATUS
34435786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_TEXT_SET_CURSOR_POSITION) (
34535786f6Robert Mustacchi    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
34635786f6Robert Mustacchi    UINTN                                       Column,
34735786f6Robert Mustacchi    UINTN                                       Row);
3487b1019aJerry Jelinek
3497b1019aJerry Jelinektypedef
35035786f6Robert MustacchiACPI_EFI_STATUS
35135786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_TEXT_ENABLE_CURSOR) (
35235786f6Robert Mustacchi    struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE   *This,
35335786f6Robert Mustacchi    BOOLEAN                                     Enable);
3547b1019aJerry Jelinek
3557b1019aJerry Jelinektypedef struct {
3567b1019aJerry Jelinek    INT32                           MaxMode;
3577b1019aJerry Jelinek    INT32                           Mode;
3587b1019aJerry Jelinek    INT32                           Attribute;
3597b1019aJerry Jelinek    INT32                           CursorColumn;
3607b1019aJerry Jelinek    INT32                           CursorRow;
3617b1019aJerry Jelinek    BOOLEAN                         CursorVisible;
36235786f6Robert Mustacchi} ACPI_SIMPLE_TEXT_OUTPUT_MODE;
3637b1019aJerry Jelinek
36435786f6Robert Mustacchitypedef struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE {
36535786f6Robert Mustacchi    ACPI_EFI_TEXT_RESET                 Reset;
3667b1019aJerry Jelinek
36735786f6Robert Mustacchi    ACPI_EFI_TEXT_OUTPUT_STRING         OutputString;
36835786f6Robert Mustacchi    ACPI_EFI_TEXT_TEST_STRING           TestString;
3697b1019aJerry Jelinek
37035786f6Robert Mustacchi    ACPI_EFI_TEXT_QUERY_MODE            QueryMode;
37135786f6Robert Mustacchi    ACPI_EFI_TEXT_SET_MODE              SetMode;
37235786f6Robert Mustacchi    ACPI_EFI_TEXT_SET_ATTRIBUTE         SetAttribute;
3737b1019aJerry Jelinek
37435786f6Robert Mustacchi    ACPI_EFI_TEXT_CLEAR_SCREEN          ClearScreen;
37535786f6Robert Mustacchi    ACPI_EFI_TEXT_SET_CURSOR_POSITION   SetCursorPosition;
37635786f6Robert Mustacchi    ACPI_EFI_TEXT_ENABLE_CURSOR         EnableCursor;
3777b1019aJerry Jelinek
37835786f6Robert Mustacchi    ACPI_SIMPLE_TEXT_OUTPUT_MODE        *Mode;
37935786f6Robert Mustacchi} ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE;
3807b1019aJerry Jelinek
3817b1019aJerry Jelinek/*
3827b1019aJerry Jelinek * Text input protocol
3837b1019aJerry Jelinek */
38435786f6Robert Mustacchi#define ACPI_SIMPLE_TEXT_INPUT_PROTOCOL  \
3857b1019aJerry Jelinek    { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
3867b1019aJerry Jelinek
3877b1019aJerry Jelinektypedef struct {
3887b1019aJerry Jelinek    UINT16                              ScanCode;
3897b1019aJerry Jelinek    CHAR16                              UnicodeChar;
39035786f6Robert Mustacchi} ACPI_EFI_INPUT_KEY;
3917b1019aJerry Jelinek
3927b1019aJerry Jelinek/*
3937b1019aJerry Jelinek * Baseline unicode control chars
3947b1019aJerry Jelinek */
3957b1019aJerry Jelinek#define CHAR_NULL                       0x0000
3967b1019aJerry Jelinek#define CHAR_BACKSPACE                  0x0008
3977b1019aJerry Jelinek#define CHAR_TAB                        0x0009
3987b1019aJerry Jelinek#define CHAR_LINEFEED                   0x000A
3997b1019aJerry Jelinek#define CHAR_CARRIAGE_RETURN            0x000D
4007b1019aJerry Jelinek
4017b1019aJerry Jelinektypedef
40235786f6Robert MustacchiACPI_EFI_STATUS
40335786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_INPUT_RESET) (
40435786f6Robert Mustacchi    struct _ACPI_SIMPLE_INPUT_INTERFACE         *This,
4057b1019aJerry Jelinek    BOOLEAN                                     ExtendedVerification);
4067b1019aJerry Jelinek
4077b1019aJerry Jelinektypedef
40835786f6Robert MustacchiACPI_EFI_STATUS
40935786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_INPUT_READ_KEY) (
41035786f6Robert Mustacchi    struct _ACPI_SIMPLE_INPUT_INTERFACE         *This,
41135786f6Robert Mustacchi    ACPI_EFI_INPUT_KEY                          *Key);
4127b1019aJerry Jelinek
41335786f6Robert Mustacchitypedef struct _ACPI_SIMPLE_INPUT_INTERFACE {
41435786f6Robert Mustacchi    ACPI_EFI_INPUT_RESET                    Reset;
41535786f6Robert Mustacchi    ACPI_EFI_INPUT_READ_KEY                 ReadKeyStroke;
41635786f6Robert Mustacchi    ACPI_EFI_EVENT                          WaitForKey;
41735786f6Robert Mustacchi} ACPI_SIMPLE_INPUT_INTERFACE;
4187b1019aJerry Jelinek
4197b1019aJerry Jelinek
4207b1019aJerry Jelinek/*
4217b1019aJerry Jelinek * Simple file system protocol
4227b1019aJerry Jelinek */
42335786f6Robert Mustacchi#define ACPI_SIMPLE_FILE_SYSTEM_PROTOCOL \
4247b1019aJerry Jelinek    { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
4257b1019aJerry Jelinek
4267b1019aJerry Jelinektypedef
42735786f6Robert MustacchiACPI_EFI_STATUS
42835786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_VOLUME_OPEN) (
42935786f6Robert Mustacchi    struct _ACPI_EFI_FILE_IO_INTERFACE          *This,
43035786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                **Root);
4317b1019aJerry Jelinek
43235786f6Robert Mustacchi#define ACPI_EFI_FILE_IO_INTERFACE_REVISION     0x00010000
4337b1019aJerry Jelinek
43435786f6Robert Mustacchitypedef struct _ACPI_EFI_FILE_IO_INTERFACE {
4357b1019aJerry Jelinek    UINT64                  Revision;
43635786f6Robert Mustacchi    ACPI_EFI_VOLUME_OPEN    OpenVolume;
43735786f6Robert Mustacchi} ACPI_EFI_FILE_IO_INTERFACE;
4387b1019aJerry Jelinek
4397b1019aJerry Jelinektypedef
44035786f6Robert MustacchiACPI_EFI_STATUS
44135786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FILE_OPEN) (
44235786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                *File,
44335786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                **NewHandle,
4447b1019aJerry Jelinek    CHAR16                                      *FileName,
4457b1019aJerry Jelinek    UINT64                                      OpenMode,
4467b1019aJerry Jelinek    UINT64                                      Attributes);
4477b1019aJerry Jelinek
4487b1019aJerry Jelinek/* Values for OpenMode used above */
4497b1019aJerry Jelinek
45035786f6Robert Mustacchi#define ACPI_EFI_FILE_MODE_READ     0x0000000000000001
45135786f6Robert Mustacchi#define ACPI_EFI_FILE_MODE_WRITE    0x0000000000000002
45235786f6Robert Mustacchi#define ACPI_EFI_FILE_MODE_CREATE   0x8000000000000000
4537b1019aJerry Jelinek
4547b1019aJerry Jelinek/* Values for Attribute used above */
4557b1019aJerry Jelinek
45635786f6Robert Mustacchi#define ACPI_EFI_FILE_READ_ONLY     0x0000000000000001
45735786f6Robert Mustacchi#define ACPI_EFI_FILE_HIDDEN        0x0000000000000002
45835786f6Robert Mustacchi#define ACPI_EFI_FILE_SYSTEM        0x0000000000000004
45935786f6Robert Mustacchi#define ACPI_EFI_FILE_RESERVIED     0x0000000000000008
46035786f6Robert Mustacchi#define ACPI_EFI_FILE_DIRECTORY     0x0000000000000010
46135786f6Robert Mustacchi#define ACPI_EFI_FILE_ARCHIVE       0x0000000000000020
46235786f6Robert Mustacchi#define ACPI_EFI_FILE_VALID_ATTR    0x0000000000000037
4637b1019aJerry Jelinek
4647b1019aJerry Jelinektypedef
46535786f6Robert MustacchiACPI_EFI_STATUS
46635786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FILE_CLOSE) (
46735786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                *File);
4687b1019aJerry Jelinek
4697b1019aJerry Jelinektypedef
47035786f6Robert MustacchiACPI_EFI_STATUS
47135786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FILE_DELETE) (
47235786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                *File);
4737b1019aJerry Jelinek
4747b1019aJerry Jelinektypedef
47535786f6Robert MustacchiACPI_EFI_STATUS
47635786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FILE_READ) (
47735786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                *File,
4787b1019aJerry Jelinek    UINTN                                       *BufferSize,
4797b1019aJerry Jelinek    VOID                                        *Buffer);
4807b1019aJerry Jelinek
4817b1019aJerry Jelinektypedef
48235786f6Robert MustacchiACPI_EFI_STATUS
48335786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FILE_WRITE) (
48435786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                *File,
4857b1019aJerry Jelinek    UINTN                                       *BufferSize,
4867b1019aJerry Jelinek    VOID                                        *Buffer);
4877b1019aJerry Jelinek
4887b1019aJerry Jelinektypedef
48935786f6Robert MustacchiACPI_EFI_STATUS
49035786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FILE_SET_POSITION) (
49135786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                *File,
4927b1019aJerry Jelinek    UINT64                                      Position);
4937b1019aJerry Jelinek
4947b1019aJerry Jelinektypedef
49535786f6Robert MustacchiACPI_EFI_STATUS
49635786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FILE_GET_POSITION) (
49735786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                *File,
4987b1019aJerry Jelinek    UINT64                                      *Position);
4997b1019aJerry Jelinek
50035786f6Robert Mustacchi#define ACPI_EFI_FILE_INFO_ID \
50135786f6Robert Mustacchi    { 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
50235786f6Robert Mustacchi
50335786f6Robert Mustacchitypedef struct {
50435786f6Robert Mustacchi    UINT64 Size;
50535786f6Robert Mustacchi    UINT64 FileSize;
50635786f6Robert Mustacchi    UINT64 PhysicalSize;
50735786f6Robert Mustacchi    ACPI_EFI_TIME CreateTime;
50835786f6Robert Mustacchi    ACPI_EFI_TIME LastAccessTime;
50935786f6Robert Mustacchi    ACPI_EFI_TIME ModificationTime;
51035786f6Robert Mustacchi    UINT64 Attribute;
51135786f6Robert Mustacchi    CHAR16 FileName[1];
51235786f6Robert Mustacchi} ACPI_EFI_FILE_INFO;
51335786f6Robert Mustacchi
51435786f6Robert Mustacchi#define SIZE_OF_ACPI_EFI_FILE_INFO  ACPI_OFFSET(ACPI_EFI_FILE_INFO, FileName)
51535786f6Robert Mustacchi
5167b1019aJerry Jelinektypedef
51735786f6Robert MustacchiACPI_EFI_STATUS
51835786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FILE_GET_INFO) (
51935786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                *File,
52035786f6Robert Mustacchi    ACPI_EFI_GUID                               *InformationType,
5217b1019aJerry Jelinek    UINTN                                       *BufferSize,
5227b1019aJerry Jelinek    VOID                                        *Buffer);
5237b1019aJerry Jelinek
5247b1019aJerry Jelinektypedef
52535786f6Robert MustacchiACPI_EFI_STATUS
52635786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FILE_SET_INFO) (
52735786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                *File,
52835786f6Robert Mustacchi    ACPI_EFI_GUID                               *InformationType,
5297b1019aJerry Jelinek    UINTN                                       BufferSize,
5307b1019aJerry Jelinek    VOID                                        *Buffer);
5317b1019aJerry Jelinek
5327b1019aJerry Jelinektypedef
53335786f6Robert MustacchiACPI_EFI_STATUS
53435786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FILE_FLUSH) (
53535786f6Robert Mustacchi    struct _ACPI_EFI_FILE_HANDLE                *File);
5367b1019aJerry Jelinek
5377b1019aJerry Jelinek
53835786f6Robert Mustacchi#define ACPI_EFI_FILE_HANDLE_REVISION           0x00010000
5397b1019aJerry Jelinek
54035786f6Robert Mustacchitypedef struct _ACPI_EFI_FILE_HANDLE {
54135786f6Robert Mustacchi    UINT64                      Revision;
54235786f6Robert Mustacchi    ACPI_EFI_FILE_OPEN          Open;
54335786f6Robert Mustacchi    ACPI_EFI_FILE_CLOSE         Close;
54435786f6Robert Mustacchi    ACPI_EFI_FILE_DELETE        Delete;
54535786f6Robert Mustacchi    ACPI_EFI_FILE_READ          Read;
54635786f6Robert Mustacchi    ACPI_EFI_FILE_WRITE         Write;
54735786f6Robert Mustacchi    ACPI_EFI_FILE_GET_POSITION  GetPosition;
54835786f6Robert Mustacchi    ACPI_EFI_FILE_SET_POSITION  SetPosition;
54935786f6Robert Mustacchi    ACPI_EFI_FILE_GET_INFO      GetInfo;
55035786f6Robert Mustacchi    ACPI_EFI_FILE_SET_INFO      SetInfo;
55135786f6Robert Mustacchi    ACPI_EFI_FILE_FLUSH         Flush;
55235786f6Robert Mustacchi} ACPI_EFI_FILE_STRUCT, *ACPI_EFI_FILE_HANDLE;
5537b1019aJerry Jelinek
5547b1019aJerry Jelinek
5557b1019aJerry Jelinek/*
5567b1019aJerry Jelinek * Loaded image protocol
5577b1019aJerry Jelinek */
55835786f6Robert Mustacchi#define ACPI_EFI_LOADED_IMAGE_PROTOCOL \
5597b1019aJerry Jelinek    { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
5607b1019aJerry Jelinek
5617b1019aJerry Jelinektypedef
56235786f6Robert MustacchiACPI_EFI_STATUS
56335786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_IMAGE_ENTRY_POINT) (
56435786f6Robert Mustacchi    ACPI_EFI_HANDLE                         ImageHandle,
56535786f6Robert Mustacchi    struct _ACPI_EFI_SYSTEM_TABLE           *SystemTable);
5667b1019aJerry Jelinek
5677b1019aJerry Jelinektypedef
56835786f6Robert MustacchiACPI_EFI_STATUS
56935786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_IMAGE_LOAD) (
5707b1019aJerry Jelinek    BOOLEAN                         BootPolicy,
57135786f6Robert Mustacchi    ACPI_EFI_HANDLE                 ParentImageHandle,
57235786f6Robert Mustacchi    ACPI_EFI_DEVICE_PATH            *FilePath,
5737b1019aJerry Jelinek    VOID                            *SourceBuffer,
5747b1019aJerry Jelinek    UINTN                           SourceSize,
57535786f6Robert Mustacchi    ACPI_EFI_HANDLE                 *ImageHandle);
5767b1019aJerry Jelinek
5777b1019aJerry Jelinektypedef
57835786f6Robert MustacchiACPI_EFI_STATUS
57935786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_IMAGE_START) (
58035786f6Robert Mustacchi    ACPI_EFI_HANDLE                 ImageHandle,
5817b1019aJerry Jelinek    UINTN                           *ExitDataSize,
5827b1019aJerry Jelinek    CHAR16                          **ExitData);
5837b1019aJerry Jelinek
5847b1019aJerry Jelinektypedef
58535786f6Robert MustacchiACPI_EFI_STATUS
58635786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_EXIT) (
58735786f6Robert Mustacchi    ACPI_EFI_HANDLE                 ImageHandle,
58835786f6Robert Mustacchi    ACPI_EFI_STATUS                 ExitStatus,
5897b1019aJerry Jelinek    UINTN                           ExitDataSize,
5907b1019aJerry Jelinek    CHAR16                          *ExitData);
5917b1019aJerry Jelinek
5927b1019aJerry Jelinektypedef
59335786f6Robert MustacchiACPI_EFI_STATUS
59435786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_IMAGE_UNLOAD) (
59535786f6Robert Mustacchi    ACPI_EFI_HANDLE                 ImageHandle);
59635786f6Robert Mustacchi
59735786f6Robert Mustacchi
59835786f6Robert Mustacchitypedef
59935786f6Robert MustacchiACPI_EFI_STATUS
60035786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_STALL) (
60135786f6Robert Mustacchi    UINTN                           Microseconds);
60235786f6Robert Mustacchi
60335786f6Robert Mustacchitypedef
60435786f6Robert MustacchiACPI_EFI_STATUS
60535786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_SET_WATCHDOG_TIMER) (
60635786f6Robert Mustacchi    UINTN                           Timeout,
60735786f6Robert Mustacchi    UINT64                          WatchdogCode,
60835786f6Robert Mustacchi    UINTN                           DataSize,
60935786f6Robert Mustacchi    CHAR16                          *WatchdogData);
6107b1019aJerry Jelinek
6117b1019aJerry Jelinek
6127b1019aJerry Jelinek#define EFI_IMAGE_INFORMATION_REVISION      0x1000
6137b1019aJerry Jelinektypedef struct {
6147b1019aJerry Jelinek    UINT32                          Revision;
61535786f6Robert Mustacchi    ACPI_EFI_HANDLE                 ParentHandle;
61635786f6Robert Mustacchi    struct _ACPI_EFI_SYSTEM_TABLE   *SystemTable;
61735786f6Robert Mustacchi    ACPI_EFI_HANDLE                 DeviceHandle;
61835786f6Robert Mustacchi    ACPI_EFI_DEVICE_PATH            *FilePath;
6197b1019aJerry Jelinek    VOID                            *Reserved;
6207b1019aJerry Jelinek    UINT32                          LoadOptionsSize;
6217b1019aJerry Jelinek    VOID                            *LoadOptions;
6227b1019aJerry Jelinek    VOID                            *ImageBase;
6237b1019aJerry Jelinek    UINT64                          ImageSize;
62435786f6Robert Mustacchi    ACPI_EFI_MEMORY_TYPE            ImageCodeType;
62535786f6Robert Mustacchi    ACPI_EFI_MEMORY_TYPE            ImageDataType;
62635786f6Robert Mustacchi    ACPI_EFI_IMAGE_UNLOAD           Unload;
6277b1019aJerry Jelinek
62835786f6Robert Mustacchi} ACPI_EFI_LOADED_IMAGE;
6297b1019aJerry Jelinek
6307b1019aJerry Jelinek
6317b1019aJerry Jelinek/*
6327b1019aJerry Jelinek * EFI Memory
6337b1019aJerry Jelinek */
6347b1019aJerry Jelinektypedef
63535786f6Robert MustacchiACPI_EFI_STATUS
63635786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_ALLOCATE_PAGES) (
63735786f6Robert Mustacchi    ACPI_EFI_ALLOCATE_TYPE          Type,
63835786f6Robert Mustacchi    ACPI_EFI_MEMORY_TYPE            MemoryType,
6397b1019aJerry Jelinek    UINTN                           NoPages,
64035786f6Robert Mustacchi    ACPI_EFI_PHYSICAL_ADDRESS       *Memory);
6417b1019aJerry Jelinek
6427b1019aJerry Jelinektypedef
64335786f6Robert MustacchiACPI_EFI_STATUS
64435786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FREE_PAGES) (
64535786f6Robert Mustacchi    ACPI_EFI_PHYSICAL_ADDRESS       Memory,
6467b1019aJerry Jelinek    UINTN                           NoPages);
6477b1019aJerry Jelinek
6487b1019aJerry Jelinektypedef
64935786f6Robert MustacchiACPI_EFI_STATUS
65035786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_GET_MEMORY_MAP) (
6517b1019aJerry Jelinek    UINTN                           *MemoryMapSize,
65235786f6Robert Mustacchi    ACPI_EFI_MEMORY_DESCRIPTOR      *MemoryMap,
6537b1019aJerry Jelinek    UINTN                           *MapKey,
6547b1019aJerry Jelinek    UINTN                           *DescriptorSize,
6557b1019aJerry Jelinek    UINT32                          *DescriptorVersion);
6567b1019aJerry Jelinek
65735786f6Robert Mustacchi#define NextMemoryDescriptor(Ptr,Size)  ((ACPI_EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) Ptr) + Size))
6587b1019aJerry Jelinek
6597b1019aJerry Jelinektypedef
66035786f6Robert MustacchiACPI_EFI_STATUS
66135786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_ALLOCATE_POOL) (
66235786f6Robert Mustacchi    ACPI_EFI_MEMORY_TYPE            PoolType,
6637b1019aJerry Jelinek    UINTN                           Size,
6647b1019aJerry Jelinek    VOID                            **Buffer);
6657b1019aJerry Jelinek
6667b1019aJerry Jelinektypedef
66735786f6Robert MustacchiACPI_EFI_STATUS
66835786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_FREE_POOL) (
6697b1019aJerry Jelinek    VOID                            *Buffer);
6707b1019aJerry Jelinek
6717b1019aJerry Jelinek
6727b1019aJerry Jelinek/*
67335786f6Robert Mustacchi * EFI Time
67435786f6Robert Mustacchi */
67535786f6Robert Mustacchitypedef struct {
67635786f6Robert Mustacchi    UINT32 Resolution;
67735786f6Robert Mustacchi    UINT32 Accuracy;
67835786f6Robert Mustacchi    BOOLEAN SetsToZero;
67935786f6Robert Mustacchi} ACPI_EFI_TIME_CAPABILITIES;
68035786f6Robert Mustacchi
68135786f6Robert Mustacchitypedef
68235786f6Robert MustacchiACPI_EFI_STATUS
68335786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_GET_TIME) (
68435786f6Robert Mustacchi    ACPI_EFI_TIME                   *Time,
68535786f6Robert Mustacchi    ACPI_EFI_TIME_CAPABILITIES      *Capabilities);
68635786f6Robert Mustacchi
68735786f6Robert Mustacchitypedef
68835786f6Robert MustacchiACPI_EFI_STATUS
68935786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_SET_TIME) (
69035786f6Robert Mustacchi    ACPI_EFI_TIME                   *Time);
69135786f6Robert Mustacchi
69235786f6Robert Mustacchi
69335786f6Robert Mustacchi/*
6947b1019aJerry Jelinek * Protocol handler functions
6957b1019aJerry Jelinek */
6967b1019aJerry Jelinektypedef enum {
69735786f6Robert Mustacchi    ACPI_EFI_NATIVE_INTERFACE,
69835786f6Robert Mustacchi    ACPI_EFI_PCODE_INTERFACE
69935786f6Robert Mustacchi} ACPI_EFI_INTERFACE_TYPE;
7007b1019aJerry Jelinek
7017b1019aJerry Jelinektypedef enum {
70235786f6Robert Mustacchi    AcpiEfiAllHandles,
70335786f6Robert Mustacchi    AcpiEfiByRegisterNotify,
70435786f6Robert Mustacchi    AcpiEfiByProtocol
70535786f6Robert Mustacchi} ACPI_EFI_LOCATE_SEARCH_TYPE;
7067b1019aJerry Jelinek
7077b1019aJerry Jelinektypedef
70835786f6Robert MustacchiACPI_EFI_STATUS
70935786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_INSTALL_PROTOCOL_INTERFACE) (
71035786f6Robert Mustacchi    ACPI_EFI_HANDLE                 *Handle,
71135786f6Robert Mustacchi    ACPI_EFI_GUID                   *Protocol,
71235786f6Robert Mustacchi    ACPI_EFI_INTERFACE_TYPE         InterfaceType,
7137b1019aJerry Jelinek    VOID                            *Interface);
7147b1019aJerry Jelinek
7157b1019aJerry Jelinektypedef
71635786f6Robert MustacchiACPI_EFI_STATUS
71735786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_REINSTALL_PROTOCOL_INTERFACE) (
71835786f6Robert Mustacchi    ACPI_EFI_HANDLE                 Handle,
71935786f6Robert Mustacchi    ACPI_EFI_GUID                   *Protocol,
7207b1019aJerry Jelinek    VOID                            *OldInterface,
7217b1019aJerry Jelinek    VOID                            *NewInterface);
7227b1019aJerry Jelinek
7237b1019aJerry Jelinektypedef
72435786f6Robert MustacchiACPI_EFI_STATUS
72535786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_UNINSTALL_PROTOCOL_INTERFACE) (
72635786f6Robert Mustacchi    ACPI_EFI_HANDLE                 Handle,
72735786f6Robert Mustacchi    ACPI_EFI_GUID                   *Protocol,
7287b1019aJerry Jelinek    VOID                            *Interface);
7297b1019aJerry Jelinek
7307b1019aJerry Jelinektypedef
73135786f6Robert MustacchiACPI_EFI_STATUS
73235786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_HANDLE_PROTOCOL) (
73335786f6Robert Mustacchi    ACPI_EFI_HANDLE                 Handle,
73435786f6Robert Mustacchi    ACPI_EFI_GUID                   *Protocol,
7357b1019aJerry Jelinek    VOID                            **Interface);
7367b1019aJerry Jelinek
7377b1019aJerry Jelinektypedef
73835786f6Robert MustacchiACPI_EFI_STATUS
73935786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_REGISTER_PROTOCOL_NOTIFY) (
74035786f6Robert Mustacchi    ACPI_EFI_GUID                   *Protocol,
74135786f6Robert Mustacchi    ACPI_EFI_EVENT                  Event,
7427b1019aJerry Jelinek    VOID                            **Registration);
7437b1019aJerry Jelinek
7447b1019aJerry Jelinektypedef
74535786f6Robert MustacchiACPI_EFI_STATUS
74635786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_LOCATE_HANDLE) (
74735786f6Robert Mustacchi    ACPI_EFI_LOCATE_SEARCH_TYPE     SearchType,
74835786f6Robert Mustacchi    ACPI_EFI_GUID                   *Protocol,
7497b1019aJerry Jelinek    VOID                            *SearchKey,
7507b1019aJerry Jelinek    UINTN                           *BufferSize,
75135786f6Robert Mustacchi    ACPI_EFI_HANDLE                 *Buffer);
7527b1019aJerry Jelinek
7537b1019aJerry Jelinektypedef
75435786f6Robert MustacchiACPI_EFI_STATUS
75535786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_LOCATE_DEVICE_PATH) (
75635786f6Robert Mustacchi    ACPI_EFI_GUID                   *Protocol,
75735786f6Robert Mustacchi    ACPI_EFI_DEVICE_PATH            **DevicePath,
75835786f6Robert Mustacchi    ACPI_EFI_HANDLE                 *Device);
7597b1019aJerry Jelinek
7607b1019aJerry Jelinektypedef
76135786f6Robert MustacchiACPI_EFI_STATUS
76235786f6Robert Mustacchi(ACPI_EFI_API *ACPI_EFI_INSTALL_CONFIGURATION_TABLE) (
76335786f6Robert Mustacchi    ACPI_EFI_GUID                   *Guid,
7647b1019aJerry Jelinek    VOID                            *Table);
7657b1019aJerry Jelinek
76635786f6Robert Mustacchi#define ACPI_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL  0x00000001
767