xref: /DragonStub/inc/efiprot.h (revision f5bb5112de133f8bbeac4585099ba76d16147565)
1530d68baSNigel Croxon #ifndef _EFI_PROT_H
2530d68baSNigel Croxon #define _EFI_PROT_H
3530d68baSNigel Croxon 
4530d68baSNigel Croxon /*++
5530d68baSNigel Croxon 
6530d68baSNigel Croxon Copyright (c) 1998  Intel Corporation
7530d68baSNigel Croxon 
8530d68baSNigel Croxon Module Name:
9530d68baSNigel Croxon 
10530d68baSNigel Croxon     efiprot.h
11530d68baSNigel Croxon 
12530d68baSNigel Croxon Abstract:
13530d68baSNigel Croxon 
14530d68baSNigel Croxon     EFI Protocols
15530d68baSNigel Croxon 
16530d68baSNigel Croxon 
17530d68baSNigel Croxon 
18530d68baSNigel Croxon Revision History
19530d68baSNigel Croxon 
20530d68baSNigel Croxon --*/
21530d68baSNigel Croxon 
22530d68baSNigel Croxon //
23530d68baSNigel Croxon //  FPSWA library protocol
24530d68baSNigel Croxon //
251b10394eSNigel Croxon #define EFI_FPSWA_PROTOCOL_GUID \
26530d68baSNigel Croxon     { 0xc41b6531, 0x97b9, 0x11d3, {0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
271b10394eSNigel Croxon #define FPSWA_PROTOCOL EFI_FPSWA_PROTOCOL_GUID
28530d68baSNigel Croxon 
29530d68baSNigel Croxon //
30530d68baSNigel Croxon // Device Path protocol
31530d68baSNigel Croxon //
32530d68baSNigel Croxon 
331b10394eSNigel Croxon #define EFI_DEVICE_PATH_PROTOCOL_GUID \
34530d68baSNigel Croxon     { 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
351b10394eSNigel Croxon #define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID
36530d68baSNigel Croxon 
37530d68baSNigel Croxon 
38530d68baSNigel Croxon //
39530d68baSNigel Croxon // Block IO protocol
40530d68baSNigel Croxon //
41530d68baSNigel Croxon 
421b10394eSNigel Croxon #define EFI_BLOCK_IO_PROTOCOL_GUID \
43530d68baSNigel Croxon     { 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
441b10394eSNigel Croxon #define BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL_GUID
45530d68baSNigel Croxon 
461b10394eSNigel Croxon #define EFI_BLOCK_IO_PROTOCOL_REVISION    0x00010000
471b10394eSNigel Croxon #define EFI_BLOCK_IO_PROTOCOL_REVISION2   0x00020001
481b10394eSNigel Croxon #define EFI_BLOCK_IO_PROTOCOL_REVISION3   ((2<<16) | 31)
491b10394eSNigel Croxon #define EFI_BLOCK_IO_INTERFACE_REVISION   EFI_BLOCK_IO_PROTOCOL_REVISION
501b10394eSNigel Croxon #define EFI_BLOCK_IO_INTERFACE_REVISION2  EFI_BLOCK_IO_PROTOCOL_REVISION2
511b10394eSNigel Croxon #define EFI_BLOCK_IO_INTERFACE_REVISION3  EFI_BLOCK_IO_PROTOCOL_REVISION3
521b10394eSNigel Croxon 
531b10394eSNigel Croxon INTERFACE_DECL(_EFI_BLOCK_IO_PROTOCOL);
54530d68baSNigel Croxon 
55530d68baSNigel Croxon typedef
56530d68baSNigel Croxon EFI_STATUS
57530d68baSNigel Croxon (EFIAPI *EFI_BLOCK_RESET) (
581b10394eSNigel Croxon     IN struct _EFI_BLOCK_IO_PROTOCOL  *This,
59530d68baSNigel Croxon     IN BOOLEAN                        ExtendedVerification
60530d68baSNigel Croxon     );
61530d68baSNigel Croxon 
62530d68baSNigel Croxon typedef
63530d68baSNigel Croxon EFI_STATUS
64530d68baSNigel Croxon (EFIAPI *EFI_BLOCK_READ) (
651b10394eSNigel Croxon     IN struct _EFI_BLOCK_IO_PROTOCOL  *This,
66530d68baSNigel Croxon     IN UINT32                         MediaId,
67530d68baSNigel Croxon     IN EFI_LBA                        LBA,
68530d68baSNigel Croxon     IN UINTN                          BufferSize,
69530d68baSNigel Croxon     OUT VOID                          *Buffer
70530d68baSNigel Croxon     );
71530d68baSNigel Croxon 
72530d68baSNigel Croxon 
73530d68baSNigel Croxon typedef
74530d68baSNigel Croxon EFI_STATUS
75530d68baSNigel Croxon (EFIAPI *EFI_BLOCK_WRITE) (
761b10394eSNigel Croxon     IN struct _EFI_BLOCK_IO_PROTOCOL  *This,
77530d68baSNigel Croxon     IN UINT32                         MediaId,
78530d68baSNigel Croxon     IN EFI_LBA                        LBA,
79530d68baSNigel Croxon     IN UINTN                          BufferSize,
80530d68baSNigel Croxon     IN VOID                           *Buffer
81530d68baSNigel Croxon     );
82530d68baSNigel Croxon 
83530d68baSNigel Croxon 
84530d68baSNigel Croxon typedef
85530d68baSNigel Croxon EFI_STATUS
86530d68baSNigel Croxon (EFIAPI *EFI_BLOCK_FLUSH) (
871b10394eSNigel Croxon     IN struct _EFI_BLOCK_IO_PROTOCOL  *This
88530d68baSNigel Croxon     );
89530d68baSNigel Croxon 
90530d68baSNigel Croxon 
91530d68baSNigel Croxon 
92530d68baSNigel Croxon typedef struct {
93530d68baSNigel Croxon     UINT32              MediaId;
94530d68baSNigel Croxon     BOOLEAN             RemovableMedia;
95530d68baSNigel Croxon     BOOLEAN             MediaPresent;
96530d68baSNigel Croxon 
97530d68baSNigel Croxon     BOOLEAN             LogicalPartition;
98530d68baSNigel Croxon     BOOLEAN             ReadOnly;
99530d68baSNigel Croxon     BOOLEAN             WriteCaching;
100530d68baSNigel Croxon 
101530d68baSNigel Croxon     UINT32              BlockSize;
102530d68baSNigel Croxon     UINT32              IoAlign;
103530d68baSNigel Croxon 
104530d68baSNigel Croxon     EFI_LBA             LastBlock;
105530d68baSNigel Croxon 
106530d68baSNigel Croxon     /* revision 2 */
107530d68baSNigel Croxon     EFI_LBA             LowestAlignedLba;
108530d68baSNigel Croxon     UINT32              LogicalBlocksPerPhysicalBlock;
109530d68baSNigel Croxon     /* revision 3 */
110530d68baSNigel Croxon     UINT32              OptimalTransferLengthGranularity;
111530d68baSNigel Croxon } EFI_BLOCK_IO_MEDIA;
112530d68baSNigel Croxon 
1131b10394eSNigel Croxon typedef struct _EFI_BLOCK_IO_PROTOCOL {
114530d68baSNigel Croxon     UINT64                  Revision;
115530d68baSNigel Croxon 
116530d68baSNigel Croxon     EFI_BLOCK_IO_MEDIA      *Media;
117530d68baSNigel Croxon 
118530d68baSNigel Croxon     EFI_BLOCK_RESET         Reset;
119530d68baSNigel Croxon     EFI_BLOCK_READ          ReadBlocks;
120530d68baSNigel Croxon     EFI_BLOCK_WRITE         WriteBlocks;
121530d68baSNigel Croxon     EFI_BLOCK_FLUSH         FlushBlocks;
122530d68baSNigel Croxon 
1231b10394eSNigel Croxon } EFI_BLOCK_IO_PROTOCOL;
124530d68baSNigel Croxon 
1251b10394eSNigel Croxon typedef struct _EFI_BLOCK_IO_PROTOCOL _EFI_BLOCK_IO;
1261b10394eSNigel Croxon typedef EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO;
127530d68baSNigel Croxon 
1287993cbccSNigel Croxon #define EFI_BLOCK_IO2_PROTOCOL_GUID \
1297993cbccSNigel Croxon     { 0xa77b2472, 0xe282, 0x4e9f, {0xa2, 0x45, 0xc2, 0xc0, 0xe2, 0x7b, 0xbc, 0xc1} }
1307993cbccSNigel Croxon 
1317993cbccSNigel Croxon INTERFACE_DECL(_EFI_BLOCK_IO2_PROTOCOL);
1327993cbccSNigel Croxon 
1337993cbccSNigel Croxon typedef struct {
1347993cbccSNigel Croxon     EFI_EVENT               Event;
1357993cbccSNigel Croxon     EFI_STATUS              TransactionStatus;
1367993cbccSNigel Croxon } EFI_BLOCK_IO2_TOKEN;
1377993cbccSNigel Croxon 
1387993cbccSNigel Croxon typedef
1397993cbccSNigel Croxon EFI_STATUS
1407993cbccSNigel Croxon (EFIAPI *EFI_BLOCK_RESET_EX) (
1417993cbccSNigel Croxon     IN struct _EFI_BLOCK_IO2_PROTOCOL  *This,
1427993cbccSNigel Croxon     IN BOOLEAN                         ExtendedVerification
1437993cbccSNigel Croxon     );
1447993cbccSNigel Croxon 
1457993cbccSNigel Croxon typedef
1467993cbccSNigel Croxon EFI_STATUS
1477993cbccSNigel Croxon (EFIAPI *EFI_BLOCK_READ_EX) (
1487993cbccSNigel Croxon     IN struct _EFI_BLOCK_IO2_PROTOCOL  *This,
1497993cbccSNigel Croxon     IN UINT32                          MediaId,
1507993cbccSNigel Croxon     IN EFI_LBA                         LBA,
1517993cbccSNigel Croxon     IN OUT EFI_BLOCK_IO2_TOKEN         *Token,
1527993cbccSNigel Croxon     IN UINTN                           BufferSize,
1537993cbccSNigel Croxon     OUT VOID                           *Buffer
1547993cbccSNigel Croxon     );
1557993cbccSNigel Croxon 
1567993cbccSNigel Croxon typedef
1577993cbccSNigel Croxon EFI_STATUS
1587993cbccSNigel Croxon (EFIAPI *EFI_BLOCK_WRITE_EX) (
1597993cbccSNigel Croxon     IN struct _EFI_BLOCK_IO2_PROTOCOL  *This,
1607993cbccSNigel Croxon     IN UINT32                          MediaId,
1617993cbccSNigel Croxon     IN EFI_LBA                         LBA,
1627993cbccSNigel Croxon     IN OUT EFI_BLOCK_IO2_TOKEN         *Token,
1637993cbccSNigel Croxon     IN UINTN                           BufferSize,
1647993cbccSNigel Croxon     IN VOID                            *Buffer
1657993cbccSNigel Croxon     );
1667993cbccSNigel Croxon 
1677993cbccSNigel Croxon typedef
1687993cbccSNigel Croxon EFI_STATUS
1697993cbccSNigel Croxon (EFIAPI *EFI_BLOCK_FLUSH_EX) (
1707993cbccSNigel Croxon     IN struct _EFI_BLOCK_IO2_PROTOCOL  *This,
1717993cbccSNigel Croxon     IN OUT EFI_BLOCK_IO2_TOKEN         *Token
1727993cbccSNigel Croxon     );
1737993cbccSNigel Croxon 
1747993cbccSNigel Croxon typedef struct _EFI_BLOCK_IO2_PROTOCOL {
1757993cbccSNigel Croxon     EFI_BLOCK_IO_MEDIA  *Media;
1767993cbccSNigel Croxon     EFI_BLOCK_RESET_EX  Reset;
1777993cbccSNigel Croxon     EFI_BLOCK_READ_EX   ReadBlocksEx;
1787993cbccSNigel Croxon     EFI_BLOCK_WRITE_EX  WriteBlocksEx;
1797993cbccSNigel Croxon     EFI_BLOCK_FLUSH_EX  FlushBlocksEx;
1807993cbccSNigel Croxon } EFI_BLOCK_IO2_PROTOCOL;
181530d68baSNigel Croxon 
182530d68baSNigel Croxon //
183530d68baSNigel Croxon // Disk Block IO protocol
184530d68baSNigel Croxon //
185530d68baSNigel Croxon 
1861b10394eSNigel Croxon #define EFI_DISK_IO_PROTOCOL_GUID \
187530d68baSNigel Croxon     { 0xce345171, 0xba0b, 0x11d2,  {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
1881b10394eSNigel Croxon #define DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL_GUID
189530d68baSNigel Croxon 
1901b10394eSNigel Croxon #define EFI_DISK_IO_PROTOCOL_REVISION  0x00010000
1911b10394eSNigel Croxon #define EFI_DISK_IO_INTERFACE_REVISION EFI_DISK_IO_PROTOCOL_REVISION
1921b10394eSNigel Croxon 
1931b10394eSNigel Croxon INTERFACE_DECL(_EFI_DISK_IO_PROTOCOL);
194530d68baSNigel Croxon 
195530d68baSNigel Croxon typedef
196530d68baSNigel Croxon EFI_STATUS
197530d68baSNigel Croxon (EFIAPI *EFI_DISK_READ) (
1981b10394eSNigel Croxon     IN struct _EFI_DISK_IO_PROTOCOL  *This,
199530d68baSNigel Croxon     IN UINT32                        MediaId,
200530d68baSNigel Croxon     IN UINT64                        Offset,
201530d68baSNigel Croxon     IN UINTN                         BufferSize,
202530d68baSNigel Croxon     OUT VOID                         *Buffer
203530d68baSNigel Croxon     );
204530d68baSNigel Croxon 
205530d68baSNigel Croxon 
206530d68baSNigel Croxon typedef
207530d68baSNigel Croxon EFI_STATUS
208530d68baSNigel Croxon (EFIAPI *EFI_DISK_WRITE) (
2091b10394eSNigel Croxon     IN struct _EFI_DISK_IO_PROTOCOL  *This,
210530d68baSNigel Croxon     IN UINT32                        MediaId,
211530d68baSNigel Croxon     IN UINT64                        Offset,
212530d68baSNigel Croxon     IN UINTN                         BufferSize,
213530d68baSNigel Croxon     IN VOID                          *Buffer
214530d68baSNigel Croxon     );
215530d68baSNigel Croxon 
216530d68baSNigel Croxon 
2171b10394eSNigel Croxon typedef struct _EFI_DISK_IO_PROTOCOL {
218530d68baSNigel Croxon     UINT64              Revision;
219530d68baSNigel Croxon     EFI_DISK_READ       ReadDisk;
220530d68baSNigel Croxon     EFI_DISK_WRITE      WriteDisk;
2211b10394eSNigel Croxon } EFI_DISK_IO_PROTOCOL;
222530d68baSNigel Croxon 
2231b10394eSNigel Croxon typedef struct _EFI_DISK_IO_PROTOCOL _EFI_DISK_IO;
2241b10394eSNigel Croxon typedef EFI_DISK_IO_PROTOCOL EFI_DISK_IO;
225530d68baSNigel Croxon 
2267993cbccSNigel Croxon 
2277993cbccSNigel Croxon #define EFI_DISK_IO2_PROTOCOL_GUID \
2287993cbccSNigel Croxon     { 0x151c8eae, 0x7f2c, 0x472c,  {0x9e, 0x54, 0x98, 0x28, 0x19, 0x4f, 0x6a, 0x88} }
2297993cbccSNigel Croxon 
2307993cbccSNigel Croxon #define EFI_DISK_IO2_PROTOCOL_REVISION  0x00020000
2317993cbccSNigel Croxon 
2327993cbccSNigel Croxon INTERFACE_DECL(_EFI_DISK_IO2_PROTOCOL);
2337993cbccSNigel Croxon 
2347993cbccSNigel Croxon typedef struct {
2357993cbccSNigel Croxon     EFI_EVENT  Event;
2367993cbccSNigel Croxon     EFI_STATUS TransactionStatus;
2377993cbccSNigel Croxon } EFI_DISK_IO2_TOKEN;
2387993cbccSNigel Croxon 
2397993cbccSNigel Croxon typedef
2407993cbccSNigel Croxon EFI_STATUS
2417993cbccSNigel Croxon (EFIAPI *EFI_DISK_CANCEL_EX) (
2427993cbccSNigel Croxon     IN struct _EFI_DISK_IO2_PROTOCOL  *This
2437993cbccSNigel Croxon     );
2447993cbccSNigel Croxon 
2457993cbccSNigel Croxon typedef
2467993cbccSNigel Croxon EFI_STATUS
2477993cbccSNigel Croxon (EFIAPI *EFI_DISK_READ_EX) (
2487993cbccSNigel Croxon     IN struct _EFI_DISK_IO2_PROTOCOL  *This,
2497993cbccSNigel Croxon     IN UINT32                         MediaId,
2507993cbccSNigel Croxon     IN UINT64                         Offset,
2517993cbccSNigel Croxon     IN OUT EFI_DISK_IO2_TOKEN         *Token,
2527993cbccSNigel Croxon     IN UINTN                          BufferSize,
2537993cbccSNigel Croxon     OUT VOID                          *Buffer
2547993cbccSNigel Croxon     );
2557993cbccSNigel Croxon 
2567993cbccSNigel Croxon typedef
2577993cbccSNigel Croxon EFI_STATUS
2587993cbccSNigel Croxon (EFIAPI *EFI_DISK_WRITE_EX) (
2597993cbccSNigel Croxon     IN struct _EFI_DISK_IO2_PROTOCOL  *This,
2607993cbccSNigel Croxon     IN UINT32                         MediaId,
2617993cbccSNigel Croxon     IN UINT64                         Offset,
2627993cbccSNigel Croxon     IN OUT EFI_DISK_IO2_TOKEN         *Token,
2637993cbccSNigel Croxon     IN UINTN                          BufferSize,
2647993cbccSNigel Croxon     IN VOID                           *Buffer
2657993cbccSNigel Croxon     );
2667993cbccSNigel Croxon 
2677993cbccSNigel Croxon typedef
2687993cbccSNigel Croxon EFI_STATUS
2697993cbccSNigel Croxon (EFIAPI *EFI_DISK_FLUSH_EX) (
2707993cbccSNigel Croxon     IN struct _EFI_DISK_IO2_PROTOCOL  *This,
2717993cbccSNigel Croxon     IN OUT EFI_DISK_IO2_TOKEN         *Token
2727993cbccSNigel Croxon     );
2737993cbccSNigel Croxon 
2747993cbccSNigel Croxon typedef struct _EFI_DISK_IO2_PROTOCOL {
2757993cbccSNigel Croxon     UINT64                            Revision;
2767993cbccSNigel Croxon     EFI_DISK_CANCEL_EX                Cancel;
2777993cbccSNigel Croxon     EFI_DISK_READ_EX                  ReadDiskEx;
2787993cbccSNigel Croxon     EFI_DISK_WRITE_EX                 WriteDiskEx;
2797993cbccSNigel Croxon     EFI_DISK_FLUSH_EX                 FlushDiskEx;
2807993cbccSNigel Croxon } EFI_DISK_IO2_PROTOCOL;
2817993cbccSNigel Croxon 
282530d68baSNigel Croxon //
283530d68baSNigel Croxon // Simple file system protocol
284530d68baSNigel Croxon //
285530d68baSNigel Croxon 
2861b10394eSNigel Croxon #define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
287530d68baSNigel Croxon     { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
2881b10394eSNigel Croxon #define SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID
289530d68baSNigel Croxon 
2901b10394eSNigel Croxon INTERFACE_DECL(_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL);
291530d68baSNigel Croxon INTERFACE_DECL(_EFI_FILE_HANDLE);
292530d68baSNigel Croxon 
293530d68baSNigel Croxon typedef
294530d68baSNigel Croxon EFI_STATUS
295530d68baSNigel Croxon (EFIAPI *EFI_VOLUME_OPEN) (
2961b10394eSNigel Croxon     IN struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL    *This,
297530d68baSNigel Croxon     OUT struct _EFI_FILE_HANDLE                   **Root
298530d68baSNigel Croxon     );
299530d68baSNigel Croxon 
3001b10394eSNigel Croxon #define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION  0x00010000
3011b10394eSNigel Croxon #define EFI_FILE_IO_INTERFACE_REVISION EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION
302530d68baSNigel Croxon 
3031b10394eSNigel Croxon typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
304530d68baSNigel Croxon     UINT64                  Revision;
305530d68baSNigel Croxon     EFI_VOLUME_OPEN         OpenVolume;
3061b10394eSNigel Croxon } EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
3071b10394eSNigel Croxon 
3081b10394eSNigel Croxon typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL _EFI_FILE_IO_INTERFACE;
3091b10394eSNigel Croxon typedef EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_FILE_IO_INTERFACE;
310530d68baSNigel Croxon 
311530d68baSNigel Croxon //
312530d68baSNigel Croxon //
313530d68baSNigel Croxon //
314530d68baSNigel Croxon 
315530d68baSNigel Croxon typedef
316530d68baSNigel Croxon EFI_STATUS
317530d68baSNigel Croxon (EFIAPI *EFI_FILE_OPEN) (
318530d68baSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File,
319530d68baSNigel Croxon     OUT struct _EFI_FILE_HANDLE **NewHandle,
320530d68baSNigel Croxon     IN CHAR16                   *FileName,
321530d68baSNigel Croxon     IN UINT64                   OpenMode,
322530d68baSNigel Croxon     IN UINT64                   Attributes
323530d68baSNigel Croxon     );
324530d68baSNigel Croxon 
325530d68baSNigel Croxon // Open modes
326530d68baSNigel Croxon #define EFI_FILE_MODE_READ      0x0000000000000001
327530d68baSNigel Croxon #define EFI_FILE_MODE_WRITE     0x0000000000000002
328530d68baSNigel Croxon #define EFI_FILE_MODE_CREATE    0x8000000000000000
329530d68baSNigel Croxon 
330530d68baSNigel Croxon // File attributes
331530d68baSNigel Croxon #define EFI_FILE_READ_ONLY      0x0000000000000001
332530d68baSNigel Croxon #define EFI_FILE_HIDDEN         0x0000000000000002
333530d68baSNigel Croxon #define EFI_FILE_SYSTEM         0x0000000000000004
334530d68baSNigel Croxon #define EFI_FILE_RESERVIED      0x0000000000000008
335530d68baSNigel Croxon #define EFI_FILE_DIRECTORY      0x0000000000000010
336530d68baSNigel Croxon #define EFI_FILE_ARCHIVE        0x0000000000000020
337530d68baSNigel Croxon #define EFI_FILE_VALID_ATTR     0x0000000000000037
338530d68baSNigel Croxon 
339530d68baSNigel Croxon typedef
340530d68baSNigel Croxon EFI_STATUS
341530d68baSNigel Croxon (EFIAPI *EFI_FILE_CLOSE) (
342530d68baSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File
343530d68baSNigel Croxon     );
344530d68baSNigel Croxon 
345530d68baSNigel Croxon typedef
346530d68baSNigel Croxon EFI_STATUS
347530d68baSNigel Croxon (EFIAPI *EFI_FILE_DELETE) (
348530d68baSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File
349530d68baSNigel Croxon     );
350530d68baSNigel Croxon 
351530d68baSNigel Croxon typedef
352530d68baSNigel Croxon EFI_STATUS
353530d68baSNigel Croxon (EFIAPI *EFI_FILE_READ) (
354530d68baSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File,
355530d68baSNigel Croxon     IN OUT UINTN                *BufferSize,
356530d68baSNigel Croxon     OUT VOID                    *Buffer
357530d68baSNigel Croxon     );
358530d68baSNigel Croxon 
359530d68baSNigel Croxon typedef
360530d68baSNigel Croxon EFI_STATUS
361530d68baSNigel Croxon (EFIAPI *EFI_FILE_WRITE) (
362530d68baSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File,
363530d68baSNigel Croxon     IN OUT UINTN                *BufferSize,
364530d68baSNigel Croxon     IN VOID                     *Buffer
365530d68baSNigel Croxon     );
366530d68baSNigel Croxon 
367530d68baSNigel Croxon typedef
368530d68baSNigel Croxon EFI_STATUS
369530d68baSNigel Croxon (EFIAPI *EFI_FILE_SET_POSITION) (
370530d68baSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File,
371530d68baSNigel Croxon     IN UINT64                   Position
372530d68baSNigel Croxon     );
373530d68baSNigel Croxon 
374530d68baSNigel Croxon typedef
375530d68baSNigel Croxon EFI_STATUS
376530d68baSNigel Croxon (EFIAPI *EFI_FILE_GET_POSITION) (
377530d68baSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File,
378530d68baSNigel Croxon     OUT UINT64                  *Position
379530d68baSNigel Croxon     );
380530d68baSNigel Croxon 
381530d68baSNigel Croxon typedef
382530d68baSNigel Croxon EFI_STATUS
383530d68baSNigel Croxon (EFIAPI *EFI_FILE_GET_INFO) (
384530d68baSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File,
385530d68baSNigel Croxon     IN EFI_GUID                 *InformationType,
386530d68baSNigel Croxon     IN OUT UINTN                *BufferSize,
387530d68baSNigel Croxon     OUT VOID                    *Buffer
388530d68baSNigel Croxon     );
389530d68baSNigel Croxon 
390530d68baSNigel Croxon typedef
391530d68baSNigel Croxon EFI_STATUS
392530d68baSNigel Croxon (EFIAPI *EFI_FILE_SET_INFO) (
393530d68baSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File,
394530d68baSNigel Croxon     IN EFI_GUID                 *InformationType,
395530d68baSNigel Croxon     IN UINTN                    BufferSize,
396530d68baSNigel Croxon     IN VOID                     *Buffer
397530d68baSNigel Croxon     );
398530d68baSNigel Croxon 
399530d68baSNigel Croxon typedef
400530d68baSNigel Croxon EFI_STATUS
401530d68baSNigel Croxon (EFIAPI *EFI_FILE_FLUSH) (
402530d68baSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File
403530d68baSNigel Croxon     );
404530d68baSNigel Croxon 
4057993cbccSNigel Croxon typedef struct {
4067993cbccSNigel Croxon     EFI_EVENT       Event;
4077993cbccSNigel Croxon     EFI_STATUS      Status;
4087993cbccSNigel Croxon     UINTN           BufferSize;
4097993cbccSNigel Croxon     VOID            *Buffer;
4107993cbccSNigel Croxon } EFI_FILE_IO_TOKEN;
411530d68baSNigel Croxon 
4127993cbccSNigel Croxon typedef
4137993cbccSNigel Croxon EFI_STATUS
4147993cbccSNigel Croxon (EFIAPI *EFI_FILE_OPEN_EX)(
4157993cbccSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File,
4167993cbccSNigel Croxon     OUT struct _EFI_FILE_HANDLE **NewHandle,
4177993cbccSNigel Croxon     IN CHAR16                   *FileName,
4187993cbccSNigel Croxon     IN UINT64                   OpenMode,
4197993cbccSNigel Croxon     IN UINT64                   Attributes,
4207993cbccSNigel Croxon     IN OUT EFI_FILE_IO_TOKEN    *Token
4217993cbccSNigel Croxon     );
422530d68baSNigel Croxon 
4237993cbccSNigel Croxon typedef
4247993cbccSNigel Croxon EFI_STATUS
4257993cbccSNigel Croxon (EFIAPI *EFI_FILE_READ_EX) (
4267993cbccSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File,
4277993cbccSNigel Croxon     IN OUT EFI_FILE_IO_TOKEN    *Token
4287993cbccSNigel Croxon     );
4297993cbccSNigel Croxon 
4307993cbccSNigel Croxon typedef
4317993cbccSNigel Croxon EFI_STATUS
4327993cbccSNigel Croxon (EFIAPI *EFI_FILE_WRITE_EX) (
4337993cbccSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File,
4347993cbccSNigel Croxon     IN OUT EFI_FILE_IO_TOKEN    *Token
4357993cbccSNigel Croxon     );
4367993cbccSNigel Croxon 
4377993cbccSNigel Croxon typedef
4387993cbccSNigel Croxon EFI_STATUS
4397993cbccSNigel Croxon (EFIAPI *EFI_FILE_FLUSH_EX) (
4407993cbccSNigel Croxon     IN struct _EFI_FILE_HANDLE  *File,
4417993cbccSNigel Croxon     IN OUT EFI_FILE_IO_TOKEN    *Token
4427993cbccSNigel Croxon     );
4437993cbccSNigel Croxon 
4447993cbccSNigel Croxon #define EFI_FILE_PROTOCOL_REVISION         0x00010000
4457993cbccSNigel Croxon #define EFI_FILE_PROTOCOL_REVISION2        0x00020000
4467993cbccSNigel Croxon #define EFI_FILE_PROTOCOL_LATEST_REVISION  EFI_FILE_PROTOCOL_REVISION2
4477993cbccSNigel Croxon #define EFI_FILE_HANDLE_REVISION           EFI_FILE_PROTOCOL_REVISION
4487993cbccSNigel Croxon 
449530d68baSNigel Croxon typedef struct _EFI_FILE_HANDLE {
450530d68baSNigel Croxon     UINT64                  Revision;
451530d68baSNigel Croxon     EFI_FILE_OPEN           Open;
452530d68baSNigel Croxon     EFI_FILE_CLOSE          Close;
453530d68baSNigel Croxon     EFI_FILE_DELETE         Delete;
454530d68baSNigel Croxon     EFI_FILE_READ           Read;
455530d68baSNigel Croxon     EFI_FILE_WRITE          Write;
456530d68baSNigel Croxon     EFI_FILE_GET_POSITION   GetPosition;
457530d68baSNigel Croxon     EFI_FILE_SET_POSITION   SetPosition;
458530d68baSNigel Croxon     EFI_FILE_GET_INFO       GetInfo;
459530d68baSNigel Croxon     EFI_FILE_SET_INFO       SetInfo;
460530d68baSNigel Croxon     EFI_FILE_FLUSH          Flush;
4617993cbccSNigel Croxon     EFI_FILE_OPEN_EX        OpenEx;
4627993cbccSNigel Croxon     EFI_FILE_READ_EX        ReadEx;
4637993cbccSNigel Croxon     EFI_FILE_WRITE_EX       WriteEx;
4647993cbccSNigel Croxon     EFI_FILE_FLUSH_EX       FlushEx;
4657993cbccSNigel Croxon } EFI_FILE_PROTOCOL, *EFI_FILE_HANDLE;
4667993cbccSNigel Croxon 
4677993cbccSNigel Croxon typedef EFI_FILE_PROTOCOL EFI_FILE;
468530d68baSNigel Croxon 
469530d68baSNigel Croxon 
470530d68baSNigel Croxon //
471530d68baSNigel Croxon // File information types
472530d68baSNigel Croxon //
473530d68baSNigel Croxon 
474530d68baSNigel Croxon #define EFI_FILE_INFO_ID   \
475530d68baSNigel Croxon     { 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
476530d68baSNigel Croxon 
477530d68baSNigel Croxon typedef struct {
478530d68baSNigel Croxon     UINT64                  Size;
479530d68baSNigel Croxon     UINT64                  FileSize;
480530d68baSNigel Croxon     UINT64                  PhysicalSize;
481530d68baSNigel Croxon     EFI_TIME                CreateTime;
482530d68baSNigel Croxon     EFI_TIME                LastAccessTime;
483530d68baSNigel Croxon     EFI_TIME                ModificationTime;
484530d68baSNigel Croxon     UINT64                  Attribute;
485530d68baSNigel Croxon     CHAR16                  FileName[1];
486530d68baSNigel Croxon } EFI_FILE_INFO;
487530d68baSNigel Croxon 
488530d68baSNigel Croxon //
489530d68baSNigel Croxon // The FileName field of the EFI_FILE_INFO data structure is variable length.
490530d68baSNigel Croxon // Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
491530d68baSNigel Croxon // be the size of the data structure without the FileName field.  The following macro
492530d68baSNigel Croxon // computes this size correctly no matter how big the FileName array is declared.
493530d68baSNigel Croxon // This is required to make the EFI_FILE_INFO data structure ANSI compilant.
494530d68baSNigel Croxon //
495530d68baSNigel Croxon 
496530d68baSNigel Croxon #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
497530d68baSNigel Croxon 
498530d68baSNigel Croxon #define EFI_FILE_SYSTEM_INFO_ID    \
499530d68baSNigel Croxon     { 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
500530d68baSNigel Croxon 
501530d68baSNigel Croxon typedef struct {
502530d68baSNigel Croxon     UINT64                  Size;
503530d68baSNigel Croxon     BOOLEAN                 ReadOnly;
504530d68baSNigel Croxon     UINT64                  VolumeSize;
505530d68baSNigel Croxon     UINT64                  FreeSpace;
506530d68baSNigel Croxon     UINT32                  BlockSize;
507530d68baSNigel Croxon     CHAR16                  VolumeLabel[1];
508530d68baSNigel Croxon } EFI_FILE_SYSTEM_INFO;
509530d68baSNigel Croxon 
510530d68baSNigel Croxon //
511530d68baSNigel Croxon // The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
512530d68baSNigel Croxon // Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
513530d68baSNigel Croxon // to be the size of the data structure without the VolumeLable field.  The following macro
514530d68baSNigel Croxon // computes this size correctly no matter how big the VolumeLable array is declared.
515530d68baSNigel Croxon // This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
516530d68baSNigel Croxon //
517530d68baSNigel Croxon 
518530d68baSNigel Croxon #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
519530d68baSNigel Croxon 
52024585953SPete Batard #define EFI_FILE_SYSTEM_VOLUME_LABEL_ID    \
521530d68baSNigel Croxon     { 0xDB47D7D3,0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }
522530d68baSNigel Croxon 
523530d68baSNigel Croxon typedef struct {
524530d68baSNigel Croxon     CHAR16                  VolumeLabel[1];
52524585953SPete Batard } EFI_FILE_SYSTEM_VOLUME_LABEL;
526530d68baSNigel Croxon 
52724585953SPete Batard #define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL,VolumeLabel)
52824585953SPete Batard 
52924585953SPete Batard //
53024585953SPete Batard // For compatibility with older versions of gnu-efi
53124585953SPete Batard //
53224585953SPete Batard #define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID EFI_FILE_SYSTEM_VOLUME_LABEL_ID
53324585953SPete Batard #define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO    EFI_FILE_SYSTEM_VOLUME_LABEL
534530d68baSNigel Croxon 
535530d68baSNigel Croxon //
536530d68baSNigel Croxon // Load file protocol
537530d68baSNigel Croxon //
538530d68baSNigel Croxon 
539530d68baSNigel Croxon 
5401b10394eSNigel Croxon #define EFI_LOAD_FILE_PROTOCOL_GUID \
541530d68baSNigel Croxon     { 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
5421b10394eSNigel Croxon #define LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL_GUID
543530d68baSNigel Croxon 
5441b10394eSNigel Croxon INTERFACE_DECL(_EFI_LOAD_FILE_PROTOCOL);
545530d68baSNigel Croxon 
546530d68baSNigel Croxon typedef
547530d68baSNigel Croxon EFI_STATUS
548530d68baSNigel Croxon (EFIAPI *EFI_LOAD_FILE) (
5491b10394eSNigel Croxon     IN struct _EFI_LOAD_FILE_PROTOCOL  *This,
550530d68baSNigel Croxon     IN EFI_DEVICE_PATH                  *FilePath,
551530d68baSNigel Croxon     IN BOOLEAN                          BootPolicy,
552530d68baSNigel Croxon     IN OUT UINTN                        *BufferSize,
553530d68baSNigel Croxon     IN VOID                             *Buffer OPTIONAL
554530d68baSNigel Croxon     );
555530d68baSNigel Croxon 
5561b10394eSNigel Croxon typedef struct _EFI_LOAD_FILE_PROTOCOL {
557530d68baSNigel Croxon     EFI_LOAD_FILE                       LoadFile;
5581b10394eSNigel Croxon } EFI_LOAD_FILE_PROTOCOL;
559530d68baSNigel Croxon 
5601b10394eSNigel Croxon typedef struct _EFI_LOAD_FILE_PROTOCOL _EFI_LOAD_FILE_INTERFACE;
5611b10394eSNigel Croxon typedef EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_INTERFACE;
562530d68baSNigel Croxon 
563530d68baSNigel Croxon //
564530d68baSNigel Croxon // Device IO protocol
565530d68baSNigel Croxon //
566530d68baSNigel Croxon 
5671b10394eSNigel Croxon #define EFI_DEVICE_IO_PROTOCOL_GUID \
568530d68baSNigel Croxon     { 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
5691b10394eSNigel Croxon #define DEVICE_IO_PROTOCOL EFI_DEVICE_IO_PROTOCOL_GUID
570530d68baSNigel Croxon 
5711b10394eSNigel Croxon INTERFACE_DECL(_EFI_DEVICE_IO_PROTOCOL);
572530d68baSNigel Croxon 
573530d68baSNigel Croxon typedef enum {
574530d68baSNigel Croxon     IO_UINT8,
575530d68baSNigel Croxon     IO_UINT16,
576530d68baSNigel Croxon     IO_UINT32,
577530d68baSNigel Croxon     IO_UINT64,
578530d68baSNigel Croxon //
579530d68baSNigel Croxon // Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to MMIO
580530d68baSNigel Croxon //
581530d68baSNigel Croxon     MMIO_COPY_UINT8,
582530d68baSNigel Croxon     MMIO_COPY_UINT16,
583530d68baSNigel Croxon     MMIO_COPY_UINT32,
584530d68baSNigel Croxon     MMIO_COPY_UINT64
585530d68baSNigel Croxon } EFI_IO_WIDTH;
586530d68baSNigel Croxon 
587530d68baSNigel Croxon #define EFI_PCI_ADDRESS(_bus,_dev,_func) \
588530d68baSNigel Croxon     ( (UINT64) ( (((UINTN)_bus) << 24) + (((UINTN)_dev) << 16) + (((UINTN)_func) << 8) ) )
589530d68baSNigel Croxon 
590530d68baSNigel Croxon 
591530d68baSNigel Croxon typedef
592530d68baSNigel Croxon EFI_STATUS
593530d68baSNigel Croxon (EFIAPI *EFI_DEVICE_IO) (
5941b10394eSNigel Croxon     IN struct _EFI_DEVICE_IO_PROTOCOL *This,
595530d68baSNigel Croxon     IN EFI_IO_WIDTH                 Width,
596530d68baSNigel Croxon     IN UINT64                       Address,
597530d68baSNigel Croxon     IN UINTN                        Count,
598530d68baSNigel Croxon     IN OUT VOID                     *Buffer
599530d68baSNigel Croxon     );
600530d68baSNigel Croxon 
601530d68baSNigel Croxon typedef struct {
602530d68baSNigel Croxon     EFI_DEVICE_IO                   Read;
603530d68baSNigel Croxon     EFI_DEVICE_IO                   Write;
604530d68baSNigel Croxon } EFI_IO_ACCESS;
605530d68baSNigel Croxon 
606530d68baSNigel Croxon typedef
607530d68baSNigel Croxon EFI_STATUS
608530d68baSNigel Croxon (EFIAPI *EFI_PCI_DEVICE_PATH) (
6091b10394eSNigel Croxon     IN struct _EFI_DEVICE_IO_PROTOCOL   *This,
610530d68baSNigel Croxon     IN UINT64                           Address,
611530d68baSNigel Croxon     IN OUT EFI_DEVICE_PATH              **PciDevicePath
612530d68baSNigel Croxon     );
613530d68baSNigel Croxon 
614530d68baSNigel Croxon typedef enum {
615530d68baSNigel Croxon     EfiBusMasterRead,
616530d68baSNigel Croxon     EfiBusMasterWrite,
617530d68baSNigel Croxon     EfiBusMasterCommonBuffer
618530d68baSNigel Croxon } EFI_IO_OPERATION_TYPE;
619530d68baSNigel Croxon 
620530d68baSNigel Croxon typedef
621530d68baSNigel Croxon EFI_STATUS
622530d68baSNigel Croxon (EFIAPI *EFI_IO_MAP) (
6231b10394eSNigel Croxon     IN struct _EFI_DEVICE_IO_PROTOCOL   *This,
624530d68baSNigel Croxon     IN EFI_IO_OPERATION_TYPE            Operation,
625530d68baSNigel Croxon     IN EFI_PHYSICAL_ADDRESS             *HostAddress,
626530d68baSNigel Croxon     IN OUT UINTN                        *NumberOfBytes,
627530d68baSNigel Croxon     OUT EFI_PHYSICAL_ADDRESS            *DeviceAddress,
628530d68baSNigel Croxon     OUT VOID                            **Mapping
629530d68baSNigel Croxon     );
630530d68baSNigel Croxon 
631530d68baSNigel Croxon typedef
632530d68baSNigel Croxon EFI_STATUS
633530d68baSNigel Croxon (EFIAPI *EFI_IO_UNMAP) (
6341b10394eSNigel Croxon     IN struct _EFI_DEVICE_IO_PROTOCOL   *This,
635530d68baSNigel Croxon     IN VOID                             *Mapping
636530d68baSNigel Croxon     );
637530d68baSNigel Croxon 
638530d68baSNigel Croxon typedef
639530d68baSNigel Croxon EFI_STATUS
640530d68baSNigel Croxon (EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
6411b10394eSNigel Croxon     IN struct _EFI_DEVICE_IO_PROTOCOL   *This,
642530d68baSNigel Croxon     IN EFI_ALLOCATE_TYPE                Type,
643530d68baSNigel Croxon     IN EFI_MEMORY_TYPE                  MemoryType,
644530d68baSNigel Croxon     IN UINTN                            Pages,
645530d68baSNigel Croxon     IN OUT EFI_PHYSICAL_ADDRESS         *HostAddress
646530d68baSNigel Croxon     );
647530d68baSNigel Croxon 
648530d68baSNigel Croxon typedef
649530d68baSNigel Croxon EFI_STATUS
650530d68baSNigel Croxon (EFIAPI *EFI_IO_FLUSH) (
6511b10394eSNigel Croxon     IN struct _EFI_DEVICE_IO_PROTOCOL   *This
652530d68baSNigel Croxon     );
653530d68baSNigel Croxon 
654530d68baSNigel Croxon typedef
655530d68baSNigel Croxon EFI_STATUS
656530d68baSNigel Croxon (EFIAPI *EFI_IO_FREE_BUFFER) (
6571b10394eSNigel Croxon     IN struct _EFI_DEVICE_IO_PROTOCOL   *This,
658530d68baSNigel Croxon     IN UINTN                            Pages,
659530d68baSNigel Croxon     IN EFI_PHYSICAL_ADDRESS             HostAddress
660530d68baSNigel Croxon     );
661530d68baSNigel Croxon 
6621b10394eSNigel Croxon typedef struct _EFI_DEVICE_IO_PROTOCOL {
663530d68baSNigel Croxon     EFI_IO_ACCESS                       Mem;
664530d68baSNigel Croxon     EFI_IO_ACCESS                       Io;
665530d68baSNigel Croxon     EFI_IO_ACCESS                       Pci;
666530d68baSNigel Croxon     EFI_IO_MAP                          Map;
667530d68baSNigel Croxon     EFI_PCI_DEVICE_PATH                 PciDevicePath;
668530d68baSNigel Croxon     EFI_IO_UNMAP                        Unmap;
669530d68baSNigel Croxon     EFI_IO_ALLOCATE_BUFFER              AllocateBuffer;
670530d68baSNigel Croxon     EFI_IO_FLUSH                        Flush;
671530d68baSNigel Croxon     EFI_IO_FREE_BUFFER                  FreeBuffer;
6721b10394eSNigel Croxon } EFI_DEVICE_IO_PROTOCOL;
673530d68baSNigel Croxon 
6741b10394eSNigel Croxon typedef struct _EFI_DEVICE_IO_PROTOCOL _EFI_DEVICE_IO_INTERFACE;
6751b10394eSNigel Croxon typedef EFI_DEVICE_IO_PROTOCOL EFI_DEVICE_IO_INTERFACE;
676530d68baSNigel Croxon 
677530d68baSNigel Croxon //
678530d68baSNigel Croxon // Unicode Collation protocol
679530d68baSNigel Croxon //
680530d68baSNigel Croxon 
6811b10394eSNigel Croxon #define EFI_UNICODE_COLLATION_PROTOCOL_GUID \
682530d68baSNigel Croxon     { 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc,  0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
6831b10394eSNigel Croxon #define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID
684530d68baSNigel Croxon 
6851b10394eSNigel Croxon #define EFI_UNICODE_BYTE_ORDER_MARK       (CHAR16)(0xfeff)
6861b10394eSNigel Croxon #define UNICODE_BYTE_ORDER_MARK EFI_UNICODE_BYTE_ORDER_MARK
687530d68baSNigel Croxon 
6881b10394eSNigel Croxon INTERFACE_DECL(_EFI_UNICODE_COLLATION_PROTOCOL);
689530d68baSNigel Croxon 
690530d68baSNigel Croxon typedef
691530d68baSNigel Croxon INTN
692530d68baSNigel Croxon (EFIAPI *EFI_UNICODE_STRICOLL) (
6931b10394eSNigel Croxon     IN struct _EFI_UNICODE_COLLATION_PROTOCOL  *This,
694530d68baSNigel Croxon     IN CHAR16                         *s1,
695530d68baSNigel Croxon     IN CHAR16                         *s2
696530d68baSNigel Croxon     );
697530d68baSNigel Croxon 
698530d68baSNigel Croxon typedef
699530d68baSNigel Croxon BOOLEAN
700530d68baSNigel Croxon (EFIAPI *EFI_UNICODE_METAIMATCH) (
7011b10394eSNigel Croxon     IN struct _EFI_UNICODE_COLLATION_PROTOCOL  *This,
702530d68baSNigel Croxon     IN CHAR16                         *String,
703530d68baSNigel Croxon     IN CHAR16                         *Pattern
704530d68baSNigel Croxon     );
705530d68baSNigel Croxon 
706530d68baSNigel Croxon typedef
707530d68baSNigel Croxon VOID
708530d68baSNigel Croxon (EFIAPI *EFI_UNICODE_STRLWR) (
7091b10394eSNigel Croxon     IN struct _EFI_UNICODE_COLLATION_PROTOCOL  *This,
710530d68baSNigel Croxon     IN OUT CHAR16                       *Str
711530d68baSNigel Croxon     );
712530d68baSNigel Croxon 
713530d68baSNigel Croxon typedef
714530d68baSNigel Croxon VOID
715530d68baSNigel Croxon (EFIAPI *EFI_UNICODE_STRUPR) (
7161b10394eSNigel Croxon     IN struct _EFI_UNICODE_COLLATION_PROTOCOL  *This,
717530d68baSNigel Croxon     IN OUT CHAR16                       *Str
718530d68baSNigel Croxon     );
719530d68baSNigel Croxon 
720530d68baSNigel Croxon typedef
721530d68baSNigel Croxon VOID
722530d68baSNigel Croxon (EFIAPI *EFI_UNICODE_FATTOSTR) (
7231b10394eSNigel Croxon     IN struct _EFI_UNICODE_COLLATION_PROTOCOL  *This,
724530d68baSNigel Croxon     IN UINTN                            FatSize,
725530d68baSNigel Croxon     IN CHAR8                            *Fat,
726530d68baSNigel Croxon     OUT CHAR16                          *String
727530d68baSNigel Croxon     );
728530d68baSNigel Croxon 
729530d68baSNigel Croxon typedef
730530d68baSNigel Croxon BOOLEAN
731530d68baSNigel Croxon (EFIAPI *EFI_UNICODE_STRTOFAT) (
7321b10394eSNigel Croxon     IN struct _EFI_UNICODE_COLLATION_PROTOCOL  *This,
733530d68baSNigel Croxon     IN CHAR16                           *String,
734530d68baSNigel Croxon     IN UINTN                            FatSize,
735530d68baSNigel Croxon     OUT CHAR8                           *Fat
736530d68baSNigel Croxon     );
737530d68baSNigel Croxon 
7388c29617eSNigel Croxon //
7398c29617eSNigel Croxon // Hash Protocol
7408c29617eSNigel Croxon //
7411b10394eSNigel Croxon #define EFI_HASH_PROTOCOL_GUID \
7428c29617eSNigel Croxon   { 0xC5184932, 0xDBA5, 0x46DB, { 0xA5, 0xBA, 0xCC, 0x0B, 0xDA, 0x9C, 0x14, 0x35 } }
7431b10394eSNigel Croxon #define HASH_PROTOCOL EFI_HASH_PROTOCOL_GUID
7448c29617eSNigel Croxon 
7451b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA1_GUID \
7468c29617eSNigel Croxon   { 0x2AE9D80F, 0x3FB2, 0x4095, { 0xB7, 0xB1, 0xE9, 0x31, 0x57, 0xB9, 0x46, 0xB6 } } // Deprecated
7471b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA1 EFI_HASH_ALGORITHM_SHA1_GUID
7488c29617eSNigel Croxon 
7491b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA224_GUID \
7508c29617eSNigel Croxon   { 0x8DF01A06, 0x9BD5, 0x4BF7, { 0xB0, 0x21, 0xDB, 0x4F, 0xD9, 0xCC, 0xF4, 0x5B } } // Deprecated
7511b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA224 EFI_HASH_ALGORITHM_SHA224_GUID
7528c29617eSNigel Croxon 
7531b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA256_GUID \
7548c29617eSNigel Croxon   { 0x51AA59DE, 0xFDF2, 0x4EA3, { 0xBC, 0x63, 0x87, 0x5F, 0xB7, 0x84, 0x2E, 0xE9 } } // Deprecated
7551b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA256 EFI_HASH_ALGORITHM_SHA256_GUID
7568c29617eSNigel Croxon 
7571b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA384_GUID \
7588c29617eSNigel Croxon   { 0xEFA96432, 0xDE33, 0x4DD2, { 0xAE, 0xE6, 0x32, 0x8C, 0x33, 0xDF, 0x77, 0x7A } } // Deprecated
7591b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA384 EFI_HASH_ALGORITHM_SHA384_GUID
7608c29617eSNigel Croxon 
7611b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA512_GUID \
7628c29617eSNigel Croxon   { 0xCAA4381E, 0x750C, 0x4770, { 0xB8, 0x70, 0x7A, 0x23, 0xB4, 0xE4, 0x21, 0x30 } } // Deprecated
7631b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA512 EFI_HASH_ALGORITHM_SHA512_GUID
7648c29617eSNigel Croxon 
7651b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_MD5_GUID \
7668c29617eSNigel Croxon   { 0x0AF7C79C, 0x65B5, 0x4319, { 0xB0, 0xAE, 0x44, 0xEC, 0x48, 0x4E, 0x4A, 0xD7 } } // Deprecated
7671b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_MD5 EFI_HASH_ALGORITHM_MD5_GUID
7688c29617eSNigel Croxon 
7691b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID \
7708c29617eSNigel Croxon   { 0x24C5DC2F, 0x53E2, 0x40CA, { 0x9E, 0xD6, 0xA5, 0xD9, 0xA4, 0x9F, 0x46, 0x3B } }
7711b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA1_NOPAD EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID
7728c29617eSNigel Croxon 
7731b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID \
7748c29617eSNigel Croxon   { 0x8628752A, 0x6CB7, 0x4814, { 0x96, 0xFC, 0x24, 0xA8, 0x15, 0xAC, 0x22, 0x26 } }
7751b10394eSNigel Croxon #define EFI_HASH_ALGORITHM_SHA256_NOPAD EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID
7768c29617eSNigel Croxon 
7778c29617eSNigel Croxon 
7781b10394eSNigel Croxon INTERFACE_DECL(_EFI_HASH_PROTOCOL);
7798c29617eSNigel Croxon 
7808c29617eSNigel Croxon typedef UINT8 EFI_MD5_HASH[16];
7818c29617eSNigel Croxon typedef UINT8 EFI_SHA1_HASH[20];
7828c29617eSNigel Croxon typedef UINT8 EFI_SHA224_HASH[28];
7838c29617eSNigel Croxon typedef UINT8 EFI_SHA256_HASH[32];
7848c29617eSNigel Croxon typedef UINT8 EFI_SHA384_HASH[48];
7858c29617eSNigel Croxon typedef UINT8 EFI_SHA512_HASH[64];
7868c29617eSNigel Croxon typedef union _EFI_HASH_OUTPUT {
7878c29617eSNigel Croxon   EFI_MD5_HASH                    *Md5Hash;
7888c29617eSNigel Croxon   EFI_SHA1_HASH                   *Sha1Hash;
7898c29617eSNigel Croxon   EFI_SHA224_HASH                 *Sha224Hash;
7908c29617eSNigel Croxon   EFI_SHA256_HASH                 *Sha256Hash;
7918c29617eSNigel Croxon   EFI_SHA384_HASH                 *Sha384Hash;
7928c29617eSNigel Croxon   EFI_SHA512_HASH                 *Sha512Hash;
7938c29617eSNigel Croxon } EFI_HASH_OUTPUT;
7948c29617eSNigel Croxon 
7958c29617eSNigel Croxon typedef
7968c29617eSNigel Croxon EFI_STATUS
7978c29617eSNigel Croxon (EFIAPI *EFI_HASH_GET_HASH_SIZE) (
7981b10394eSNigel Croxon   IN CONST struct _EFI_HASH_PROTOCOL  *This,
7998c29617eSNigel Croxon   IN CONST EFI_GUID               *HashAlgorithm,
8008c29617eSNigel Croxon   OUT UINTN                       *HashSize);
8018c29617eSNigel Croxon 
8028c29617eSNigel Croxon typedef
8038c29617eSNigel Croxon EFI_STATUS
8048c29617eSNigel Croxon (EFIAPI *EFI_HASH_HASH) (
8051b10394eSNigel Croxon   IN CONST struct _EFI_HASH_PROTOCOL  *This,
8068c29617eSNigel Croxon   IN CONST EFI_GUID               *HashAlgorithm,
8078c29617eSNigel Croxon   IN BOOLEAN                      Extend,
8088c29617eSNigel Croxon   IN CONST UINT8                  *Message,
8098c29617eSNigel Croxon   IN UINT64                       MessageSize,
8108c29617eSNigel Croxon   IN OUT EFI_HASH_OUTPUT          *Hash);
8118c29617eSNigel Croxon 
8121b10394eSNigel Croxon typedef struct _EFI_HASH_PROTOCOL {
8138c29617eSNigel Croxon   EFI_HASH_GET_HASH_SIZE                  GetHashSize;
8148c29617eSNigel Croxon   EFI_HASH_HASH                           Hash;
8151b10394eSNigel Croxon } EFI_HASH_PROTOCOL;
8161b10394eSNigel Croxon 
8171b10394eSNigel Croxon typedef struct _EFI_HASH_PROTOCOL _EFI_HASH;
8181b10394eSNigel Croxon typedef EFI_HASH_PROTOCOL EFI_HASH;
8198c29617eSNigel Croxon 
820530d68baSNigel Croxon 
8211b10394eSNigel Croxon typedef struct _EFI_UNICODE_COLLATION_PROTOCOL {
822530d68baSNigel Croxon 
823530d68baSNigel Croxon     // general
824530d68baSNigel Croxon     EFI_UNICODE_STRICOLL                StriColl;
825530d68baSNigel Croxon     EFI_UNICODE_METAIMATCH              MetaiMatch;
826530d68baSNigel Croxon     EFI_UNICODE_STRLWR                  StrLwr;
827530d68baSNigel Croxon     EFI_UNICODE_STRUPR                  StrUpr;
828530d68baSNigel Croxon 
829530d68baSNigel Croxon     // for supporting fat volumes
830530d68baSNigel Croxon     EFI_UNICODE_FATTOSTR                FatToStr;
831530d68baSNigel Croxon     EFI_UNICODE_STRTOFAT                StrToFat;
832530d68baSNigel Croxon 
833530d68baSNigel Croxon     CHAR8                               *SupportedLanguages;
8341b10394eSNigel Croxon } EFI_UNICODE_COLLATION_PROTOCOL;
8351b10394eSNigel Croxon 
8361b10394eSNigel Croxon typedef EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_INTERFACE;
837530d68baSNigel Croxon 
838530d68baSNigel Croxon /* Graphics output protocol */
839530d68baSNigel Croxon #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
8401b10394eSNigel Croxon    { 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } }
841530d68baSNigel Croxon typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;
842530d68baSNigel Croxon 
843530d68baSNigel Croxon typedef struct {
844530d68baSNigel Croxon   UINT32            RedMask;
845530d68baSNigel Croxon   UINT32            GreenMask;
846530d68baSNigel Croxon   UINT32            BlueMask;
847530d68baSNigel Croxon   UINT32            ReservedMask;
848530d68baSNigel Croxon } EFI_PIXEL_BITMASK;
849530d68baSNigel Croxon 
850530d68baSNigel Croxon typedef enum {
851530d68baSNigel Croxon   PixelRedGreenBlueReserved8BitPerColor,
852530d68baSNigel Croxon   PixelBlueGreenRedReserved8BitPerColor,
853530d68baSNigel Croxon   PixelBitMask,
854530d68baSNigel Croxon   PixelBltOnly,
855530d68baSNigel Croxon   PixelFormatMax
856530d68baSNigel Croxon } EFI_GRAPHICS_PIXEL_FORMAT;
857530d68baSNigel Croxon 
858530d68baSNigel Croxon typedef struct {
859530d68baSNigel Croxon   UINT32                     Version;
860530d68baSNigel Croxon   UINT32                     HorizontalResolution;
861530d68baSNigel Croxon   UINT32                     VerticalResolution;
862530d68baSNigel Croxon   EFI_GRAPHICS_PIXEL_FORMAT  PixelFormat;
863530d68baSNigel Croxon   EFI_PIXEL_BITMASK          PixelInformation;
864530d68baSNigel Croxon   UINT32                     PixelsPerScanLine;
865530d68baSNigel Croxon } EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;
866530d68baSNigel Croxon 
867530d68baSNigel Croxon /**
868530d68baSNigel Croxon   Return the current video mode information.
869530d68baSNigel Croxon 
870530d68baSNigel Croxon   @param  This       Protocol instance pointer.
871530d68baSNigel Croxon   @param  ModeNumber The mode number to return information on.
872530d68baSNigel Croxon   @param  SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
873530d68baSNigel Croxon   @param  Info       A pointer to callee allocated buffer that returns information about ModeNumber.
874530d68baSNigel Croxon 
875530d68baSNigel Croxon   @retval EFI_SUCCESS           Mode information returned.
876530d68baSNigel Croxon   @retval EFI_BUFFER_TOO_SMALL  The Info buffer was too small.
877530d68baSNigel Croxon   @retval EFI_DEVICE_ERROR      A hardware error occurred trying to retrieve the video mode.
878530d68baSNigel Croxon   @retval EFI_NOT_STARTED       Video display is not initialized. Call SetMode ()
879530d68baSNigel Croxon   @retval EFI_INVALID_PARAMETER One of the input args was NULL.
880530d68baSNigel Croxon 
881530d68baSNigel Croxon **/
882530d68baSNigel Croxon typedef
883530d68baSNigel Croxon EFI_STATUS
884530d68baSNigel Croxon (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE) (
885530d68baSNigel Croxon   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL          *This,
886530d68baSNigel Croxon   IN  UINT32                                ModeNumber,
887530d68baSNigel Croxon   OUT UINTN                                 *SizeOfInfo,
888530d68baSNigel Croxon   OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  **Info
889530d68baSNigel Croxon   )
890530d68baSNigel Croxon ;
891530d68baSNigel Croxon 
892530d68baSNigel Croxon /**
893530d68baSNigel Croxon   Return the current video mode information.
894530d68baSNigel Croxon 
895530d68baSNigel Croxon   @param  This              Protocol instance pointer.
896530d68baSNigel Croxon   @param  ModeNumber        The mode number to be set.
897530d68baSNigel Croxon 
898530d68baSNigel Croxon   @retval EFI_SUCCESS       Graphics mode was changed.
899530d68baSNigel Croxon   @retval EFI_DEVICE_ERROR  The device had an error and could not complete the request.
900530d68baSNigel Croxon   @retval EFI_UNSUPPORTED   ModeNumber is not supported by this device.
901530d68baSNigel Croxon 
902530d68baSNigel Croxon **/
903530d68baSNigel Croxon typedef
904530d68baSNigel Croxon EFI_STATUS
905530d68baSNigel Croxon (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) (
906530d68baSNigel Croxon   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
907530d68baSNigel Croxon   IN  UINT32                       ModeNumber
908530d68baSNigel Croxon   );
909530d68baSNigel Croxon 
910530d68baSNigel Croxon typedef struct {
911530d68baSNigel Croxon   UINT8 Blue;
912530d68baSNigel Croxon   UINT8 Green;
913530d68baSNigel Croxon   UINT8 Red;
914530d68baSNigel Croxon   UINT8 Reserved;
915530d68baSNigel Croxon } EFI_GRAPHICS_OUTPUT_BLT_PIXEL;
916530d68baSNigel Croxon 
917530d68baSNigel Croxon typedef union {
918530d68baSNigel Croxon   EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;
919530d68baSNigel Croxon   UINT32                        Raw;
920530d68baSNigel Croxon } EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;
921530d68baSNigel Croxon 
922530d68baSNigel Croxon typedef enum {
923530d68baSNigel Croxon   EfiBltVideoFill,
924530d68baSNigel Croxon   EfiBltVideoToBltBuffer,
925530d68baSNigel Croxon   EfiBltBufferToVideo,
926530d68baSNigel Croxon   EfiBltVideoToVideo,
927530d68baSNigel Croxon   EfiGraphicsOutputBltOperationMax
928530d68baSNigel Croxon } EFI_GRAPHICS_OUTPUT_BLT_OPERATION;
929530d68baSNigel Croxon 
930530d68baSNigel Croxon /**
931530d68baSNigel Croxon   The following table defines actions for BltOperations:
932530d68baSNigel Croxon 
933530d68baSNigel Croxon   <B>EfiBltVideoFill</B> - Write data from the  BltBuffer pixel (SourceX, SourceY)
934530d68baSNigel Croxon   directly to every pixel of the video display rectangle
935530d68baSNigel Croxon   (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
936530d68baSNigel Croxon   Only one pixel will be used from the BltBuffer. Delta is NOT used.
937530d68baSNigel Croxon 
938530d68baSNigel Croxon   <B>EfiBltVideoToBltBuffer</B> - Read data from the video display rectangle
939530d68baSNigel Croxon   (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
940530d68baSNigel Croxon   the BltBuffer rectangle (DestinationX, DestinationY )
941530d68baSNigel Croxon   (DestinationX + Width, DestinationY + Height). If DestinationX or
942530d68baSNigel Croxon   DestinationY is not zero then Delta must be set to the length in bytes
943530d68baSNigel Croxon   of a row in the BltBuffer.
944530d68baSNigel Croxon 
945530d68baSNigel Croxon   <B>EfiBltBufferToVideo</B> - Write data from the  BltBuffer rectangle
946530d68baSNigel Croxon   (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
947530d68baSNigel Croxon   video display rectangle (DestinationX, DestinationY)
948530d68baSNigel Croxon   (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
949530d68baSNigel Croxon   not zero then Delta must be set to the length in bytes of a row in the
950530d68baSNigel Croxon   BltBuffer.
951530d68baSNigel Croxon 
952530d68baSNigel Croxon   <B>EfiBltVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)
953530d68baSNigel Croxon   (SourceX + Width, SourceY + Height) .to the video display rectangle
954530d68baSNigel Croxon   (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
955530d68baSNigel Croxon   The BltBuffer and Delta  are not used in this mode.
956530d68baSNigel Croxon 
957530d68baSNigel Croxon   @param  This         Protocol instance pointer.
958530d68baSNigel Croxon   @param  BltBuffer    Buffer containing data to blit into video buffer. This
959530d68baSNigel Croxon                        buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
960530d68baSNigel Croxon   @param  BltOperation Operation to perform on BlitBuffer and video memory
961530d68baSNigel Croxon   @param  SourceX      X coordinate of source for the BltBuffer.
962530d68baSNigel Croxon   @param  SourceY      Y coordinate of source for the BltBuffer.
963530d68baSNigel Croxon   @param  DestinationX X coordinate of destination for the BltBuffer.
964530d68baSNigel Croxon   @param  DestinationY Y coordinate of destination for the BltBuffer.
965530d68baSNigel Croxon   @param  Width        Width of rectangle in BltBuffer in pixels.
966530d68baSNigel Croxon   @param  Height       Hight of rectangle in BltBuffer in pixels.
967530d68baSNigel Croxon   @param  Delta        OPTIONAL
968530d68baSNigel Croxon 
969530d68baSNigel Croxon   @retval EFI_SUCCESS           The Blt operation completed.
970530d68baSNigel Croxon   @retval EFI_INVALID_PARAMETER BltOperation is not valid.
971530d68baSNigel Croxon   @retval EFI_DEVICE_ERROR      A hardware error occured writting to the video buffer.
972530d68baSNigel Croxon 
973530d68baSNigel Croxon **/
974530d68baSNigel Croxon typedef
975530d68baSNigel Croxon EFI_STATUS
976530d68baSNigel Croxon (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (
977530d68baSNigel Croxon   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL            *This,
978530d68baSNigel Croxon   IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL           *BltBuffer,   OPTIONAL
979530d68baSNigel Croxon   IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION       BltOperation,
980530d68baSNigel Croxon   IN  UINTN                                   SourceX,
981530d68baSNigel Croxon   IN  UINTN                                   SourceY,
982530d68baSNigel Croxon   IN  UINTN                                   DestinationX,
983530d68baSNigel Croxon   IN  UINTN                                   DestinationY,
984530d68baSNigel Croxon   IN  UINTN                                   Width,
985530d68baSNigel Croxon   IN  UINTN                                   Height,
986530d68baSNigel Croxon   IN  UINTN                                   Delta         OPTIONAL
987530d68baSNigel Croxon   );
988530d68baSNigel Croxon 
989530d68baSNigel Croxon typedef struct {
990530d68baSNigel Croxon   UINT32                                 MaxMode;
991530d68baSNigel Croxon   UINT32                                 Mode;
992530d68baSNigel Croxon   EFI_GRAPHICS_OUTPUT_MODE_INFORMATION   *Info;
993530d68baSNigel Croxon   UINTN                                  SizeOfInfo;
994530d68baSNigel Croxon   EFI_PHYSICAL_ADDRESS                   FrameBufferBase;
995530d68baSNigel Croxon   UINTN                                  FrameBufferSize;
996530d68baSNigel Croxon } EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;
997530d68baSNigel Croxon 
998530d68baSNigel Croxon struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {
999530d68baSNigel Croxon   EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE  QueryMode;
1000530d68baSNigel Croxon   EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE    SetMode;
1001530d68baSNigel Croxon   EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT         Blt;
1002530d68baSNigel Croxon   EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE        *Mode;
1003530d68baSNigel Croxon };
1004530d68baSNigel Croxon 
10058118d087SNigel Croxon 
1006cae022d6SNigel Croxon 
1007cae022d6SNigel Croxon /*
1008cae022d6SNigel Croxon  * EFI EDID Discovered Protocol
1009cae022d6SNigel Croxon  * UEFI Specification Version 2.5 Section 11.9
1010cae022d6SNigel Croxon  */
1011cae022d6SNigel Croxon #define EFI_EDID_DISCOVERED_PROTOCOL_GUID \
1012cae022d6SNigel Croxon     { 0x1C0C34F6, 0xD380, 0x41FA, { 0xA0, 0x49, 0x8a, 0xD0, 0x6C, 0x1A, 0x66, 0xAA} }
1013cae022d6SNigel Croxon 
1014cae022d6SNigel Croxon typedef struct _EFI_EDID_DISCOVERED_PROTOCOL {
1015cae022d6SNigel Croxon     UINT32   SizeOfEdid;
1016cae022d6SNigel Croxon     UINT8   *Edid;
1017cae022d6SNigel Croxon } EFI_EDID_DISCOVERED_PROTOCOL;
1018cae022d6SNigel Croxon 
1019cae022d6SNigel Croxon 
1020cae022d6SNigel Croxon 
1021cae022d6SNigel Croxon /*
1022cae022d6SNigel Croxon  * EFI EDID Active Protocol
1023cae022d6SNigel Croxon  * UEFI Specification Version 2.5 Section 11.9
1024cae022d6SNigel Croxon  */
1025cae022d6SNigel Croxon #define EFI_EDID_ACTIVE_PROTOCOL_GUID \
1026cae022d6SNigel Croxon     { 0xBD8C1056, 0x9F36, 0x44EC, { 0x92, 0xA8, 0xA6, 0x33, 0x7F, 0x81, 0x79, 0x86} }
1027cae022d6SNigel Croxon 
1028cae022d6SNigel Croxon typedef struct _EFI_EDID_ACTIVE_PROTOCOL {
1029cae022d6SNigel Croxon     UINT32   SizeOfEdid;
1030cae022d6SNigel Croxon     UINT8   *Edid;
1031cae022d6SNigel Croxon } EFI_EDID_ACTIVE_PROTOCOL;
1032cae022d6SNigel Croxon 
1033cae022d6SNigel Croxon 
1034cae022d6SNigel Croxon 
1035cae022d6SNigel Croxon /*
1036cae022d6SNigel Croxon  * EFI EDID Override Protocol
1037cae022d6SNigel Croxon  * UEFI Specification Version 2.5 Section 11.9
1038cae022d6SNigel Croxon  */
1039cae022d6SNigel Croxon #define EFI_EDID_OVERRIDE_PROTOCOL_GUID \
1040cae022d6SNigel Croxon     { 0x48ECB431, 0xFB72, 0x45C0, { 0xA9, 0x22, 0xF4, 0x58, 0xFE, 0x04, 0x0B, 0xD5} }
1041cae022d6SNigel Croxon 
1042cae022d6SNigel Croxon INTERFACE_DECL(_EFI_EDID_OVERRIDE_PROTOCOL);
1043cae022d6SNigel Croxon 
1044cae022d6SNigel Croxon typedef
1045cae022d6SNigel Croxon EFI_STATUS
1046cae022d6SNigel Croxon (EFIAPI *EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID) (
1047cae022d6SNigel Croxon   IN      struct _EFI_EDID_OVERRIDE_PROTOCOL   *This,
1048cae022d6SNigel Croxon   IN      EFI_HANDLE                           *ChildHandle,
1049cae022d6SNigel Croxon   OUT     UINT32                               *Attributes,
1050cae022d6SNigel Croxon   IN OUT  UINTN                                *EdidSize,
1051cae022d6SNigel Croxon   IN OUT  UINT8                               **Edid);
1052cae022d6SNigel Croxon 
1053cae022d6SNigel Croxon typedef struct _EFI_EDID_OVERRIDE_PROTOCOL {
1054cae022d6SNigel Croxon     EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID  GetEdid;
1055cae022d6SNigel Croxon } EFI_EDID_OVERRIDE_PROTOCOL;
1056cae022d6SNigel Croxon 
1057cae022d6SNigel Croxon 
1058cae022d6SNigel Croxon 
1059530d68baSNigel Croxon INTERFACE_DECL(_EFI_SERVICE_BINDING);
1060530d68baSNigel Croxon 
1061530d68baSNigel Croxon typedef
1062530d68baSNigel Croxon EFI_STATUS
1063530d68baSNigel Croxon (EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD) (
1064530d68baSNigel Croxon     IN struct _EFI_SERVICE_BINDING *This,
1065530d68baSNigel Croxon     IN EFI_HANDLE                  *ChildHandle
1066530d68baSNigel Croxon     );
1067530d68baSNigel Croxon 
1068530d68baSNigel Croxon typedef
1069530d68baSNigel Croxon EFI_STATUS
1070530d68baSNigel Croxon (EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD) (
1071530d68baSNigel Croxon     IN struct _EFI_SERVICE_BINDING *This,
1072530d68baSNigel Croxon     IN EFI_HANDLE                  ChildHandle
1073530d68baSNigel Croxon     );
1074530d68baSNigel Croxon 
1075530d68baSNigel Croxon typedef struct _EFI_SERVICE_BINDING {
1076530d68baSNigel Croxon     EFI_SERVICE_BINDING_CREATE_CHILD  CreateChild;
1077530d68baSNigel Croxon     EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;
1078530d68baSNigel Croxon } EFI_SERVICE_BINDING;
1079530d68baSNigel Croxon 
1080533a042dSNigel Croxon 
10818118d087SNigel Croxon 
10828118d087SNigel Croxon /*
10838118d087SNigel Croxon  * EFI Driver Binding Protocol
10848118d087SNigel Croxon  * UEFI Specification Version 2.5 Section 10.1
10858118d087SNigel Croxon  */
10868118d087SNigel Croxon #define EFI_DRIVER_BINDING_PROTOCOL_GUID \
1087533a042dSNigel Croxon     { 0x18A031AB, 0xB443, 0x4D1A, { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71} }
10881b10394eSNigel Croxon #define DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL_GUID
1089533a042dSNigel Croxon 
10908118d087SNigel Croxon INTERFACE_DECL(_EFI_DRIVER_BINDING_PROTOCOL);
1091533a042dSNigel Croxon 
1092533a042dSNigel Croxon typedef
1093533a042dSNigel Croxon EFI_STATUS
10948118d087SNigel Croxon (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_SUPPORTED) (
10958118d087SNigel Croxon   IN      struct _EFI_DRIVER_BINDING_PROTOCOL *This,
1096533a042dSNigel Croxon   IN      EFI_HANDLE                          ControllerHandle,
1097533a042dSNigel Croxon   IN      EFI_DEVICE_PATH                     *RemainingDevicePath OPTIONAL);
1098533a042dSNigel Croxon 
1099533a042dSNigel Croxon typedef
1100533a042dSNigel Croxon EFI_STATUS
11018118d087SNigel Croxon (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_START) (
11028118d087SNigel Croxon   IN      struct _EFI_DRIVER_BINDING_PROTOCOL *This,
1103533a042dSNigel Croxon   IN      EFI_HANDLE                          ControllerHandle,
1104533a042dSNigel Croxon   IN      EFI_DEVICE_PATH                     *RemainingDevicePath OPTIONAL);
1105533a042dSNigel Croxon 
1106533a042dSNigel Croxon typedef
1107533a042dSNigel Croxon EFI_STATUS
11088118d087SNigel Croxon (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_STOP) (
11098118d087SNigel Croxon   IN      struct _EFI_DRIVER_BINDING_PROTOCOL *This,
1110533a042dSNigel Croxon   IN      EFI_HANDLE                          ControllerHandle,
1111533a042dSNigel Croxon   IN      UINTN                               NumberOfChildren,
1112533a042dSNigel Croxon   IN      EFI_HANDLE                          *ChildHandleBuffer OPTIONAL);
1113533a042dSNigel Croxon 
11148118d087SNigel Croxon typedef struct _EFI_DRIVER_BINDING_PROTOCOL {
11158118d087SNigel Croxon   EFI_DRIVER_BINDING_PROTOCOL_SUPPORTED       Supported;
11168118d087SNigel Croxon   EFI_DRIVER_BINDING_PROTOCOL_START           Start;
11178118d087SNigel Croxon   EFI_DRIVER_BINDING_PROTOCOL_STOP            Stop;
1118533a042dSNigel Croxon   UINT32                                      Version;
1119533a042dSNigel Croxon   EFI_HANDLE                                  ImageHandle;
1120533a042dSNigel Croxon   EFI_HANDLE                                  DriverBindingHandle;
11218118d087SNigel Croxon } EFI_DRIVER_BINDING_PROTOCOL;
1122533a042dSNigel Croxon 
11231b10394eSNigel Croxon typedef struct _EFI_DRIVER_BINDING_PROTOCOL _EFI_DRIVER_BINDING;
11241b10394eSNigel Croxon typedef EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING;
1125883702e8SNigel Croxon 
11268118d087SNigel Croxon 
11278118d087SNigel Croxon /*
11288118d087SNigel Croxon  * Backwards compatibility with older GNU-EFI versions. Deprecated.
11298118d087SNigel Croxon  */
11308118d087SNigel Croxon #define EFI_DRIVER_SUPPORTED         EFI_DRIVER_BINDING_PROTOCOL_SUPPORTED
11318118d087SNigel Croxon #define EFI_DRIVER_START             EFI_DRIVER_BINDING_PROTOCOL_START
11328118d087SNigel Croxon #define EFI_DRIVER_STOP              EFI_DRIVER_BINDING_PROTOCOL_STOP
11338118d087SNigel Croxon 
11348118d087SNigel Croxon 
11358118d087SNigel Croxon 
11368118d087SNigel Croxon /*
11378118d087SNigel Croxon  * EFI Component Name Protocol
11388118d087SNigel Croxon  * Deprecated - use EFI Component Name 2 Protocol instead
11398118d087SNigel Croxon  */
11408118d087SNigel Croxon #define EFI_COMPONENT_NAME_PROTOCOL_GUID \
1141883702e8SNigel Croxon     {0x107A772C, 0xD5E1, 0x11D4, { 0x9A, 0x46, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }
11421b10394eSNigel Croxon #define COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL_GUID
1143883702e8SNigel Croxon 
11448118d087SNigel Croxon INTERFACE_DECL(_EFI_COMPONENT_NAME_PROTOCOL);
1145883702e8SNigel Croxon 
1146883702e8SNigel Croxon typedef
1147883702e8SNigel Croxon EFI_STATUS
1148883702e8SNigel Croxon (EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) (
11498118d087SNigel Croxon   IN      struct _EFI_COMPONENT_NAME_PROTOCOL   *This,
1150883702e8SNigel Croxon   IN      CHAR8                                 *Language,
1151883702e8SNigel Croxon   OUT     CHAR16                                **DriverName);
1152883702e8SNigel Croxon 
1153883702e8SNigel Croxon typedef
1154883702e8SNigel Croxon EFI_STATUS
1155883702e8SNigel Croxon (EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) (
11568118d087SNigel Croxon   IN      struct _EFI_COMPONENT_NAME_PROTOCOL   *This,
1157883702e8SNigel Croxon   IN      EFI_HANDLE                            ControllerHandle,
1158883702e8SNigel Croxon   IN      EFI_HANDLE                            ChildHandle OPTIONAL,
1159883702e8SNigel Croxon   IN      CHAR8                                 *Language,
1160883702e8SNigel Croxon   OUT     CHAR16                                **ControllerName);
1161883702e8SNigel Croxon 
11628118d087SNigel Croxon typedef struct _EFI_COMPONENT_NAME_PROTOCOL {
1163883702e8SNigel Croxon   EFI_COMPONENT_NAME_GET_DRIVER_NAME      GetDriverName;
1164883702e8SNigel Croxon   EFI_COMPONENT_NAME_GET_CONTROLLER_NAME  GetControllerName;
1165883702e8SNigel Croxon   CHAR8                                   *SupportedLanguages;
11668118d087SNigel Croxon } EFI_COMPONENT_NAME_PROTOCOL;
1167883702e8SNigel Croxon 
11681b10394eSNigel Croxon typedef struct _EFI_COMPONENT_NAME_PROTOCOL _EFI_COMPONENT_NAME;
11691b10394eSNigel Croxon typedef EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME;
11708118d087SNigel Croxon 
11718118d087SNigel Croxon 
11728118d087SNigel Croxon /*
11738118d087SNigel Croxon  * EFI Component Name 2 Protocol
11748118d087SNigel Croxon  * UEFI Specification Version 2.5 Section 10.5
11758118d087SNigel Croxon  */
11768118d087SNigel Croxon #define EFI_COMPONENT_NAME2_PROTOCOL_GUID \
1177883702e8SNigel Croxon     {0x6A7A5CFF, 0xE8D9, 0x4F70, { 0xBA, 0xDA, 0x75, 0xAB, 0x30, 0x25, 0xCE, 0x14} }
11781b10394eSNigel Croxon #define COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL_GUID
1179883702e8SNigel Croxon 
11808118d087SNigel Croxon INTERFACE_DECL(_EFI_COMPONENT_NAME2_PROTOCOL);
1181883702e8SNigel Croxon 
1182883702e8SNigel Croxon typedef
1183883702e8SNigel Croxon EFI_STATUS
1184883702e8SNigel Croxon (EFIAPI *EFI_COMPONENT_NAME2_GET_DRIVER_NAME) (
11858118d087SNigel Croxon   IN      struct _EFI_COMPONENT_NAME2_PROTOCOL   *This,
1186883702e8SNigel Croxon   IN      CHAR8                                  *Language,
1187883702e8SNigel Croxon   OUT     CHAR16                                 **DriverName);
1188883702e8SNigel Croxon 
1189883702e8SNigel Croxon typedef
1190883702e8SNigel Croxon EFI_STATUS
1191883702e8SNigel Croxon (EFIAPI *EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) (
11928118d087SNigel Croxon   IN      struct _EFI_COMPONENT_NAME2_PROTOCOL   *This,
1193883702e8SNigel Croxon   IN      EFI_HANDLE                             ControllerHandle,
1194883702e8SNigel Croxon   IN      EFI_HANDLE                             ChildHandle OPTIONAL,
1195883702e8SNigel Croxon   IN      CHAR8                                  *Language,
1196883702e8SNigel Croxon   OUT     CHAR16                                 **ControllerName);
1197883702e8SNigel Croxon 
11988118d087SNigel Croxon typedef struct _EFI_COMPONENT_NAME2_PROTOCOL {
1199883702e8SNigel Croxon   EFI_COMPONENT_NAME2_GET_DRIVER_NAME       GetDriverName;
1200883702e8SNigel Croxon   EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME   GetControllerName;
1201883702e8SNigel Croxon   CHAR8                                     *SupportedLanguages;
12028118d087SNigel Croxon } EFI_COMPONENT_NAME2_PROTOCOL;
1203883702e8SNigel Croxon 
12041b10394eSNigel Croxon typedef struct _EFI_COMPONENT_NAME2_PROTOCOL _EFI_COMPONENT_NAME2;
12051b10394eSNigel Croxon typedef EFI_COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2;
12068118d087SNigel Croxon 
12078118d087SNigel Croxon 
12088118d087SNigel Croxon 
12098118d087SNigel Croxon /*
12108118d087SNigel Croxon  * EFI Loaded Image Protocol
12118118d087SNigel Croxon  * UEFI Specification Version 2.5 Section 8.1
12128118d087SNigel Croxon  */
12138118d087SNigel Croxon #define EFI_LOADED_IMAGE_PROTOCOL_GUID \
12143b31a5e3SNigel Croxon     { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
12151b10394eSNigel Croxon #define LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE_PROTOCOL_GUID
12163b31a5e3SNigel Croxon 
12178118d087SNigel Croxon #define EFI_LOADED_IMAGE_PROTOCOL_REVISION  0x1000
12181b10394eSNigel Croxon #define EFI_IMAGE_INFORMATION_REVISION  EFI_LOADED_IMAGE_PROTOCOL_REVISION
12198118d087SNigel Croxon 
12203b31a5e3SNigel Croxon typedef
12213b31a5e3SNigel Croxon EFI_STATUS
12223b31a5e3SNigel Croxon (EFIAPI *EFI_IMAGE_UNLOAD) (
12233b31a5e3SNigel Croxon     IN EFI_HANDLE                   ImageHandle
12243b31a5e3SNigel Croxon     );
12253b31a5e3SNigel Croxon 
12263b31a5e3SNigel Croxon typedef struct {
12273b31a5e3SNigel Croxon     UINT32                          Revision;
12283b31a5e3SNigel Croxon     EFI_HANDLE                      ParentHandle;
12293b31a5e3SNigel Croxon     struct _EFI_SYSTEM_TABLE        *SystemTable;
12303b31a5e3SNigel Croxon 
12313b31a5e3SNigel Croxon     // Source location of image
12323b31a5e3SNigel Croxon     EFI_HANDLE                      DeviceHandle;
12333b31a5e3SNigel Croxon     EFI_DEVICE_PATH                 *FilePath;
12343b31a5e3SNigel Croxon     VOID                            *Reserved;
12353b31a5e3SNigel Croxon 
12363b31a5e3SNigel Croxon     // Images load options
12373b31a5e3SNigel Croxon     UINT32                          LoadOptionsSize;
12383b31a5e3SNigel Croxon     VOID                            *LoadOptions;
12393b31a5e3SNigel Croxon 
12403b31a5e3SNigel Croxon     // Location of where image was loaded
12413b31a5e3SNigel Croxon     VOID                            *ImageBase;
12423b31a5e3SNigel Croxon     UINT64                          ImageSize;
12433b31a5e3SNigel Croxon     EFI_MEMORY_TYPE                 ImageCodeType;
12443b31a5e3SNigel Croxon     EFI_MEMORY_TYPE                 ImageDataType;
12453b31a5e3SNigel Croxon 
12463b31a5e3SNigel Croxon     // If the driver image supports a dynamic unload request
12473b31a5e3SNigel Croxon     EFI_IMAGE_UNLOAD                Unload;
12488118d087SNigel Croxon } EFI_LOADED_IMAGE_PROTOCOL;
12493b31a5e3SNigel Croxon 
12501b10394eSNigel Croxon typedef EFI_LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE;
12518118d087SNigel Croxon 
125269df7422SPeter Jones #define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \
125369df7422SPeter Jones     {0xbc62157e, 0x3e33, 0x4fec, {0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf} }
12548118d087SNigel Croxon 
12558118d087SNigel Croxon /*
12568118d087SNigel Croxon  * Random Number Generator Protocol
12578118d087SNigel Croxon  * UEFI Specification Version 2.5 Section 35.5
12588118d087SNigel Croxon  */
12599b0fe34eSNigel Croxon #define EFI_RNG_PROTOCOL_GUID                          \
12609b0fe34eSNigel Croxon           { 0x3152bca5, 0xeade, 0x433d, {0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44} }
12619b0fe34eSNigel Croxon 
12629b0fe34eSNigel Croxon typedef EFI_GUID EFI_RNG_ALGORITHM;
12639b0fe34eSNigel Croxon 
12649b0fe34eSNigel Croxon #define EFI_RNG_ALGORITHM_SP800_90_HASH_256_GUID       \
12659b0fe34eSNigel Croxon      {0xa7af67cb, 0x603b, 0x4d42, {0xba, 0x21, 0x70, 0xbf, 0xb6, 0x29, 0x3f, 0x96} }
12669b0fe34eSNigel Croxon 
12679b0fe34eSNigel Croxon #define EFI_RNG_ALGORITHM_SP800_90_HMAC_256_GUID       \
12689b0fe34eSNigel Croxon      {0xc5149b43, 0xae85, 0x4f53, {0x99, 0x82, 0xb9, 0x43, 0x35, 0xd3, 0xa9, 0xe7} }
12699b0fe34eSNigel Croxon 
12709b0fe34eSNigel Croxon #define EFI_RNG_ALGORITHM_SP800_90_CTR_256_GUID        \
12719b0fe34eSNigel Croxon      {0x44f0de6e, 0x4d8c, 0x4045, {0xa8, 0xc7, 0x4d, 0xd1, 0x68, 0x85, 0x6b, 0x9e} }
12729b0fe34eSNigel Croxon 
12739b0fe34eSNigel Croxon #define EFI_RNG_ALGORITHM_X9_31_3DES_GUID              \
12749b0fe34eSNigel Croxon      {0x63c4785a, 0xca34, 0x4012, {0xa3, 0xc8, 0x0b, 0x6a, 0x32, 0x4f, 0x55, 0x46} }
12759b0fe34eSNigel Croxon 
12769b0fe34eSNigel Croxon #define EFI_RNG_ALGORITHM_X9_31_AES_GUID               \
12779b0fe34eSNigel Croxon      {0xacd03321, 0x777e, 0x4d3d, {0xb1, 0xc8, 0x20, 0xcf, 0xd8, 0x88, 0x20, 0xc9} }
12789b0fe34eSNigel Croxon 
12799b0fe34eSNigel Croxon #define EFI_RNG_ALGORITHM_RAW                          \
12809b0fe34eSNigel Croxon      {0xe43176d7, 0xb6e8, 0x4827, {0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61} }
12819b0fe34eSNigel Croxon 
12829b0fe34eSNigel Croxon INTERFACE_DECL(_EFI_RNG_PROTOCOL);
12839b0fe34eSNigel Croxon 
12849b0fe34eSNigel Croxon typedef
12859b0fe34eSNigel Croxon EFI_STATUS
12869b0fe34eSNigel Croxon (EFIAPI *EFI_RNG_GET_INFO) (
12879b0fe34eSNigel Croxon   IN      struct _EFI_RNG_PROTOCOL   *This,
12889b0fe34eSNigel Croxon   IN OUT  UINTN                      *RNGAlgorithmListSize,
12899b0fe34eSNigel Croxon   OUT     EFI_RNG_ALGORITHM          *RNGAlgorithmList
12909b0fe34eSNigel Croxon );
12919b0fe34eSNigel Croxon 
12929b0fe34eSNigel Croxon typedef
12939b0fe34eSNigel Croxon EFI_STATUS
12949b0fe34eSNigel Croxon (EFIAPI *EFI_RNG_GET_RNG) (
12959b0fe34eSNigel Croxon   IN      struct _EFI_RNG_PROTOCOL   *This,
12969b0fe34eSNigel Croxon   IN      EFI_RNG_ALGORITHM          *RNGAlgorithm,           OPTIONAL
12979b0fe34eSNigel Croxon   IN      UINTN                      RNGValueLength,
12989b0fe34eSNigel Croxon   OUT     UINT8                      *RNGValue
12999b0fe34eSNigel Croxon );
13009b0fe34eSNigel Croxon 
13019b0fe34eSNigel Croxon typedef struct _EFI_RNG_PROTOCOL {
13029b0fe34eSNigel Croxon           EFI_RNG_GET_INFO           GetInfo;
13039b0fe34eSNigel Croxon           EFI_RNG_GET_RNG            GetRNG;
13049b0fe34eSNigel Croxon } EFI_RNG_PROTOCOL;
13059b0fe34eSNigel Croxon 
13069b0fe34eSNigel Croxon 
130763213a7bSNigel Croxon //
130863213a7bSNigel Croxon // EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL
130963213a7bSNigel Croxon //
131063213a7bSNigel Croxon 
131163213a7bSNigel Croxon #define EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID          \
131263213a7bSNigel Croxon           { 0x6b30c738, 0xa391, 0x11d4, {0x9a, 0x3b, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
131363213a7bSNigel Croxon 
131463213a7bSNigel Croxon INTERFACE_DECL(_EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL);
131563213a7bSNigel Croxon 
131663213a7bSNigel Croxon typedef
131763213a7bSNigel Croxon EFI_STATUS
131863213a7bSNigel Croxon (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER) (
131963213a7bSNigel Croxon IN      struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL  *This,
132063213a7bSNigel Croxon IN      EFI_HANDLE                                      ControllerHandle,
132163213a7bSNigel Croxon IN OUT  EFI_HANDLE                                     *DriverImageHandle);
132263213a7bSNigel Croxon 
132363213a7bSNigel Croxon typedef
132463213a7bSNigel Croxon EFI_STATUS
132563213a7bSNigel Croxon (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH) (
132663213a7bSNigel Croxon IN      struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL  *This,
132763213a7bSNigel Croxon IN      EFI_HANDLE                                      ControllerHandle,
132863213a7bSNigel Croxon IN OUT  EFI_DEVICE_PATH                               **DriverImagePath);
132963213a7bSNigel Croxon 
133063213a7bSNigel Croxon typedef
133163213a7bSNigel Croxon EFI_STATUS
133263213a7bSNigel Croxon (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED) (
133363213a7bSNigel Croxon IN      struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL  *This,
133463213a7bSNigel Croxon IN      EFI_HANDLE                                      ControllerHandle,
133563213a7bSNigel Croxon IN      EFI_DEVICE_PATH                                *DriverImagePath,
133663213a7bSNigel Croxon IN      EFI_HANDLE                                      DriverImageHandle);
133763213a7bSNigel Croxon 
133863213a7bSNigel Croxon typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL {
133963213a7bSNigel Croxon   EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER       GetDriver;
134063213a7bSNigel Croxon   EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH  GetDriverPath;
134163213a7bSNigel Croxon   EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED    DriverLoaded;
134263213a7bSNigel Croxon } EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL;
134363213a7bSNigel Croxon 
134463213a7bSNigel Croxon //
134563213a7bSNigel Croxon // EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL
134663213a7bSNigel Croxon //
134763213a7bSNigel Croxon 
134863213a7bSNigel Croxon #define EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID          \
134963213a7bSNigel Croxon           { 0x3bc1b285, 0x8a15, 0x4a82, {0xaa, 0xbf, 0x4d, 0x7d, 0x13, 0xfb, 0x32, 0x65} }
135063213a7bSNigel Croxon 
135163213a7bSNigel Croxon INTERFACE_DECL(_EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL);
135263213a7bSNigel Croxon 
135363213a7bSNigel Croxon typedef
135463213a7bSNigel Croxon EFI_STATUS
135563213a7bSNigel Croxon (EFIAPI *EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER) (
135663213a7bSNigel Croxon IN      struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL  *This,
135763213a7bSNigel Croxon IN OUT  EFI_HANDLE                                         *DriverImageHandle);
135863213a7bSNigel Croxon 
135963213a7bSNigel Croxon typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL {
136063213a7bSNigel Croxon   EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER       GetDriver;
136163213a7bSNigel Croxon } EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL;
136263213a7bSNigel Croxon 
136363213a7bSNigel Croxon //
136463213a7bSNigel Croxon // EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL
136563213a7bSNigel Croxon //
136663213a7bSNigel Croxon 
136763213a7bSNigel Croxon #define EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID          \
136863213a7bSNigel Croxon           { 0xb1ee129e, 0xda36, 0x4181, {0x91, 0xf8, 0x04, 0xa4, 0x92, 0x37, 0x66, 0xa7} }
136963213a7bSNigel Croxon 
137063213a7bSNigel Croxon INTERFACE_DECL(_EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL);
137163213a7bSNigel Croxon 
137263213a7bSNigel Croxon typedef
137363213a7bSNigel Croxon UINT32
137463213a7bSNigel Croxon (EFIAPI *EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION) (
137563213a7bSNigel Croxon IN      struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL  *This);
137663213a7bSNigel Croxon 
137763213a7bSNigel Croxon typedef struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL {
137863213a7bSNigel Croxon   EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION       GetVersion;
137963213a7bSNigel Croxon } EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL;
138063213a7bSNigel Croxon 
1381447ad9aaSNigel Croxon //
1382447ad9aaSNigel Croxon // EFI_EBC_PROTOCOL
1383447ad9aaSNigel Croxon //
1384447ad9aaSNigel Croxon 
1385447ad9aaSNigel Croxon #define EFI_EBC_INTERPRETER_PROTOCOL_GUID              \
1386447ad9aaSNigel Croxon      {0x13ac6dd1, 0x73d0, 0x11d4, {0xb0, 0x6b, 0x00, 0xaa, 0x00, 0xbd, 0x6d, 0xe7} }
1387447ad9aaSNigel Croxon 
1388447ad9aaSNigel Croxon #define EFI_EBC_PROTOCOL_GUID EFI_EBC_INTERPRETER_PROTOCOL_GUID
1389447ad9aaSNigel Croxon 
1390447ad9aaSNigel Croxon INTERFACE_DECL(_EFI_EBC_PROTOCOL);
1391447ad9aaSNigel Croxon 
1392447ad9aaSNigel Croxon typedef
1393447ad9aaSNigel Croxon EFI_STATUS
1394447ad9aaSNigel Croxon (EFIAPI *EFI_EBC_CREATE_THUNK)(
1395447ad9aaSNigel Croxon   IN struct _EFI_EBC_PROTOCOL   *This,
1396447ad9aaSNigel Croxon   IN EFI_HANDLE                 ImageHandle,
1397447ad9aaSNigel Croxon   IN VOID                       *EbcEntryPoint,
1398447ad9aaSNigel Croxon   OUT VOID                      **Thunk);
1399447ad9aaSNigel Croxon 
1400447ad9aaSNigel Croxon typedef
1401447ad9aaSNigel Croxon EFI_STATUS
1402447ad9aaSNigel Croxon (EFIAPI *EFI_EBC_UNLOAD_IMAGE)(
1403447ad9aaSNigel Croxon   IN struct _EFI_EBC_PROTOCOL   *This,
1404447ad9aaSNigel Croxon   IN EFI_HANDLE                 ImageHandle);
1405447ad9aaSNigel Croxon 
1406447ad9aaSNigel Croxon typedef
1407447ad9aaSNigel Croxon EFI_STATUS
1408447ad9aaSNigel Croxon (EFIAPI *EBC_ICACHE_FLUSH)(
1409447ad9aaSNigel Croxon   IN EFI_PHYSICAL_ADDRESS       Start,
1410447ad9aaSNigel Croxon   IN UINT64                     Length);
1411447ad9aaSNigel Croxon 
1412447ad9aaSNigel Croxon typedef
1413447ad9aaSNigel Croxon EFI_STATUS
1414447ad9aaSNigel Croxon (EFIAPI *EFI_EBC_REGISTER_ICACHE_FLUSH)(
1415447ad9aaSNigel Croxon   IN struct _EFI_EBC_PROTOCOL   *This,
1416447ad9aaSNigel Croxon   IN EBC_ICACHE_FLUSH           Flush);
1417447ad9aaSNigel Croxon 
1418447ad9aaSNigel Croxon typedef
1419447ad9aaSNigel Croxon EFI_STATUS
1420447ad9aaSNigel Croxon (EFIAPI *EFI_EBC_GET_VERSION)(
1421447ad9aaSNigel Croxon   IN struct _EFI_EBC_PROTOCOL   *This,
1422447ad9aaSNigel Croxon   IN OUT UINT64                 *Version);
1423447ad9aaSNigel Croxon 
1424447ad9aaSNigel Croxon typedef struct _EFI_EBC_PROTOCOL {
1425447ad9aaSNigel Croxon   EFI_EBC_CREATE_THUNK          CreateThunk;
1426447ad9aaSNigel Croxon   EFI_EBC_UNLOAD_IMAGE          UnloadImage;
1427447ad9aaSNigel Croxon   EFI_EBC_REGISTER_ICACHE_FLUSH RegisterICacheFlush;
1428447ad9aaSNigel Croxon   EFI_EBC_GET_VERSION           GetVersion;
1429447ad9aaSNigel Croxon } EFI_EBC_PROTOCOL;
143063213a7bSNigel Croxon 
1431*ce625f35SPeter Jones INTERFACE_DECL(_EFI_MEMORY_ATTRIBUTE_PROTOCOL);
1432*ce625f35SPeter Jones 
1433*ce625f35SPeter Jones typedef
1434*ce625f35SPeter Jones EFI_STATUS
1435*ce625f35SPeter Jones (EFIAPI *EFI_GET_MEMORY_ATTRIBUTES)(
1436*ce625f35SPeter Jones   IN struct _EFI_MEMORY_ATTRIBUTE_PROTOCOL      *This,
1437*ce625f35SPeter Jones   IN EFI_PHYSICAL_ADDRESS                       BaseAddress,
1438*ce625f35SPeter Jones   IN UINT64                                     Length,
1439*ce625f35SPeter Jones   OUT UINT64                                    *Attributes
1440*ce625f35SPeter Jones   );
1441*ce625f35SPeter Jones 
1442*ce625f35SPeter Jones typedef
1443*ce625f35SPeter Jones EFI_STATUS
1444*ce625f35SPeter Jones (EFIAPI *EFI_SET_MEMORY_ATTRIBUTES)(
1445*ce625f35SPeter Jones   IN struct _EFI_MEMORY_ATTRIBUTE_PROTOCOL      *This,
1446*ce625f35SPeter Jones   IN EFI_PHYSICAL_ADDRESS                       BaseAddress,
1447*ce625f35SPeter Jones   IN UINT64                                     Length,
1448*ce625f35SPeter Jones   IN UINT64                                     Attributes
1449*ce625f35SPeter Jones   );
1450*ce625f35SPeter Jones 
1451*ce625f35SPeter Jones typedef
1452*ce625f35SPeter Jones EFI_STATUS
1453*ce625f35SPeter Jones (EFIAPI *EFI_CLEAR_MEMORY_ATTRIBUTES)(
1454*ce625f35SPeter Jones   IN struct _EFI_MEMORY_ATTRIBUTE_PROTOCOL      *This,
1455*ce625f35SPeter Jones   IN EFI_PHYSICAL_ADDRESS                       BaseAddress,
1456*ce625f35SPeter Jones   IN UINT64                                     Length,
1457*ce625f35SPeter Jones   IN UINT64                                     Attributes
1458*ce625f35SPeter Jones   );
1459*ce625f35SPeter Jones 
1460*ce625f35SPeter Jones typedef struct _EFI_MEMORY_ATTRIBUTE_PROTOCOL {
1461*ce625f35SPeter Jones   EFI_GET_MEMORY_ATTRIBUTES     GetMemoryAttributes;
1462*ce625f35SPeter Jones   EFI_SET_MEMORY_ATTRIBUTES     SetMemoryAttributes;
1463*ce625f35SPeter Jones   EFI_CLEAR_MEMORY_ATTRIBUTES   ClearMemoryAttributes;
1464*ce625f35SPeter Jones } EFI_MEMORY_ATTRIBUTE_PROTOCOL;
1465*ce625f35SPeter Jones 
1466530d68baSNigel Croxon #endif
1467