1 /******************************************************************************
3 * Name: acefiex.h - Extra OS specific defines, etc. for EFI
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************
116 * Alternatively, you may choose to be licensed under the terms of the
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
122 * 1. Redistributions of source code must retain the above copyright
123 * notice, this list of conditions, and the following disclaimer,
124 * without modification.
125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 * substantially similar to the "NO WARRANTY" disclaimer below
127 * ("Disclaimer") and any redistribution must be conditioned upon
128 * including a substantially similar Disclaimer requirement for further
129 * binary redistribution.
130 * 3. Neither the names of the above-listed copyright holders nor the names
131 * of any contributors may be used to endorse or promote products derived
132 * from this software without specific prior written permission.
134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146 * Alternatively, you may choose to be licensed under the terms of the
147 * GNU General Public License ("GPL") version 2 as published by the Free
148 * Software Foundation.
150 *****************************************************************************/
152 #ifndef __ACEFIEX_H__
153 #define __ACEFIEX_H__
156 #ifndef ACPI_USE_SYSTEM_CLIBRARY
158 typedef signed char int8_t;
159 typedef short int int16_t;
161 typedef unsigned char uint8_t;
162 typedef unsigned short int uint16_t;
163 typedef unsigned int uint32_t;
164 typedef COMPILER_DEPENDENT_INT64 int64_t;
165 typedef COMPILER_DEPENDENT_UINT64 uint64_t;
167 #endif /* ACPI_USE_SYSTEM_CLIBRARY */
169 #define ACPI_EFI_ERROR(a) (((INTN) a) < 0)
170 #define ACPI_EFI_SUCCESS 0
171 #define ACPI_EFI_LOAD_ERROR ACPI_EFI_ERR(1)
172 #define ACPI_EFI_INVALID_PARAMETER ACPI_EFI_ERR(2)
173 #define ACPI_EFI_UNSUPPORTED ACPI_EFI_ERR(3)
174 #define ACPI_EFI_BAD_BUFFER_SIZE ACPI_EFI_ERR(4)
175 #define ACPI_EFI_BUFFER_TOO_SMALL ACPI_EFI_ERR(5)
176 #define ACPI_EFI_NOT_READY ACPI_EFI_ERR(6)
177 #define ACPI_EFI_DEVICE_ERROR ACPI_EFI_ERR(7)
178 #define ACPI_EFI_WRITE_PROTECTED ACPI_EFI_ERR(8)
179 #define ACPI_EFI_OUT_OF_RESOURCES ACPI_EFI_ERR(9)
180 #define ACPI_EFI_VOLUME_CORRUPTED ACPI_EFI_ERR(10)
181 #define ACPI_EFI_VOLUME_FULL ACPI_EFI_ERR(11)
182 #define ACPI_EFI_NO_MEDIA ACPI_EFI_ERR(12)
183 #define ACPI_EFI_MEDIA_CHANGED ACPI_EFI_ERR(13)
184 #define ACPI_EFI_NOT_FOUND ACPI_EFI_ERR(14)
185 #define ACPI_EFI_ACCESS_DENIED ACPI_EFI_ERR(15)
186 #define ACPI_EFI_NO_RESPONSE ACPI_EFI_ERR(16)
187 #define ACPI_EFI_NO_MAPPING ACPI_EFI_ERR(17)
188 #define ACPI_EFI_TIMEOUT ACPI_EFI_ERR(18)
189 #define ACPI_EFI_NOT_STARTED ACPI_EFI_ERR(19)
190 #define ACPI_EFI_ALREADY_STARTED ACPI_EFI_ERR(20)
191 #define ACPI_EFI_ABORTED ACPI_EFI_ERR(21)
192 #define ACPI_EFI_PROTOCOL_ERROR ACPI_EFI_ERR(24)
195 typedef UINTN ACPI_EFI_STATUS;
196 typedef VOID *ACPI_EFI_HANDLE;
197 typedef VOID *ACPI_EFI_EVENT;
207 UINT16 Year; /* 1998 - 20XX */
208 UINT8 Month; /* 1 - 12 */
209 UINT8 Day; /* 1 - 31 */
210 UINT8 Hour; /* 0 - 23 */
211 UINT8 Minute; /* 0 - 59 */
212 UINT8 Second; /* 0 - 59 */
214 UINT32 Nanosecond; /* 0 - 999,999,999 */
215 INT16 TimeZone; /* -1440 to 1440 or 2047 */
220 typedef struct _ACPI_EFI_DEVICE_PATH {
224 } ACPI_EFI_DEVICE_PATH;
226 typedef UINT64 ACPI_EFI_PHYSICAL_ADDRESS;
227 typedef UINT64 ACPI_EFI_VIRTUAL_ADDRESS;
230 AcpiEfiAllocateAnyPages,
231 AcpiEfiAllocateMaxAddress,
232 AcpiEfiAllocateAddress,
233 AcpiEfiMaxAllocateType
234 } ACPI_EFI_ALLOCATE_TYPE;
237 AcpiEfiReservedMemoryType,
240 AcpiEfiBootServicesCode,
241 AcpiEfiBootServicesData,
242 AcpiEfiRuntimeServicesCode,
243 AcpiEfiRuntimeServicesData,
244 AcpiEfiConventionalMemory,
245 AcpiEfiUnusableMemory,
246 AcpiEfiACPIReclaimMemory,
247 AcpiEfiACPIMemoryNVS,
248 AcpiEfiMemoryMappedIO,
249 AcpiEfiMemoryMappedIOPortSpace,
252 } ACPI_EFI_MEMORY_TYPE;
254 /* possible caching types for the memory range */
255 #define ACPI_EFI_MEMORY_UC 0x0000000000000001
256 #define ACPI_EFI_MEMORY_WC 0x0000000000000002
257 #define ACPI_EFI_MEMORY_WT 0x0000000000000004
258 #define ACPI_EFI_MEMORY_WB 0x0000000000000008
259 #define ACPI_EFI_MEMORY_UCE 0x0000000000000010
261 /* physical memory protection on range */
262 #define ACPI_EFI_MEMORY_WP 0x0000000000001000
263 #define ACPI_EFI_MEMORY_RP 0x0000000000002000
264 #define ACPI_EFI_MEMORY_XP 0x0000000000004000
266 /* range requires a runtime mapping */
267 #define ACPI_EFI_MEMORY_RUNTIME 0x8000000000000000
269 #define ACPI_EFI_MEMORY_DESCRIPTOR_VERSION 1
273 ACPI_EFI_PHYSICAL_ADDRESS PhysicalStart;
274 ACPI_EFI_VIRTUAL_ADDRESS VirtualStart;
275 UINT64 NumberOfPages;
277 } ACPI_EFI_MEMORY_DESCRIPTOR;
279 typedef struct _ACPI_EFI_TABLE_HEARDER {
285 } ACPI_EFI_TABLE_HEADER;
289 (ACPI_EFI_API *ACPI_EFI_UNKNOWN_INTERFACE) (
294 * Text output protocol
296 #define ACPI_SIMPLE_TEXT_OUTPUT_PROTOCOL \
297 { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
301 (ACPI_EFI_API *ACPI_EFI_TEXT_RESET) (
302 struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE *This,
303 BOOLEAN ExtendedVerification);
307 (ACPI_EFI_API *ACPI_EFI_TEXT_OUTPUT_STRING) (
308 struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE *This,
313 (ACPI_EFI_API *ACPI_EFI_TEXT_TEST_STRING) (
314 struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE *This,
319 (ACPI_EFI_API *ACPI_EFI_TEXT_QUERY_MODE) (
320 struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE *This,
327 (ACPI_EFI_API *ACPI_EFI_TEXT_SET_MODE) (
328 struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE *This,
333 (ACPI_EFI_API *ACPI_EFI_TEXT_SET_ATTRIBUTE) (
334 struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE *This,
339 (ACPI_EFI_API *ACPI_EFI_TEXT_CLEAR_SCREEN) (
340 struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE *This);
344 (ACPI_EFI_API *ACPI_EFI_TEXT_SET_CURSOR_POSITION) (
345 struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE *This,
351 (ACPI_EFI_API *ACPI_EFI_TEXT_ENABLE_CURSOR) (
352 struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE *This,
361 BOOLEAN CursorVisible;
362 } ACPI_SIMPLE_TEXT_OUTPUT_MODE;
364 typedef struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE {
365 ACPI_EFI_TEXT_RESET Reset;
367 ACPI_EFI_TEXT_OUTPUT_STRING OutputString;
368 ACPI_EFI_TEXT_TEST_STRING TestString;
370 ACPI_EFI_TEXT_QUERY_MODE QueryMode;
371 ACPI_EFI_TEXT_SET_MODE SetMode;
372 ACPI_EFI_TEXT_SET_ATTRIBUTE SetAttribute;
374 ACPI_EFI_TEXT_CLEAR_SCREEN ClearScreen;
375 ACPI_EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
376 ACPI_EFI_TEXT_ENABLE_CURSOR EnableCursor;
378 ACPI_SIMPLE_TEXT_OUTPUT_MODE *Mode;
379 } ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE;
382 * Text input protocol
384 #define ACPI_SIMPLE_TEXT_INPUT_PROTOCOL \
385 { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
390 } ACPI_EFI_INPUT_KEY;
393 * Baseline unicode control chars
395 #define CHAR_NULL 0x0000
396 #define CHAR_BACKSPACE 0x0008
397 #define CHAR_TAB 0x0009
398 #define CHAR_LINEFEED 0x000A
399 #define CHAR_CARRIAGE_RETURN 0x000D
403 (ACPI_EFI_API *ACPI_EFI_INPUT_RESET) (
404 struct _ACPI_SIMPLE_INPUT_INTERFACE *This,
405 BOOLEAN ExtendedVerification);
409 (ACPI_EFI_API *ACPI_EFI_INPUT_READ_KEY) (
410 struct _ACPI_SIMPLE_INPUT_INTERFACE *This,
411 ACPI_EFI_INPUT_KEY *Key);
413 typedef struct _ACPI_SIMPLE_INPUT_INTERFACE {
414 ACPI_EFI_INPUT_RESET Reset;
415 ACPI_EFI_INPUT_READ_KEY ReadKeyStroke;
416 ACPI_EFI_EVENT WaitForKey;
417 } ACPI_SIMPLE_INPUT_INTERFACE;
421 * Simple file system protocol
423 #define ACPI_SIMPLE_FILE_SYSTEM_PROTOCOL \
424 { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
428 (ACPI_EFI_API *ACPI_EFI_VOLUME_OPEN) (
429 struct _ACPI_EFI_FILE_IO_INTERFACE *This,
430 struct _ACPI_EFI_FILE_HANDLE **Root);
432 #define ACPI_EFI_FILE_IO_INTERFACE_REVISION 0x00010000
434 typedef struct _ACPI_EFI_FILE_IO_INTERFACE {
436 ACPI_EFI_VOLUME_OPEN OpenVolume;
437 } ACPI_EFI_FILE_IO_INTERFACE;
441 (ACPI_EFI_API *ACPI_EFI_FILE_OPEN) (
442 struct _ACPI_EFI_FILE_HANDLE *File,
443 struct _ACPI_EFI_FILE_HANDLE **NewHandle,
448 /* Values for OpenMode used above */
450 #define ACPI_EFI_FILE_MODE_READ 0x0000000000000001
451 #define ACPI_EFI_FILE_MODE_WRITE 0x0000000000000002
452 #define ACPI_EFI_FILE_MODE_CREATE 0x8000000000000000
454 /* Values for Attribute used above */
456 #define ACPI_EFI_FILE_READ_ONLY 0x0000000000000001
457 #define ACPI_EFI_FILE_HIDDEN 0x0000000000000002
458 #define ACPI_EFI_FILE_SYSTEM 0x0000000000000004
459 #define ACPI_EFI_FILE_RESERVIED 0x0000000000000008
460 #define ACPI_EFI_FILE_DIRECTORY 0x0000000000000010
461 #define ACPI_EFI_FILE_ARCHIVE 0x0000000000000020
462 #define ACPI_EFI_FILE_VALID_ATTR 0x0000000000000037
466 (ACPI_EFI_API *ACPI_EFI_FILE_CLOSE) (
467 struct _ACPI_EFI_FILE_HANDLE *File);
471 (ACPI_EFI_API *ACPI_EFI_FILE_DELETE) (
472 struct _ACPI_EFI_FILE_HANDLE *File);
476 (ACPI_EFI_API *ACPI_EFI_FILE_READ) (
477 struct _ACPI_EFI_FILE_HANDLE *File,
483 (ACPI_EFI_API *ACPI_EFI_FILE_WRITE) (
484 struct _ACPI_EFI_FILE_HANDLE *File,
490 (ACPI_EFI_API *ACPI_EFI_FILE_SET_POSITION) (
491 struct _ACPI_EFI_FILE_HANDLE *File,
496 (ACPI_EFI_API *ACPI_EFI_FILE_GET_POSITION) (
497 struct _ACPI_EFI_FILE_HANDLE *File,
500 #define ACPI_EFI_FILE_INFO_ID \
501 { 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
507 ACPI_EFI_TIME CreateTime;
508 ACPI_EFI_TIME LastAccessTime;
509 ACPI_EFI_TIME ModificationTime;
512 } ACPI_EFI_FILE_INFO;
514 #define SIZE_OF_ACPI_EFI_FILE_INFO ACPI_OFFSET(ACPI_EFI_FILE_INFO, FileName)
518 (ACPI_EFI_API *ACPI_EFI_FILE_GET_INFO) (
519 struct _ACPI_EFI_FILE_HANDLE *File,
520 ACPI_EFI_GUID *InformationType,
526 (ACPI_EFI_API *ACPI_EFI_FILE_SET_INFO) (
527 struct _ACPI_EFI_FILE_HANDLE *File,
528 ACPI_EFI_GUID *InformationType,
534 (ACPI_EFI_API *ACPI_EFI_FILE_FLUSH) (
535 struct _ACPI_EFI_FILE_HANDLE *File);
538 #define ACPI_EFI_FILE_HANDLE_REVISION 0x00010000
540 typedef struct _ACPI_EFI_FILE_HANDLE {
542 ACPI_EFI_FILE_OPEN Open;
543 ACPI_EFI_FILE_CLOSE Close;
544 ACPI_EFI_FILE_DELETE Delete;
545 ACPI_EFI_FILE_READ Read;
546 ACPI_EFI_FILE_WRITE Write;
547 ACPI_EFI_FILE_GET_POSITION GetPosition;
548 ACPI_EFI_FILE_SET_POSITION SetPosition;
549 ACPI_EFI_FILE_GET_INFO GetInfo;
550 ACPI_EFI_FILE_SET_INFO SetInfo;
551 ACPI_EFI_FILE_FLUSH Flush;
552 } ACPI_EFI_FILE_STRUCT, *ACPI_EFI_FILE_HANDLE;
556 * Loaded image protocol
558 #define ACPI_EFI_LOADED_IMAGE_PROTOCOL \
559 { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
563 (ACPI_EFI_API *ACPI_EFI_IMAGE_ENTRY_POINT) (
564 ACPI_EFI_HANDLE ImageHandle,
565 struct _ACPI_EFI_SYSTEM_TABLE *SystemTable);
569 (ACPI_EFI_API *ACPI_EFI_IMAGE_LOAD) (
571 ACPI_EFI_HANDLE ParentImageHandle,
572 ACPI_EFI_DEVICE_PATH *FilePath,
575 ACPI_EFI_HANDLE *ImageHandle);
579 (ACPI_EFI_API *ACPI_EFI_IMAGE_START) (
580 ACPI_EFI_HANDLE ImageHandle,
586 (ACPI_EFI_API *ACPI_EFI_EXIT) (
587 ACPI_EFI_HANDLE ImageHandle,
588 ACPI_EFI_STATUS ExitStatus,
594 (ACPI_EFI_API *ACPI_EFI_IMAGE_UNLOAD) (
595 ACPI_EFI_HANDLE ImageHandle);
600 (ACPI_EFI_API *ACPI_EFI_STALL) (
605 (ACPI_EFI_API *ACPI_EFI_SET_WATCHDOG_TIMER) (
609 CHAR16 *WatchdogData);
612 #define EFI_IMAGE_INFORMATION_REVISION 0x1000
615 ACPI_EFI_HANDLE ParentHandle;
616 struct _ACPI_EFI_SYSTEM_TABLE *SystemTable;
617 ACPI_EFI_HANDLE DeviceHandle;
618 ACPI_EFI_DEVICE_PATH *FilePath;
620 UINT32 LoadOptionsSize;
624 ACPI_EFI_MEMORY_TYPE ImageCodeType;
625 ACPI_EFI_MEMORY_TYPE ImageDataType;
626 ACPI_EFI_IMAGE_UNLOAD Unload;
628 } ACPI_EFI_LOADED_IMAGE;
636 (ACPI_EFI_API *ACPI_EFI_ALLOCATE_PAGES) (
637 ACPI_EFI_ALLOCATE_TYPE Type,
638 ACPI_EFI_MEMORY_TYPE MemoryType,
640 ACPI_EFI_PHYSICAL_ADDRESS *Memory);
644 (ACPI_EFI_API *ACPI_EFI_FREE_PAGES) (
645 ACPI_EFI_PHYSICAL_ADDRESS Memory,
650 (ACPI_EFI_API *ACPI_EFI_GET_MEMORY_MAP) (
651 UINTN *MemoryMapSize,
652 ACPI_EFI_MEMORY_DESCRIPTOR *MemoryMap,
654 UINTN *DescriptorSize,
655 UINT32 *DescriptorVersion);
657 #define NextMemoryDescriptor(Ptr,Size) ((ACPI_EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) Ptr) + Size))
661 (ACPI_EFI_API *ACPI_EFI_ALLOCATE_POOL) (
662 ACPI_EFI_MEMORY_TYPE PoolType,
668 (ACPI_EFI_API *ACPI_EFI_FREE_POOL) (
679 } ACPI_EFI_TIME_CAPABILITIES;
683 (ACPI_EFI_API *ACPI_EFI_GET_TIME) (
685 ACPI_EFI_TIME_CAPABILITIES *Capabilities);
689 (ACPI_EFI_API *ACPI_EFI_SET_TIME) (
690 ACPI_EFI_TIME *Time);
694 * Protocol handler functions
697 ACPI_EFI_NATIVE_INTERFACE,
698 ACPI_EFI_PCODE_INTERFACE
699 } ACPI_EFI_INTERFACE_TYPE;
703 AcpiEfiByRegisterNotify,
705 } ACPI_EFI_LOCATE_SEARCH_TYPE;
709 (ACPI_EFI_API *ACPI_EFI_INSTALL_PROTOCOL_INTERFACE) (
710 ACPI_EFI_HANDLE *Handle,
711 ACPI_EFI_GUID *Protocol,
712 ACPI_EFI_INTERFACE_TYPE InterfaceType,
717 (ACPI_EFI_API *ACPI_EFI_REINSTALL_PROTOCOL_INTERFACE) (
718 ACPI_EFI_HANDLE Handle,
719 ACPI_EFI_GUID *Protocol,
725 (ACPI_EFI_API *ACPI_EFI_UNINSTALL_PROTOCOL_INTERFACE) (
726 ACPI_EFI_HANDLE Handle,
727 ACPI_EFI_GUID *Protocol,
732 (ACPI_EFI_API *ACPI_EFI_HANDLE_PROTOCOL) (
733 ACPI_EFI_HANDLE Handle,
734 ACPI_EFI_GUID *Protocol,
739 (ACPI_EFI_API *ACPI_EFI_REGISTER_PROTOCOL_NOTIFY) (
740 ACPI_EFI_GUID *Protocol,
741 ACPI_EFI_EVENT Event,
742 VOID **Registration);
746 (ACPI_EFI_API *ACPI_EFI_LOCATE_HANDLE) (
747 ACPI_EFI_LOCATE_SEARCH_TYPE SearchType,
748 ACPI_EFI_GUID *Protocol,
751 ACPI_EFI_HANDLE *Buffer);
755 (ACPI_EFI_API *ACPI_EFI_LOCATE_DEVICE_PATH) (
756 ACPI_EFI_GUID *Protocol,
757 ACPI_EFI_DEVICE_PATH **DevicePath,
758 ACPI_EFI_HANDLE *Device);
762 (ACPI_EFI_API *ACPI_EFI_INSTALL_CONFIGURATION_TABLE) (
766 #define ACPI_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
767 #define ACPI_EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
768 #define ACPI_EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
769 #define ACPI_EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
770 #define ACPI_EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
771 #define ACPI_EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020
775 (ACPI_EFI_API *ACPI_EFI_OPEN_PROTOCOL) (
776 ACPI_EFI_HANDLE Handle,
777 ACPI_EFI_GUID *Protocol,
779 ACPI_EFI_HANDLE AgentHandle,
780 ACPI_EFI_HANDLE ControllerHandle,
785 (ACPI_EFI_API *ACPI_EFI_CLOSE_PROTOCOL) (
786 ACPI_EFI_HANDLE Handle,
787 ACPI_EFI_GUID *Protocol,
788 ACPI_EFI_HANDLE AgentHandle,
789 ACPI_EFI_HANDLE ControllerHandle);
792 ACPI_EFI_HANDLE AgentHandle;
793 ACPI_EFI_HANDLE ControllerHandle;
796 } ACPI_EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
800 (ACPI_EFI_API *ACPI_EFI_OPEN_PROTOCOL_INFORMATION) (
801 ACPI_EFI_HANDLE Handle,
802 ACPI_EFI_GUID *Protocol,
803 ACPI_EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
808 (ACPI_EFI_API *ACPI_EFI_PROTOCOLS_PER_HANDLE) (
809 ACPI_EFI_HANDLE Handle,
810 ACPI_EFI_GUID ***ProtocolBuffer,
811 UINTN *ProtocolBufferCount);
815 (ACPI_EFI_API *ACPI_EFI_LOCATE_HANDLE_BUFFER) (
816 ACPI_EFI_LOCATE_SEARCH_TYPE SearchType,
817 ACPI_EFI_GUID *Protocol,
820 ACPI_EFI_HANDLE **Buffer);
824 (ACPI_EFI_API *ACPI_EFI_LOCATE_PROTOCOL) (
825 ACPI_EFI_GUID *Protocol,
831 (ACPI_EFI_API *ACPI_EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
832 ACPI_EFI_HANDLE *Handle,
837 (ACPI_EFI_API *ACPI_EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
838 ACPI_EFI_HANDLE Handle,
843 (ACPI_EFI_API *ACPI_EFI_CALCULATE_CRC32) (
850 (ACPI_EFI_API *ACPI_EFI_COPY_MEM) (
857 (ACPI_EFI_API *ACPI_EFI_SET_MEM) (
863 * EFI Boot Services Table
865 #define ACPI_EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42
866 #define ACPI_EFI_BOOT_SERVICES_REVISION (ACPI_EFI_SPECIFICATION_MAJOR_REVISION<<16) | (ACPI_EFI_SPECIFICATION_MINOR_REVISION)
868 typedef struct _ACPI_EFI_BOOT_SERVICES {
869 ACPI_EFI_TABLE_HEADER Hdr;
872 ACPI_EFI_RAISE_TPL RaiseTPL;
873 ACPI_EFI_RESTORE_TPL RestoreTPL;
875 ACPI_EFI_UNKNOWN_INTERFACE RaiseTPL;
876 ACPI_EFI_UNKNOWN_INTERFACE RestoreTPL;
879 ACPI_EFI_ALLOCATE_PAGES AllocatePages;
880 ACPI_EFI_FREE_PAGES FreePages;
881 ACPI_EFI_GET_MEMORY_MAP GetMemoryMap;
882 ACPI_EFI_ALLOCATE_POOL AllocatePool;
883 ACPI_EFI_FREE_POOL FreePool;
886 ACPI_EFI_CREATE_EVENT CreateEvent;
887 ACPI_EFI_SET_TIMER SetTimer;
888 ACPI_EFI_WAIT_FOR_EVENT WaitForEvent;
889 ACPI_EFI_SIGNAL_EVENT SignalEvent;
890 ACPI_EFI_CLOSE_EVENT CloseEvent;
891 ACPI_EFI_CHECK_EVENT CheckEvent;
893 ACPI_EFI_UNKNOWN_INTERFACE CreateEvent;
894 ACPI_EFI_UNKNOWN_INTERFACE SetTimer;
895 ACPI_EFI_UNKNOWN_INTERFACE WaitForEvent;
896 ACPI_EFI_UNKNOWN_INTERFACE SignalEvent;
897 ACPI_EFI_UNKNOWN_INTERFACE CloseEvent;
898 ACPI_EFI_UNKNOWN_INTERFACE CheckEvent;
901 ACPI_EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;
902 ACPI_EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
903 ACPI_EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
904 ACPI_EFI_HANDLE_PROTOCOL HandleProtocol;
905 ACPI_EFI_HANDLE_PROTOCOL PCHandleProtocol;
906 ACPI_EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;
907 ACPI_EFI_LOCATE_HANDLE LocateHandle;
908 ACPI_EFI_LOCATE_DEVICE_PATH LocateDevicePath;
909 ACPI_EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
911 ACPI_EFI_IMAGE_LOAD LoadImage;
912 ACPI_EFI_IMAGE_START StartImage;
914 ACPI_EFI_IMAGE_UNLOAD UnloadImage;
917 ACPI_EFI_EXIT_BOOT_SERVICES ExitBootServices;
918 ACPI_EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;
920 ACPI_EFI_UNKNOWN_INTERFACE ExitBootServices;
921 ACPI_EFI_UNKNOWN_INTERFACE GetNextMonotonicCount;
923 ACPI_EFI_STALL Stall;
924 ACPI_EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;
927 ACPI_EFI_CONNECT_CONTROLLER ConnectController;
928 ACPI_EFI_DISCONNECT_CONTROLLER DisconnectController;
930 ACPI_EFI_UNKNOWN_INTERFACE ConnectController;
931 ACPI_EFI_UNKNOWN_INTERFACE DisconnectController;
934 ACPI_EFI_OPEN_PROTOCOL OpenProtocol;
935 ACPI_EFI_CLOSE_PROTOCOL CloseProtocol;
936 ACPI_EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation;
937 ACPI_EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle;
938 ACPI_EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer;
939 ACPI_EFI_LOCATE_PROTOCOL LocateProtocol;
940 ACPI_EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
941 ACPI_EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;
943 ACPI_EFI_CALCULATE_CRC32 CalculateCrc32;
945 ACPI_EFI_COPY_MEM CopyMem;
946 ACPI_EFI_SET_MEM SetMem;
949 ACPI_EFI_CREATE_EVENT_EX CreateEventEx;
951 ACPI_EFI_UNKNOWN_INTERFACE CreateEventEx;
953 } ACPI_EFI_BOOT_SERVICES;
957 * EFI Runtime Services Table
959 #define ACPI_EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552
960 #define ACPI_EFI_RUNTIME_SERVICES_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
962 typedef struct _ACPI_EFI_RUNTIME_SERVICES {
963 ACPI_EFI_TABLE_HEADER Hdr;
965 ACPI_EFI_GET_TIME GetTime;
966 ACPI_EFI_SET_TIME SetTime;
968 ACPI_EFI_GET_WAKEUP_TIME GetWakeupTime;
969 ACPI_EFI_SET_WAKEUP_TIME SetWakeupTime;
971 ACPI_EFI_UNKNOWN_INTERFACE GetWakeupTime;
972 ACPI_EFI_UNKNOWN_INTERFACE SetWakeupTime;
976 ACPI_EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap;
977 ACPI_EFI_CONVERT_POINTER ConvertPointer;
979 ACPI_EFI_UNKNOWN_INTERFACE SetVirtualAddressMap;
980 ACPI_EFI_UNKNOWN_INTERFACE ConvertPointer;
984 ACPI_EFI_GET_VARIABLE GetVariable;
985 ACPI_EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName;
986 ACPI_EFI_SET_VARIABLE SetVariable;
988 ACPI_EFI_UNKNOWN_INTERFACE GetVariable;
989 ACPI_EFI_UNKNOWN_INTERFACE GetNextVariableName;
990 ACPI_EFI_UNKNOWN_INTERFACE SetVariable;
994 ACPI_EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount;
995 ACPI_EFI_RESET_SYSTEM ResetSystem;
997 ACPI_EFI_UNKNOWN_INTERFACE GetNextHighMonotonicCount;
998 ACPI_EFI_UNKNOWN_INTERFACE ResetSystem;
1001 } ACPI_EFI_RUNTIME_SERVICES;
1009 * EFI Configuration Table and GUID definitions
1011 #define ACPI_TABLE_GUID \
1012 { 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
1013 #define ACPI_20_TABLE_GUID \
1014 { 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} }
1016 typedef struct _ACPI_EFI_CONFIGURATION_TABLE {
1017 ACPI_EFI_GUID VendorGuid;
1019 } ACPI_EFI_CONFIGURATION_TABLE;
1022 #define ACPI_EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249
1023 #define ACPI_EFI_SYSTEM_TABLE_REVISION (ACPI_EFI_SPECIFICATION_MAJOR_REVISION<<16) | (ACPI_EFI_SPECIFICATION_MINOR_REVISION)
1025 typedef struct _ACPI_EFI_SYSTEM_TABLE {
1026 ACPI_EFI_TABLE_HEADER Hdr;
1028 CHAR16 *FirmwareVendor;
1029 UINT32 FirmwareRevision;
1031 ACPI_EFI_HANDLE ConsoleInHandle;
1032 ACPI_SIMPLE_INPUT_INTERFACE *ConIn;
1034 ACPI_EFI_HANDLE ConsoleOutHandle;
1035 ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut;
1037 ACPI_EFI_HANDLE StandardErrorHandle;
1038 ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE *StdErr;
1040 ACPI_EFI_RUNTIME_SERVICES *RuntimeServices;
1041 ACPI_EFI_BOOT_SERVICES *BootServices;
1043 UINTN NumberOfTableEntries;
1044 ACPI_EFI_CONFIGURATION_TABLE *ConfigurationTable;
1046 } ACPI_EFI_SYSTEM_TABLE;
1050 * EFI PCI I/O Protocol
1052 #define ACPI_EFI_PCI_IO_PROTOCOL \
1053 { 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a} }
1056 AcpiEfiPciIoWidthUint8 = 0,
1057 AcpiEfiPciIoWidthUint16,
1058 AcpiEfiPciIoWidthUint32,
1059 AcpiEfiPciIoWidthUint64,
1060 AcpiEfiPciIoWidthFifoUint8,
1061 AcpiEfiPciIoWidthFifoUint16,
1062 AcpiEfiPciIoWidthFifoUint32,
1063 AcpiEfiPciIoWidthFifoUint64,
1064 AcpiEfiPciIoWidthFillUint8,
1065 AcpiEfiPciIoWidthFillUint16,
1066 AcpiEfiPciIoWidthFillUint32,
1067 AcpiEfiPciIoWidthFillUint64,
1068 AcpiEfiPciIoWidthMaximum
1069 } ACPI_EFI_PCI_IO_PROTOCOL_WIDTH;
1073 (ACPI_EFI_API *ACPI_EFI_PCI_IO_PROTOCOL_CONFIG)(
1074 struct _ACPI_EFI_PCI_IO *This,
1075 ACPI_EFI_PCI_IO_PROTOCOL_WIDTH Width,
1081 ACPI_EFI_PCI_IO_PROTOCOL_CONFIG Read;
1082 ACPI_EFI_PCI_IO_PROTOCOL_CONFIG Write;
1083 } ACPI_EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;
1087 (ACPI_EFI_API *ACPI_EFI_PCI_IO_PROTOCOL_GET_LOCATION)(
1088 struct _ACPI_EFI_PCI_IO *This,
1089 UINTN *SegmentNumber,
1091 UINTN *DeviceNumber,
1092 UINTN *FunctionNumber);
1094 typedef struct _ACPI_EFI_PCI_IO {
1095 ACPI_EFI_UNKNOWN_INTERFACE PollMem;
1096 ACPI_EFI_UNKNOWN_INTERFACE PollIo;
1097 ACPI_EFI_UNKNOWN_INTERFACE Mem;
1098 ACPI_EFI_UNKNOWN_INTERFACE Io;
1099 ACPI_EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci;
1100 ACPI_EFI_UNKNOWN_INTERFACE CopyMem;
1101 ACPI_EFI_UNKNOWN_INTERFACE Map;
1102 ACPI_EFI_UNKNOWN_INTERFACE Unmap;
1103 ACPI_EFI_UNKNOWN_INTERFACE AllocateBuffer;
1104 ACPI_EFI_UNKNOWN_INTERFACE FreeBuffer;
1105 ACPI_EFI_UNKNOWN_INTERFACE Flush;
1106 ACPI_EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation;
1107 ACPI_EFI_UNKNOWN_INTERFACE Attributes;
1108 ACPI_EFI_UNKNOWN_INTERFACE GetBarAttributes;
1109 ACPI_EFI_UNKNOWN_INTERFACE SetBarAttributes;
1114 /* FILE abstraction */
1116 union acpi_efi_file {
1117 struct _ACPI_EFI_FILE_HANDLE File;
1118 struct _ACPI_SIMPLE_TEXT_OUTPUT_INTERFACE ConOut;
1119 struct _ACPI_SIMPLE_INPUT_INTERFACE ConIn;
1123 /* EFI definitions */
1125 #if defined(_GNU_EFI) || defined(_EDK2_EFI)
1128 * This is needed to hide platform specific code from ACPICA
1138 UINT64 Multiplicand,
1152 * EFI specific prototypes
1156 ACPI_EFI_HANDLE Image,
1157 ACPI_EFI_SYSTEM_TABLE *SystemTab);
1166 extern ACPI_EFI_GUID AcpiGbl_LoadedImageProtocol;
1167 extern ACPI_EFI_GUID AcpiGbl_TextInProtocol;
1168 extern ACPI_EFI_GUID AcpiGbl_TextOutProtocol;
1169 extern ACPI_EFI_GUID AcpiGbl_FileSystemProtocol;
1170 extern ACPI_EFI_GUID AcpiGbl_GenericFileInfo;
1172 #endif /* __ACEFIEX_H__ */