sd: remove 'ssd' driver support
[unleashed/tickless.git] / arch / x86 / include / sys / acpi / platform / acefiex.h
blob7df5012806dace71cae8d1883d28be83e6d70b01
1 /******************************************************************************
3 * Name: acefiex.h - Extra OS specific defines, etc. for EFI
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2016, Intel Corp.
9 * All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
44 #ifndef __ACEFIEX_H__
45 #define __ACEFIEX_H__
48 #define EFI_ERROR(a) (((INTN) a) < 0)
49 #define EFI_SUCCESS 0
50 #define EFI_LOAD_ERROR EFIERR(1)
51 #define EFI_INVALID_PARAMETER EFIERR(2)
52 #define EFI_UNSUPPORTED EFIERR(3)
53 #define EFI_BAD_BUFFER_SIZE EFIERR(4)
54 #define EFI_BUFFER_TOO_SMALL EFIERR(5)
55 #define EFI_NOT_READY EFIERR(6)
56 #define EFI_DEVICE_ERROR EFIERR(7)
57 #define EFI_WRITE_PROTECTED EFIERR(8)
58 #define EFI_OUT_OF_RESOURCES EFIERR(9)
59 #define EFI_VOLUME_CORRUPTED EFIERR(10)
60 #define EFI_VOLUME_FULL EFIERR(11)
61 #define EFI_NO_MEDIA EFIERR(12)
62 #define EFI_MEDIA_CHANGED EFIERR(13)
63 #define EFI_NOT_FOUND EFIERR(14)
64 #define EFI_ACCESS_DENIED EFIERR(15)
65 #define EFI_NO_RESPONSE EFIERR(16)
66 #define EFI_NO_MAPPING EFIERR(17)
67 #define EFI_TIMEOUT EFIERR(18)
68 #define EFI_NOT_STARTED EFIERR(19)
69 #define EFI_ALREADY_STARTED EFIERR(20)
70 #define EFI_ABORTED EFIERR(21)
71 #define EFI_PROTOCOL_ERROR EFIERR(24)
74 typedef UINTN EFI_STATUS;
75 typedef VOID *EFI_HANDLE;
76 typedef VOID *EFI_EVENT;
78 typedef struct {
79 UINT32 Data1;
80 UINT16 Data2;
81 UINT16 Data3;
82 UINT8 Data4[8];
83 } EFI_GUID;
85 typedef struct _EFI_DEVICE_PATH {
86 UINT8 Type;
87 UINT8 SubType;
88 UINT8 Length[2];
89 } EFI_DEVICE_PATH;
91 typedef UINT64 EFI_PHYSICAL_ADDRESS;
92 typedef UINT64 EFI_VIRTUAL_ADDRESS;
94 typedef enum {
95 AllocateAnyPages,
96 AllocateMaxAddress,
97 AllocateAddress,
98 MaxAllocateType
99 } EFI_ALLOCATE_TYPE;
101 typedef enum {
102 EfiReservedMemoryType,
103 EfiLoaderCode,
104 EfiLoaderData,
105 EfiBootServicesCode,
106 EfiBootServicesData,
107 EfiRuntimeServicesCode,
108 EfiRuntimeServicesData,
109 EfiConventionalMemory,
110 EfiUnusableMemory,
111 EfiACPIReclaimMemory,
112 EfiACPIMemoryNVS,
113 EfiMemoryMappedIO,
114 EfiMemoryMappedIOPortSpace,
115 EfiPalCode,
116 EfiMaxMemoryType
117 } EFI_MEMORY_TYPE;
119 /* possible caching types for the memory range */
120 #define EFI_MEMORY_UC 0x0000000000000001
121 #define EFI_MEMORY_WC 0x0000000000000002
122 #define EFI_MEMORY_WT 0x0000000000000004
123 #define EFI_MEMORY_WB 0x0000000000000008
124 #define EFI_MEMORY_UCE 0x0000000000000010
126 /* physical memory protection on range */
127 #define EFI_MEMORY_WP 0x0000000000001000
128 #define EFI_MEMORY_RP 0x0000000000002000
129 #define EFI_MEMORY_XP 0x0000000000004000
131 /* range requires a runtime mapping */
132 #define EFI_MEMORY_RUNTIME 0x8000000000000000
134 #define EFI_MEMORY_DESCRIPTOR_VERSION 1
135 typedef struct {
136 UINT32 Type;
137 UINT32 Pad;
138 EFI_PHYSICAL_ADDRESS PhysicalStart;
139 EFI_VIRTUAL_ADDRESS VirtualStart;
140 UINT64 NumberOfPages;
141 UINT64 Attribute;
142 } EFI_MEMORY_DESCRIPTOR;
144 typedef struct _EFI_TABLE_HEARDER {
145 UINT64 Signature;
146 UINT32 Revision;
147 UINT32 HeaderSize;
148 UINT32 CRC32;
149 UINT32 Reserved;
150 } EFI_TABLE_HEADER;
152 typedef
153 EFI_STATUS
154 (EFIAPI *EFI_UNKNOWN_INTERFACE) (
155 void);
159 * Text output protocol
161 #define SIMPLE_TEXT_OUTPUT_PROTOCOL \
162 { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
164 typedef
165 EFI_STATUS
166 (EFIAPI *EFI_TEXT_RESET) (
167 struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
168 BOOLEAN ExtendedVerification);
170 typedef
171 EFI_STATUS
172 (EFIAPI *EFI_TEXT_OUTPUT_STRING) (
173 struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
174 CHAR16 *String);
176 typedef
177 EFI_STATUS
178 (EFIAPI *EFI_TEXT_TEST_STRING) (
179 struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
180 CHAR16 *String);
182 typedef
183 EFI_STATUS
184 (EFIAPI *EFI_TEXT_QUERY_MODE) (
185 struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
186 UINTN ModeNumber,
187 UINTN *Columns,
188 UINTN *Rows);
190 typedef
191 EFI_STATUS
192 (EFIAPI *EFI_TEXT_SET_MODE) (
193 struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
194 UINTN ModeNumber);
196 typedef
197 EFI_STATUS
198 (EFIAPI *EFI_TEXT_SET_ATTRIBUTE) (
199 struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
200 UINTN Attribute);
202 typedef
203 EFI_STATUS
204 (EFIAPI *EFI_TEXT_CLEAR_SCREEN) (
205 struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This);
207 typedef
208 EFI_STATUS
209 (EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) (
210 struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
211 UINTN Column,
212 UINTN Row);
214 typedef
215 EFI_STATUS
216 (EFIAPI *EFI_TEXT_ENABLE_CURSOR) (
217 struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
218 BOOLEAN Enable);
220 typedef struct {
221 INT32 MaxMode;
222 INT32 Mode;
223 INT32 Attribute;
224 INT32 CursorColumn;
225 INT32 CursorRow;
226 BOOLEAN CursorVisible;
227 } SIMPLE_TEXT_OUTPUT_MODE;
229 typedef struct _SIMPLE_TEXT_OUTPUT_INTERFACE {
230 EFI_TEXT_RESET Reset;
232 EFI_TEXT_OUTPUT_STRING OutputString;
233 EFI_TEXT_TEST_STRING TestString;
235 EFI_TEXT_QUERY_MODE QueryMode;
236 EFI_TEXT_SET_MODE SetMode;
237 EFI_TEXT_SET_ATTRIBUTE SetAttribute;
239 EFI_TEXT_CLEAR_SCREEN ClearScreen;
240 EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
241 EFI_TEXT_ENABLE_CURSOR EnableCursor;
243 SIMPLE_TEXT_OUTPUT_MODE *Mode;
244 } SIMPLE_TEXT_OUTPUT_INTERFACE;
247 * Text input protocol
249 #define SIMPLE_TEXT_INPUT_PROTOCOL \
250 { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
252 typedef struct {
253 UINT16 ScanCode;
254 CHAR16 UnicodeChar;
255 } EFI_INPUT_KEY;
258 * Baseline unicode control chars
260 #define CHAR_NULL 0x0000
261 #define CHAR_BACKSPACE 0x0008
262 #define CHAR_TAB 0x0009
263 #define CHAR_LINEFEED 0x000A
264 #define CHAR_CARRIAGE_RETURN 0x000D
266 typedef
267 EFI_STATUS
268 (EFIAPI *EFI_INPUT_RESET) (
269 struct _SIMPLE_INPUT_INTERFACE *This,
270 BOOLEAN ExtendedVerification);
272 typedef
273 EFI_STATUS
274 (EFIAPI *EFI_INPUT_READ_KEY) (
275 struct _SIMPLE_INPUT_INTERFACE *This,
276 EFI_INPUT_KEY *Key);
278 typedef struct _SIMPLE_INPUT_INTERFACE {
279 EFI_INPUT_RESET Reset;
280 EFI_INPUT_READ_KEY ReadKeyStroke;
281 EFI_EVENT WaitForKey;
282 } SIMPLE_INPUT_INTERFACE;
286 * Simple file system protocol
288 #define SIMPLE_FILE_SYSTEM_PROTOCOL \
289 { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
291 typedef
292 EFI_STATUS
293 (EFIAPI *EFI_VOLUME_OPEN) (
294 struct _EFI_FILE_IO_INTERFACE *This,
295 struct _EFI_FILE_HANDLE **Root);
297 #define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
299 typedef struct _EFI_FILE_IO_INTERFACE {
300 UINT64 Revision;
301 EFI_VOLUME_OPEN OpenVolume;
302 } EFI_FILE_IO_INTERFACE;
304 typedef
305 EFI_STATUS
306 (EFIAPI *EFI_FILE_OPEN) (
307 struct _EFI_FILE_HANDLE *File,
308 struct _EFI_FILE_HANDLE **NewHandle,
309 CHAR16 *FileName,
310 UINT64 OpenMode,
311 UINT64 Attributes);
313 /* Values for OpenMode used above */
315 #define EFI_FILE_MODE_READ 0x0000000000000001
316 #define EFI_FILE_MODE_WRITE 0x0000000000000002
317 #define EFI_FILE_MODE_CREATE 0x8000000000000000
319 /* Values for Attribute used above */
321 #define EFI_FILE_READ_ONLY 0x0000000000000001
322 #define EFI_FILE_HIDDEN 0x0000000000000002
323 #define EFI_FILE_SYSTEM 0x0000000000000004
324 #define EFI_FILE_RESERVIED 0x0000000000000008
325 #define EFI_FILE_DIRECTORY 0x0000000000000010
326 #define EFI_FILE_ARCHIVE 0x0000000000000020
327 #define EFI_FILE_VALID_ATTR 0x0000000000000037
329 typedef
330 EFI_STATUS
331 (EFIAPI *EFI_FILE_CLOSE) (
332 struct _EFI_FILE_HANDLE *File);
334 typedef
335 EFI_STATUS
336 (EFIAPI *EFI_FILE_DELETE) (
337 struct _EFI_FILE_HANDLE *File);
339 typedef
340 EFI_STATUS
341 (EFIAPI *EFI_FILE_READ) (
342 struct _EFI_FILE_HANDLE *File,
343 UINTN *BufferSize,
344 VOID *Buffer);
346 typedef
347 EFI_STATUS
348 (EFIAPI *EFI_FILE_WRITE) (
349 struct _EFI_FILE_HANDLE *File,
350 UINTN *BufferSize,
351 VOID *Buffer);
353 typedef
354 EFI_STATUS
355 (EFIAPI *EFI_FILE_SET_POSITION) (
356 struct _EFI_FILE_HANDLE *File,
357 UINT64 Position);
359 typedef
360 EFI_STATUS
361 (EFIAPI *EFI_FILE_GET_POSITION) (
362 struct _EFI_FILE_HANDLE *File,
363 UINT64 *Position);
365 typedef
366 EFI_STATUS
367 (EFIAPI *EFI_FILE_GET_INFO) (
368 struct _EFI_FILE_HANDLE *File,
369 EFI_GUID *InformationType,
370 UINTN *BufferSize,
371 VOID *Buffer);
373 typedef
374 EFI_STATUS
375 (EFIAPI *EFI_FILE_SET_INFO) (
376 struct _EFI_FILE_HANDLE *File,
377 EFI_GUID *InformationType,
378 UINTN BufferSize,
379 VOID *Buffer);
381 typedef
382 EFI_STATUS
383 (EFIAPI *EFI_FILE_FLUSH) (
384 struct _EFI_FILE_HANDLE *File);
387 #define EFI_FILE_HANDLE_REVISION 0x00010000
389 typedef struct _EFI_FILE_HANDLE {
390 UINT64 Revision;
391 EFI_FILE_OPEN Open;
392 EFI_FILE_CLOSE Close;
393 EFI_FILE_DELETE Delete;
394 EFI_FILE_READ Read;
395 EFI_FILE_WRITE Write;
396 EFI_FILE_GET_POSITION GetPosition;
397 EFI_FILE_SET_POSITION SetPosition;
398 EFI_FILE_GET_INFO GetInfo;
399 EFI_FILE_SET_INFO SetInfo;
400 EFI_FILE_FLUSH Flush;
401 } EFI_FILE, *EFI_FILE_HANDLE;
405 * Loaded image protocol
407 #define LOADED_IMAGE_PROTOCOL \
408 { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
410 typedef
411 EFI_STATUS
412 (EFIAPI *EFI_IMAGE_ENTRY_POINT) (
413 EFI_HANDLE ImageHandle,
414 struct _EFI_SYSTEM_TABLE *SystemTable);
416 typedef
417 EFI_STATUS
418 (EFIAPI *EFI_IMAGE_LOAD) (
419 BOOLEAN BootPolicy,
420 EFI_HANDLE ParentImageHandle,
421 EFI_DEVICE_PATH *FilePath,
422 VOID *SourceBuffer,
423 UINTN SourceSize,
424 EFI_HANDLE *ImageHandle);
426 typedef
427 EFI_STATUS
428 (EFIAPI *EFI_IMAGE_START) (
429 EFI_HANDLE ImageHandle,
430 UINTN *ExitDataSize,
431 CHAR16 **ExitData);
433 typedef
434 EFI_STATUS
435 (EFIAPI *EFI_EXIT) (
436 EFI_HANDLE ImageHandle,
437 EFI_STATUS ExitStatus,
438 UINTN ExitDataSize,
439 CHAR16 *ExitData);
441 typedef
442 EFI_STATUS
443 (EFIAPI *EFI_IMAGE_UNLOAD) (
444 EFI_HANDLE ImageHandle);
447 #define EFI_IMAGE_INFORMATION_REVISION 0x1000
448 typedef struct {
449 UINT32 Revision;
450 EFI_HANDLE ParentHandle;
451 struct _EFI_SYSTEM_TABLE *SystemTable;
452 EFI_HANDLE DeviceHandle;
453 EFI_DEVICE_PATH *FilePath;
454 VOID *Reserved;
455 UINT32 LoadOptionsSize;
456 VOID *LoadOptions;
457 VOID *ImageBase;
458 UINT64 ImageSize;
459 EFI_MEMORY_TYPE ImageCodeType;
460 EFI_MEMORY_TYPE ImageDataType;
461 EFI_IMAGE_UNLOAD Unload;
463 } EFI_LOADED_IMAGE;
467 * EFI Memory
469 typedef
470 EFI_STATUS
471 (EFIAPI *EFI_ALLOCATE_PAGES) (
472 EFI_ALLOCATE_TYPE Type,
473 EFI_MEMORY_TYPE MemoryType,
474 UINTN NoPages,
475 EFI_PHYSICAL_ADDRESS *Memory);
477 typedef
478 EFI_STATUS
479 (EFIAPI *EFI_FREE_PAGES) (
480 EFI_PHYSICAL_ADDRESS Memory,
481 UINTN NoPages);
483 typedef
484 EFI_STATUS
485 (EFIAPI *EFI_GET_MEMORY_MAP) (
486 UINTN *MemoryMapSize,
487 EFI_MEMORY_DESCRIPTOR *MemoryMap,
488 UINTN *MapKey,
489 UINTN *DescriptorSize,
490 UINT32 *DescriptorVersion);
492 #define NextMemoryDescriptor(Ptr,Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) Ptr) + Size))
494 typedef
495 EFI_STATUS
496 (EFIAPI *EFI_ALLOCATE_POOL) (
497 EFI_MEMORY_TYPE PoolType,
498 UINTN Size,
499 VOID **Buffer);
501 typedef
502 EFI_STATUS
503 (EFIAPI *EFI_FREE_POOL) (
504 VOID *Buffer);
508 * Protocol handler functions
510 typedef enum {
511 EFI_NATIVE_INTERFACE,
512 EFI_PCODE_INTERFACE
513 } EFI_INTERFACE_TYPE;
515 typedef enum {
516 AllHandles,
517 ByRegisterNotify,
518 ByProtocol
519 } EFI_LOCATE_SEARCH_TYPE;
521 typedef
522 EFI_STATUS
523 (EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) (
524 EFI_HANDLE *Handle,
525 EFI_GUID *Protocol,
526 EFI_INTERFACE_TYPE InterfaceType,
527 VOID *Interface);
529 typedef
530 EFI_STATUS
531 (EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE) (
532 EFI_HANDLE Handle,
533 EFI_GUID *Protocol,
534 VOID *OldInterface,
535 VOID *NewInterface);
537 typedef
538 EFI_STATUS
539 (EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE) (
540 EFI_HANDLE Handle,
541 EFI_GUID *Protocol,
542 VOID *Interface);
544 typedef
545 EFI_STATUS
546 (EFIAPI *EFI_HANDLE_PROTOCOL) (
547 EFI_HANDLE Handle,
548 EFI_GUID *Protocol,
549 VOID **Interface);
551 typedef
552 EFI_STATUS
553 (EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) (
554 EFI_GUID *Protocol,
555 EFI_EVENT Event,
556 VOID **Registration);
558 typedef
559 EFI_STATUS
560 (EFIAPI *EFI_LOCATE_HANDLE) (
561 EFI_LOCATE_SEARCH_TYPE SearchType,
562 EFI_GUID *Protocol,
563 VOID *SearchKey,
564 UINTN *BufferSize,
565 EFI_HANDLE *Buffer);
567 typedef
568 EFI_STATUS
569 (EFIAPI *EFI_LOCATE_DEVICE_PATH) (
570 EFI_GUID *Protocol,
571 EFI_DEVICE_PATH **DevicePath,
572 EFI_HANDLE *Device);
574 typedef
575 EFI_STATUS
576 (EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) (
577 EFI_GUID *Guid,
578 VOID *Table);
580 #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
581 #define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
582 #define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
583 #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
584 #define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
585 #define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020
587 typedef
588 EFI_STATUS
589 (EFIAPI *EFI_OPEN_PROTOCOL) (
590 EFI_HANDLE Handle,
591 EFI_GUID *Protocol,
592 VOID **Interface,
593 EFI_HANDLE AgentHandle,
594 EFI_HANDLE ControllerHandle,
595 UINT32 Attributes);
597 typedef
598 EFI_STATUS
599 (EFIAPI *EFI_CLOSE_PROTOCOL) (
600 EFI_HANDLE Handle,
601 EFI_GUID *Protocol,
602 EFI_HANDLE AgentHandle,
603 EFI_HANDLE ControllerHandle);
605 typedef struct {
606 EFI_HANDLE AgentHandle;
607 EFI_HANDLE ControllerHandle;
608 UINT32 Attributes;
609 UINT32 OpenCount;
610 } EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
612 typedef
613 EFI_STATUS
614 (EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (
615 EFI_HANDLE Handle,
616 EFI_GUID *Protocol,
617 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
618 UINTN *EntryCount);
620 typedef
621 EFI_STATUS
622 (EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (
623 EFI_HANDLE Handle,
624 EFI_GUID ***ProtocolBuffer,
625 UINTN *ProtocolBufferCount);
627 typedef
628 EFI_STATUS
629 (EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (
630 EFI_LOCATE_SEARCH_TYPE SearchType,
631 EFI_GUID *Protocol,
632 VOID *SearchKey,
633 UINTN *NoHandles,
634 EFI_HANDLE **Buffer);
636 typedef
637 EFI_STATUS
638 (EFIAPI *EFI_LOCATE_PROTOCOL) (
639 EFI_GUID *Protocol,
640 VOID *Registration,
641 VOID **Interface);
643 typedef
644 EFI_STATUS
645 (EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
646 EFI_HANDLE *Handle,
647 ...);
649 typedef
650 EFI_STATUS
651 (EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
652 EFI_HANDLE Handle,
653 ...);
655 typedef
656 EFI_STATUS
657 (EFIAPI *EFI_CALCULATE_CRC32) (
658 VOID *Data,
659 UINTN DataSize,
660 UINT32 *Crc32);
662 typedef
663 VOID
664 (EFIAPI *EFI_COPY_MEM) (
665 VOID *Destination,
666 VOID *Source,
667 UINTN Length);
669 typedef
670 VOID
671 (EFIAPI *EFI_SET_MEM) (
672 VOID *Buffer,
673 UINTN Size,
674 UINT8 Value);
677 * EFI Boot Services Table
679 #define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42
680 #define EFI_BOOT_SERVICES_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
682 typedef struct _EFI_BOOT_SERVICES {
683 EFI_TABLE_HEADER Hdr;
685 #if 0
686 EFI_RAISE_TPL RaiseTPL;
687 EFI_RESTORE_TPL RestoreTPL;
688 #else
689 EFI_UNKNOWN_INTERFACE RaiseTPL;
690 EFI_UNKNOWN_INTERFACE RestoreTPL;
691 #endif
693 EFI_ALLOCATE_PAGES AllocatePages;
694 EFI_FREE_PAGES FreePages;
695 EFI_GET_MEMORY_MAP GetMemoryMap;
696 EFI_ALLOCATE_POOL AllocatePool;
697 EFI_FREE_POOL FreePool;
699 #if 0
700 EFI_CREATE_EVENT CreateEvent;
701 EFI_SET_TIMER SetTimer;
702 EFI_WAIT_FOR_EVENT WaitForEvent;
703 EFI_SIGNAL_EVENT SignalEvent;
704 EFI_CLOSE_EVENT CloseEvent;
705 EFI_CHECK_EVENT CheckEvent;
706 #else
707 EFI_UNKNOWN_INTERFACE CreateEvent;
708 EFI_UNKNOWN_INTERFACE SetTimer;
709 EFI_UNKNOWN_INTERFACE WaitForEvent;
710 EFI_UNKNOWN_INTERFACE SignalEvent;
711 EFI_UNKNOWN_INTERFACE CloseEvent;
712 EFI_UNKNOWN_INTERFACE CheckEvent;
713 #endif
715 EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;
716 EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
717 EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
718 EFI_HANDLE_PROTOCOL HandleProtocol;
719 EFI_HANDLE_PROTOCOL PCHandleProtocol;
720 EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;
721 EFI_LOCATE_HANDLE LocateHandle;
722 EFI_LOCATE_DEVICE_PATH LocateDevicePath;
723 EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
725 EFI_IMAGE_LOAD LoadImage;
726 EFI_IMAGE_START StartImage;
727 EFI_EXIT Exit;
728 EFI_IMAGE_UNLOAD UnloadImage;
730 #if 0
731 EFI_EXIT_BOOT_SERVICES ExitBootServices;
732 EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;
733 EFI_STALL Stall;
734 EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;
735 #else
736 EFI_UNKNOWN_INTERFACE ExitBootServices;
737 EFI_UNKNOWN_INTERFACE GetNextMonotonicCount;
738 EFI_UNKNOWN_INTERFACE Stall;
739 EFI_UNKNOWN_INTERFACE SetWatchdogTimer;
740 #endif
742 #if 0
743 EFI_CONNECT_CONTROLLER ConnectController;
744 EFI_DISCONNECT_CONTROLLER DisconnectController;
745 #else
746 EFI_UNKNOWN_INTERFACE ConnectController;
747 EFI_UNKNOWN_INTERFACE DisconnectController;
748 #endif
750 EFI_OPEN_PROTOCOL OpenProtocol;
751 EFI_CLOSE_PROTOCOL CloseProtocol;
752 EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation;
753 EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle;
754 EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer;
755 EFI_LOCATE_PROTOCOL LocateProtocol;
756 EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
757 EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;
759 EFI_CALCULATE_CRC32 CalculateCrc32;
761 EFI_COPY_MEM CopyMem;
762 EFI_SET_MEM SetMem;
764 #if 0
765 EFI_CREATE_EVENT_EX CreateEventEx;
766 #else
767 EFI_UNKNOWN_INTERFACE CreateEventEx;
768 #endif
769 } EFI_BOOT_SERVICES;
773 * EFI System Table
777 * EFI Configuration Table and GUID definitions
779 #define ACPI_TABLE_GUID \
780 { 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
781 #define ACPI_20_TABLE_GUID \
782 { 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} }
784 typedef struct _EFI_CONFIGURATION_TABLE {
785 EFI_GUID VendorGuid;
786 VOID *VendorTable;
787 } EFI_CONFIGURATION_TABLE;
790 #define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249
791 #define EFI_SYSTEM_TABLE_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
793 typedef struct _EFI_SYSTEM_TABLE {
794 EFI_TABLE_HEADER Hdr;
796 CHAR16 *FirmwareVendor;
797 UINT32 FirmwareRevision;
799 EFI_HANDLE ConsoleInHandle;
800 SIMPLE_INPUT_INTERFACE *ConIn;
802 EFI_HANDLE ConsoleOutHandle;
803 SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut;
805 EFI_HANDLE StandardErrorHandle;
806 SIMPLE_TEXT_OUTPUT_INTERFACE *StdErr;
808 #if 0
809 EFI_RUNTIME_SERVICES *RuntimeServices;
810 #else
811 EFI_HANDLE *RuntimeServices;
812 #endif
813 EFI_BOOT_SERVICES *BootServices;
815 UINTN NumberOfTableEntries;
816 EFI_CONFIGURATION_TABLE *ConfigurationTable;
818 } EFI_SYSTEM_TABLE;
821 /* GNU EFI definitions */
823 #if defined(_GNU_EFI)
826 * This is needed to hide platform specific code from ACPICA
828 UINT64
829 DivU64x32 (
830 UINT64 Dividend,
831 UINTN Divisor,
832 UINTN *Remainder);
835 * EFI specific prototypes
837 EFI_STATUS
838 efi_main (
839 EFI_HANDLE Image,
840 EFI_SYSTEM_TABLE *SystemTab);
843 acpi_main (
844 int argc,
845 char *argv[]);
848 #endif
850 extern EFI_GUID AcpiGbl_LoadedImageProtocol;
851 extern EFI_GUID AcpiGbl_TextInProtocol;
852 extern EFI_GUID AcpiGbl_TextOutProtocol;
853 extern EFI_GUID AcpiGbl_FileSystemProtocol;
855 #endif /* __ACEFIEX_H__ */