xref: /DragonStub/inc/efiapi.h (revision 2604d7835e66d1fccc0973634b0121c7925e25f6)
1530d68baSNigel Croxon #ifndef _EFI_API_H
2530d68baSNigel Croxon #define _EFI_API_H
3530d68baSNigel Croxon 
4*2604d783SLoGin #include <efidevp.h>
5*2604d783SLoGin #include <efiprot.h>
6*2604d783SLoGin #include <eficon.h>
7*2604d783SLoGin 
8530d68baSNigel Croxon /*++
9530d68baSNigel Croxon 
10530d68baSNigel Croxon Copyright (c) 1998  Intel Corporation
11530d68baSNigel Croxon 
12530d68baSNigel Croxon Module Name:
13530d68baSNigel Croxon 
14530d68baSNigel Croxon     efiapi.h
15530d68baSNigel Croxon 
16530d68baSNigel Croxon Abstract:
17530d68baSNigel Croxon 
18530d68baSNigel Croxon     Global EFI runtime & boot service interfaces
19530d68baSNigel Croxon 
20530d68baSNigel Croxon 
21530d68baSNigel Croxon 
22530d68baSNigel Croxon 
23530d68baSNigel Croxon Revision History
24530d68baSNigel Croxon 
25530d68baSNigel Croxon --*/
26530d68baSNigel Croxon 
27530d68baSNigel Croxon //
28530d68baSNigel Croxon // EFI Specification Revision
29530d68baSNigel Croxon //
30530d68baSNigel Croxon 
317c6975aaSCallum Farmer #define EFI_SPECIFICATION_REVISION_MAJORMINOR(major, minor) ((major<<16) | (minor))
32530d68baSNigel Croxon #define EFI_SPECIFICATION_MAJOR_REVISION 1
33530d68baSNigel Croxon #define EFI_SPECIFICATION_MINOR_REVISION 02
347c6975aaSCallum Farmer #define EFI_SPECIFICATION_VERSION EFI_SPECIFICATION_REVISION_MAJORMINOR(EFI_SPECIFICATION_MAJOR_REVISION, EFI_SPECIFICATION_MINOR_REVISION)
35530d68baSNigel Croxon 
36530d68baSNigel Croxon //
37530d68baSNigel Croxon // Declare forward referenced data structures
38530d68baSNigel Croxon //
39530d68baSNigel Croxon 
40530d68baSNigel Croxon INTERFACE_DECL(_EFI_SYSTEM_TABLE);
41530d68baSNigel Croxon 
42530d68baSNigel Croxon //
43530d68baSNigel Croxon // EFI Memory
44530d68baSNigel Croxon //
45530d68baSNigel Croxon 
46530d68baSNigel Croxon typedef
47530d68baSNigel Croxon EFI_STATUS
48530d68baSNigel Croxon (EFIAPI *EFI_ALLOCATE_PAGES) (
49530d68baSNigel Croxon     IN EFI_ALLOCATE_TYPE            Type,
50530d68baSNigel Croxon     IN EFI_MEMORY_TYPE              MemoryType,
51530d68baSNigel Croxon     IN UINTN                        NoPages,
52530d68baSNigel Croxon     OUT EFI_PHYSICAL_ADDRESS        *Memory
53530d68baSNigel Croxon     );
54530d68baSNigel Croxon 
55530d68baSNigel Croxon typedef
56530d68baSNigel Croxon EFI_STATUS
57530d68baSNigel Croxon (EFIAPI *EFI_FREE_PAGES) (
58530d68baSNigel Croxon     IN EFI_PHYSICAL_ADDRESS         Memory,
59530d68baSNigel Croxon     IN UINTN                        NoPages
60530d68baSNigel Croxon     );
61530d68baSNigel Croxon 
62530d68baSNigel Croxon typedef
63530d68baSNigel Croxon EFI_STATUS
64530d68baSNigel Croxon (EFIAPI *EFI_GET_MEMORY_MAP) (
65530d68baSNigel Croxon     IN OUT UINTN                    *MemoryMapSize,
66530d68baSNigel Croxon     IN OUT EFI_MEMORY_DESCRIPTOR    *MemoryMap,
67530d68baSNigel Croxon     OUT UINTN                       *MapKey,
68530d68baSNigel Croxon     OUT UINTN                       *DescriptorSize,
69530d68baSNigel Croxon     OUT UINT32                      *DescriptorVersion
70530d68baSNigel Croxon     );
71530d68baSNigel Croxon 
72530d68baSNigel Croxon #define NextMemoryDescriptor(Ptr,Size)  ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) Ptr) + Size))
73530d68baSNigel Croxon 
74530d68baSNigel Croxon 
75530d68baSNigel Croxon typedef
76530d68baSNigel Croxon EFI_STATUS
77530d68baSNigel Croxon (EFIAPI *EFI_ALLOCATE_POOL) (
78530d68baSNigel Croxon     IN EFI_MEMORY_TYPE              PoolType,
79530d68baSNigel Croxon     IN UINTN                        Size,
80530d68baSNigel Croxon     OUT VOID                        **Buffer
81530d68baSNigel Croxon     );
82530d68baSNigel Croxon 
83530d68baSNigel Croxon typedef
84530d68baSNigel Croxon EFI_STATUS
85530d68baSNigel Croxon (EFIAPI *EFI_FREE_POOL) (
86530d68baSNigel Croxon     IN VOID                         *Buffer
87530d68baSNigel Croxon     );
88530d68baSNigel Croxon 
89530d68baSNigel Croxon typedef
90530d68baSNigel Croxon EFI_STATUS
91530d68baSNigel Croxon (EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) (
92530d68baSNigel Croxon     IN UINTN                        MemoryMapSize,
93530d68baSNigel Croxon     IN UINTN                        DescriptorSize,
94530d68baSNigel Croxon     IN UINT32                       DescriptorVersion,
95530d68baSNigel Croxon     IN EFI_MEMORY_DESCRIPTOR        *VirtualMap
96530d68baSNigel Croxon     );
97530d68baSNigel Croxon 
98530d68baSNigel Croxon 
99530d68baSNigel Croxon #define EFI_OPTIONAL_PTR            0x00000001
100530d68baSNigel Croxon #define EFI_INTERNAL_FNC            0x00000002      // Pointer to internal runtime fnc
101530d68baSNigel Croxon #define EFI_INTERNAL_PTR            0x00000004      // Pointer to internal runtime data
102530d68baSNigel Croxon 
103530d68baSNigel Croxon 
104530d68baSNigel Croxon typedef
105530d68baSNigel Croxon EFI_STATUS
106530d68baSNigel Croxon (EFIAPI *EFI_CONVERT_POINTER) (
107530d68baSNigel Croxon     IN UINTN                        DebugDisposition,
108530d68baSNigel Croxon     IN OUT VOID                     **Address
109530d68baSNigel Croxon     );
110530d68baSNigel Croxon 
111530d68baSNigel Croxon 
112530d68baSNigel Croxon //
113530d68baSNigel Croxon // EFI Events
114530d68baSNigel Croxon //
115530d68baSNigel Croxon 
116530d68baSNigel Croxon #define EVT_TIMER                           0x80000000
117530d68baSNigel Croxon #define EVT_RUNTIME                         0x40000000
118530d68baSNigel Croxon #define EVT_RUNTIME_CONTEXT                 0x20000000
119530d68baSNigel Croxon 
120530d68baSNigel Croxon #define EVT_NOTIFY_WAIT                     0x00000100
121530d68baSNigel Croxon #define EVT_NOTIFY_SIGNAL                   0x00000200
122530d68baSNigel Croxon 
123530d68baSNigel Croxon #define EVT_SIGNAL_EXIT_BOOT_SERVICES       0x00000201
124530d68baSNigel Croxon #define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE   0x60000202
125530d68baSNigel Croxon 
126530d68baSNigel Croxon #define EVT_EFI_SIGNAL_MASK                 0x000000FF
1279cdd67daSNigel Croxon #define EVT_EFI_SIGNAL_MAX                  4
1289cdd67daSNigel Croxon 
1299cdd67daSNigel Croxon #define EFI_EVENT_TIMER                         EVT_TIMER
1309cdd67daSNigel Croxon #define EFI_EVENT_RUNTIME                       EVT_RUNTIME
1319cdd67daSNigel Croxon #define EFI_EVENT_RUNTIME_CONTEXT               EVT_RUNTIME_CONTEXT
1329cdd67daSNigel Croxon #define EFI_EVENT_NOTIFY_WAIT                   EVT_NOTIFY_WAIT
1339cdd67daSNigel Croxon #define EFI_EVENT_NOTIFY_SIGNAL                 EVT_NOTIFY_SIGNAL
1349cdd67daSNigel Croxon #define EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES     EVT_SIGNAL_EXIT_BOOT_SERVICES
1359cdd67daSNigel Croxon #define EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE
1369cdd67daSNigel Croxon #define EFI_EVENT_EFI_SIGNAL_MASK               EVT_EFI_SIGNAL_MASK
1379cdd67daSNigel Croxon #define EFI_EVENT_EFI_SIGNAL_MAX                EVT_EFI_SIGNAL_MAX
1389cdd67daSNigel Croxon 
139530d68baSNigel Croxon 
140530d68baSNigel Croxon typedef
141530d68baSNigel Croxon VOID
142530d68baSNigel Croxon (EFIAPI *EFI_EVENT_NOTIFY) (
143530d68baSNigel Croxon     IN EFI_EVENT                Event,
144530d68baSNigel Croxon     IN VOID                     *Context
145530d68baSNigel Croxon     );
146530d68baSNigel Croxon 
147530d68baSNigel Croxon typedef
148530d68baSNigel Croxon EFI_STATUS
149530d68baSNigel Croxon (EFIAPI *EFI_CREATE_EVENT) (
150530d68baSNigel Croxon     IN UINT32                       Type,
151530d68baSNigel Croxon     IN EFI_TPL                      NotifyTpl,
152530d68baSNigel Croxon     IN EFI_EVENT_NOTIFY             NotifyFunction,
153530d68baSNigel Croxon     IN VOID                         *NotifyContext,
154530d68baSNigel Croxon     OUT EFI_EVENT                   *Event
155530d68baSNigel Croxon     );
156530d68baSNigel Croxon 
157530d68baSNigel Croxon typedef enum {
158530d68baSNigel Croxon     TimerCancel,
159530d68baSNigel Croxon     TimerPeriodic,
160530d68baSNigel Croxon     TimerRelative,
161530d68baSNigel Croxon     TimerTypeMax
162530d68baSNigel Croxon } EFI_TIMER_DELAY;
163530d68baSNigel Croxon 
164530d68baSNigel Croxon typedef
165530d68baSNigel Croxon EFI_STATUS
166530d68baSNigel Croxon (EFIAPI *EFI_SET_TIMER) (
167530d68baSNigel Croxon     IN EFI_EVENT                Event,
168530d68baSNigel Croxon     IN EFI_TIMER_DELAY          Type,
169530d68baSNigel Croxon     IN UINT64                   TriggerTime
170530d68baSNigel Croxon     );
171530d68baSNigel Croxon 
172530d68baSNigel Croxon typedef
173530d68baSNigel Croxon EFI_STATUS
174530d68baSNigel Croxon (EFIAPI *EFI_SIGNAL_EVENT) (
175530d68baSNigel Croxon     IN EFI_EVENT                Event
176530d68baSNigel Croxon     );
177530d68baSNigel Croxon 
178530d68baSNigel Croxon typedef
179530d68baSNigel Croxon EFI_STATUS
180530d68baSNigel Croxon (EFIAPI *EFI_WAIT_FOR_EVENT) (
181530d68baSNigel Croxon     IN UINTN                    NumberOfEvents,
182530d68baSNigel Croxon     IN EFI_EVENT                *Event,
183530d68baSNigel Croxon     OUT UINTN                   *Index
184530d68baSNigel Croxon     );
185530d68baSNigel Croxon 
186530d68baSNigel Croxon typedef
187530d68baSNigel Croxon EFI_STATUS
188530d68baSNigel Croxon (EFIAPI *EFI_CLOSE_EVENT) (
189530d68baSNigel Croxon     IN EFI_EVENT                Event
190530d68baSNigel Croxon     );
191530d68baSNigel Croxon 
192530d68baSNigel Croxon typedef
193530d68baSNigel Croxon EFI_STATUS
194530d68baSNigel Croxon (EFIAPI *EFI_CHECK_EVENT) (
195530d68baSNigel Croxon     IN EFI_EVENT                Event
196530d68baSNigel Croxon     );
197530d68baSNigel Croxon 
198530d68baSNigel Croxon //
199530d68baSNigel Croxon // Task priority level
200530d68baSNigel Croxon //
201530d68baSNigel Croxon 
202530d68baSNigel Croxon #define TPL_APPLICATION       4
203530d68baSNigel Croxon #define TPL_CALLBACK          8
204530d68baSNigel Croxon #define TPL_NOTIFY           16
205530d68baSNigel Croxon #define TPL_HIGH_LEVEL       31
2069cdd67daSNigel Croxon #define EFI_TPL_APPLICATION  TPL_APPLICATION
2079cdd67daSNigel Croxon #define EFI_TPL_CALLBACK     TPL_CALLBACK
2089cdd67daSNigel Croxon #define EFI_TPL_NOTIFY       TPL_NOTIFY
2099cdd67daSNigel Croxon #define EFI_TPL_HIGH_LEVEL   TPL_HIGH_LEVEL
210530d68baSNigel Croxon typedef
211530d68baSNigel Croxon EFI_TPL
212530d68baSNigel Croxon (EFIAPI *EFI_RAISE_TPL) (
213530d68baSNigel Croxon     IN EFI_TPL      NewTpl
214530d68baSNigel Croxon     );
215530d68baSNigel Croxon 
216530d68baSNigel Croxon typedef
217530d68baSNigel Croxon VOID
218530d68baSNigel Croxon (EFIAPI *EFI_RESTORE_TPL) (
219530d68baSNigel Croxon     IN EFI_TPL      OldTpl
220530d68baSNigel Croxon     );
221530d68baSNigel Croxon 
222530d68baSNigel Croxon 
223530d68baSNigel Croxon //
224530d68baSNigel Croxon // EFI platform varibles
225530d68baSNigel Croxon //
226530d68baSNigel Croxon 
227530d68baSNigel Croxon #define EFI_GLOBAL_VARIABLE     \
228530d68baSNigel Croxon     { 0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} }
229530d68baSNigel Croxon 
230530d68baSNigel Croxon // Variable attributes
231530d68baSNigel Croxon #define EFI_VARIABLE_NON_VOLATILE                          0x00000001
232530d68baSNigel Croxon #define EFI_VARIABLE_BOOTSERVICE_ACCESS                    0x00000002
233530d68baSNigel Croxon #define EFI_VARIABLE_RUNTIME_ACCESS                        0x00000004
234530d68baSNigel Croxon #define EFI_VARIABLE_HARDWARE_ERROR_RECORD                 0x00000008
235530d68baSNigel Croxon #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS            0x00000010
236530d68baSNigel Croxon #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
237530d68baSNigel Croxon #define EFI_VARIABLE_APPEND_WRITE                          0x00000040
2386ba063ffSPeter Jones #define EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS	   0x00000080
239530d68baSNigel Croxon 
240530d68baSNigel Croxon // Variable size limitation
241530d68baSNigel Croxon #define EFI_MAXIMUM_VARIABLE_SIZE           1024
242530d68baSNigel Croxon 
243530d68baSNigel Croxon typedef
244530d68baSNigel Croxon EFI_STATUS
245530d68baSNigel Croxon (EFIAPI *EFI_GET_VARIABLE) (
246530d68baSNigel Croxon     IN CHAR16                       *VariableName,
247530d68baSNigel Croxon     IN EFI_GUID                     *VendorGuid,
248530d68baSNigel Croxon     OUT UINT32                      *Attributes OPTIONAL,
249530d68baSNigel Croxon     IN OUT UINTN                    *DataSize,
250530d68baSNigel Croxon     OUT VOID                        *Data
251530d68baSNigel Croxon     );
252530d68baSNigel Croxon 
253530d68baSNigel Croxon typedef
254530d68baSNigel Croxon EFI_STATUS
255530d68baSNigel Croxon (EFIAPI *EFI_GET_NEXT_VARIABLE_NAME) (
256530d68baSNigel Croxon     IN OUT UINTN                    *VariableNameSize,
257530d68baSNigel Croxon     IN OUT CHAR16                   *VariableName,
258530d68baSNigel Croxon     IN OUT EFI_GUID                 *VendorGuid
259530d68baSNigel Croxon     );
260530d68baSNigel Croxon 
261530d68baSNigel Croxon 
262530d68baSNigel Croxon typedef
263530d68baSNigel Croxon EFI_STATUS
264530d68baSNigel Croxon (EFIAPI *EFI_SET_VARIABLE) (
265530d68baSNigel Croxon     IN CHAR16                       *VariableName,
266530d68baSNigel Croxon     IN EFI_GUID                     *VendorGuid,
267530d68baSNigel Croxon     IN UINT32                       Attributes,
268530d68baSNigel Croxon     IN UINTN                        DataSize,
269530d68baSNigel Croxon     IN VOID                         *Data
270530d68baSNigel Croxon     );
271530d68baSNigel Croxon 
272530d68baSNigel Croxon 
273530d68baSNigel Croxon //
274530d68baSNigel Croxon // EFI Time
275530d68baSNigel Croxon //
276530d68baSNigel Croxon 
277530d68baSNigel Croxon typedef struct {
278530d68baSNigel Croxon         UINT32                      Resolution;     // 1e-6 parts per million
279530d68baSNigel Croxon         UINT32                      Accuracy;       // hertz
280530d68baSNigel Croxon         BOOLEAN                     SetsToZero;     // Set clears sub-second time
281530d68baSNigel Croxon } EFI_TIME_CAPABILITIES;
282530d68baSNigel Croxon 
283530d68baSNigel Croxon 
284530d68baSNigel Croxon typedef
285530d68baSNigel Croxon EFI_STATUS
286530d68baSNigel Croxon (EFIAPI *EFI_GET_TIME) (
287530d68baSNigel Croxon     OUT EFI_TIME                    *Time,
288530d68baSNigel Croxon     OUT EFI_TIME_CAPABILITIES       *Capabilities OPTIONAL
289530d68baSNigel Croxon     );
290530d68baSNigel Croxon 
291530d68baSNigel Croxon typedef
292530d68baSNigel Croxon EFI_STATUS
293530d68baSNigel Croxon (EFIAPI *EFI_SET_TIME) (
294530d68baSNigel Croxon     IN EFI_TIME                     *Time
295530d68baSNigel Croxon     );
296530d68baSNigel Croxon 
297530d68baSNigel Croxon typedef
298530d68baSNigel Croxon EFI_STATUS
299530d68baSNigel Croxon (EFIAPI *EFI_GET_WAKEUP_TIME) (
300530d68baSNigel Croxon     OUT BOOLEAN                     *Enabled,
301530d68baSNigel Croxon     OUT BOOLEAN                     *Pending,
302530d68baSNigel Croxon     OUT EFI_TIME                    *Time
303530d68baSNigel Croxon     );
304530d68baSNigel Croxon 
305530d68baSNigel Croxon typedef
306530d68baSNigel Croxon EFI_STATUS
307530d68baSNigel Croxon (EFIAPI *EFI_SET_WAKEUP_TIME) (
308530d68baSNigel Croxon     IN BOOLEAN                      Enable,
309530d68baSNigel Croxon     IN EFI_TIME                     *Time OPTIONAL
310530d68baSNigel Croxon     );
311530d68baSNigel Croxon 
312530d68baSNigel Croxon 
313530d68baSNigel Croxon //
314530d68baSNigel Croxon // Image functions
315530d68baSNigel Croxon //
316530d68baSNigel Croxon 
317530d68baSNigel Croxon 
318530d68baSNigel Croxon // PE32+ Subsystem type for EFI images
319530d68baSNigel Croxon 
320530d68baSNigel Croxon #if !defined(IMAGE_SUBSYSTEM_EFI_APPLICATION)
321530d68baSNigel Croxon #define IMAGE_SUBSYSTEM_EFI_APPLICATION             10
322530d68baSNigel Croxon #define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER     11
323530d68baSNigel Croxon #define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER          12
324530d68baSNigel Croxon #endif
325530d68baSNigel Croxon 
326530d68baSNigel Croxon // PE32+ Machine type for EFI images
327530d68baSNigel Croxon 
328530d68baSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_IA32)
329530d68baSNigel Croxon #define EFI_IMAGE_MACHINE_IA32      0x014c
330530d68baSNigel Croxon #endif
331530d68baSNigel Croxon 
332530d68baSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_IA64)
333530d68baSNigel Croxon #define EFI_IMAGE_MACHINE_IA64      0x0200
334530d68baSNigel Croxon #endif
335530d68baSNigel Croxon 
3369cdd67daSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_EBC)
3379cdd67daSNigel Croxon #define EFI_IMAGE_MACHINE_EBC      0x0EBC
3389cdd67daSNigel Croxon #endif
3399cdd67daSNigel Croxon 
3409cdd67daSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_X64)
3419cdd67daSNigel Croxon #define EFI_IMAGE_MACHINE_X64       0x8664
3429cdd67daSNigel Croxon #endif
3439cdd67daSNigel Croxon 
3449cdd67daSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_ARMTHUMB_MIXED)
3459cdd67daSNigel Croxon #define EFI_IMAGE_MACHINE_ARMTHUMB_MIXED 0x01C2
3469cdd67daSNigel Croxon #endif
3479cdd67daSNigel Croxon 
3489cdd67daSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_AARCH64)
3499cdd67daSNigel Croxon #define EFI_IMAGE_MACHINE_AARCH64   0xAA64
3509cdd67daSNigel Croxon #endif
3519cdd67daSNigel Croxon 
352860b1c8cSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_RISCV32)
353860b1c8cSNigel Croxon #define EFI_IMAGE_MACHINE_RISCV32   0x5032
354860b1c8cSNigel Croxon #endif
355860b1c8cSNigel Croxon 
356860b1c8cSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_RISCV64)
357860b1c8cSNigel Croxon #define EFI_IMAGE_MACHINE_RISCV64   0x5064
358860b1c8cSNigel Croxon #endif
359860b1c8cSNigel Croxon 
360860b1c8cSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_RISCV128)
361860b1c8cSNigel Croxon #define EFI_IMAGE_MACHINE_RISCV128  0x5128
362860b1c8cSNigel Croxon #endif
363860b1c8cSNigel Croxon 
3641ba13fdfSXiaotian Wu #if !defined(EFI_IMAGE_MACHINE_LOONGARCH32)
3651ba13fdfSXiaotian Wu #define EFI_IMAGE_MACHINE_LOONGARCH32   0x6232
3661ba13fdfSXiaotian Wu #endif
3671ba13fdfSXiaotian Wu 
3681ba13fdfSXiaotian Wu #if !defined(EFI_IMAGE_MACHINE_LOONGARCH64)
3691ba13fdfSXiaotian Wu #define EFI_IMAGE_MACHINE_LOONGARCH64   0x6264
3701ba13fdfSXiaotian Wu #endif
3711ba13fdfSXiaotian Wu 
372530d68baSNigel Croxon // Image Entry prototype
373530d68baSNigel Croxon 
374530d68baSNigel Croxon typedef
375530d68baSNigel Croxon EFI_STATUS
376530d68baSNigel Croxon (EFIAPI *EFI_IMAGE_ENTRY_POINT) (
377530d68baSNigel Croxon     IN EFI_HANDLE                   ImageHandle,
378530d68baSNigel Croxon     IN struct _EFI_SYSTEM_TABLE     *SystemTable
379530d68baSNigel Croxon     );
380530d68baSNigel Croxon 
381530d68baSNigel Croxon typedef
382530d68baSNigel Croxon EFI_STATUS
383530d68baSNigel Croxon (EFIAPI *EFI_IMAGE_LOAD) (
384530d68baSNigel Croxon     IN BOOLEAN                      BootPolicy,
385530d68baSNigel Croxon     IN EFI_HANDLE                   ParentImageHandle,
386530d68baSNigel Croxon     IN EFI_DEVICE_PATH              *FilePath,
387530d68baSNigel Croxon     IN VOID                         *SourceBuffer   OPTIONAL,
388530d68baSNigel Croxon     IN UINTN                        SourceSize,
389530d68baSNigel Croxon     OUT EFI_HANDLE                  *ImageHandle
390530d68baSNigel Croxon     );
391530d68baSNigel Croxon 
392530d68baSNigel Croxon typedef
393530d68baSNigel Croxon EFI_STATUS
394530d68baSNigel Croxon (EFIAPI *EFI_IMAGE_START) (
395530d68baSNigel Croxon     IN EFI_HANDLE                   ImageHandle,
396530d68baSNigel Croxon     OUT UINTN                       *ExitDataSize,
397530d68baSNigel Croxon     OUT CHAR16                      **ExitData  OPTIONAL
398530d68baSNigel Croxon     );
399530d68baSNigel Croxon 
400530d68baSNigel Croxon typedef
401530d68baSNigel Croxon EFI_STATUS
402530d68baSNigel Croxon (EFIAPI *EFI_EXIT) (
403530d68baSNigel Croxon     IN EFI_HANDLE                   ImageHandle,
404530d68baSNigel Croxon     IN EFI_STATUS                   ExitStatus,
405530d68baSNigel Croxon     IN UINTN                        ExitDataSize,
406530d68baSNigel Croxon     IN CHAR16                       *ExitData OPTIONAL
407530d68baSNigel Croxon     );
408530d68baSNigel Croxon 
409530d68baSNigel Croxon 
410530d68baSNigel Croxon // Image handle
4113b31a5e3SNigel Croxon /*#define LOADED_IMAGE_PROTOCOL      \
412530d68baSNigel Croxon     { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
413530d68baSNigel Croxon 
414530d68baSNigel Croxon #define EFI_IMAGE_INFORMATION_REVISION      0x1000
415530d68baSNigel Croxon typedef struct {
416530d68baSNigel Croxon     UINT32                          Revision;
417530d68baSNigel Croxon     EFI_HANDLE                      ParentHandle;
418530d68baSNigel Croxon     struct _EFI_SYSTEM_TABLE        *SystemTable;
419530d68baSNigel Croxon 
420530d68baSNigel Croxon     // Source location of image
421530d68baSNigel Croxon     EFI_HANDLE                      DeviceHandle;
422530d68baSNigel Croxon     EFI_DEVICE_PATH                 *FilePath;
423530d68baSNigel Croxon     VOID                            *Reserved;
424530d68baSNigel Croxon 
425530d68baSNigel Croxon     // Images load options
426530d68baSNigel Croxon     UINT32                          LoadOptionsSize;
427530d68baSNigel Croxon     VOID                            *LoadOptions;
428530d68baSNigel Croxon 
429530d68baSNigel Croxon     // Location of where image was loaded
430530d68baSNigel Croxon     VOID                            *ImageBase;
431530d68baSNigel Croxon     UINT64                          ImageSize;
432530d68baSNigel Croxon     EFI_MEMORY_TYPE                 ImageCodeType;
433530d68baSNigel Croxon     EFI_MEMORY_TYPE                 ImageDataType;
434530d68baSNigel Croxon 
435530d68baSNigel Croxon     // If the driver image supports a dynamic unload request
436530d68baSNigel Croxon     EFI_IMAGE_UNLOAD                Unload;
437530d68baSNigel Croxon 
4383b31a5e3SNigel Croxon } EFI_LOADED_IMAGE;*/
439530d68baSNigel Croxon 
440530d68baSNigel Croxon 
441530d68baSNigel Croxon typedef
442530d68baSNigel Croxon EFI_STATUS
443530d68baSNigel Croxon (EFIAPI *EFI_EXIT_BOOT_SERVICES) (
444530d68baSNigel Croxon     IN EFI_HANDLE                   ImageHandle,
445530d68baSNigel Croxon     IN UINTN                        MapKey
446530d68baSNigel Croxon     );
447530d68baSNigel Croxon 
448530d68baSNigel Croxon //
449530d68baSNigel Croxon // Misc
450530d68baSNigel Croxon //
451530d68baSNigel Croxon 
452530d68baSNigel Croxon 
453530d68baSNigel Croxon typedef
454530d68baSNigel Croxon EFI_STATUS
455530d68baSNigel Croxon (EFIAPI *EFI_STALL) (
456530d68baSNigel Croxon     IN UINTN                    Microseconds
457530d68baSNigel Croxon     );
458530d68baSNigel Croxon 
459530d68baSNigel Croxon typedef
460530d68baSNigel Croxon EFI_STATUS
461530d68baSNigel Croxon (EFIAPI *EFI_SET_WATCHDOG_TIMER) (
462530d68baSNigel Croxon     IN UINTN                    Timeout,
463530d68baSNigel Croxon     IN UINT64                   WatchdogCode,
464530d68baSNigel Croxon     IN UINTN                    DataSize,
465530d68baSNigel Croxon     IN CHAR16                   *WatchdogData OPTIONAL
466530d68baSNigel Croxon     );
467530d68baSNigel Croxon 
468530d68baSNigel Croxon typedef
469530d68baSNigel Croxon EFI_STATUS
470530d68baSNigel Croxon (EFIAPI *EFI_CONNECT_CONTROLLER) (
471530d68baSNigel Croxon     IN EFI_HANDLE               ControllerHandle,
472530d68baSNigel Croxon     IN EFI_HANDLE               *DriverImageHandle OPTIONAL,
473530d68baSNigel Croxon     IN EFI_DEVICE_PATH          *RemainingDevicePath OPTIONAL,
474530d68baSNigel Croxon     IN BOOLEAN                  Recursive
475530d68baSNigel Croxon     );
476530d68baSNigel Croxon 
477530d68baSNigel Croxon typedef
478530d68baSNigel Croxon EFI_STATUS
479530d68baSNigel Croxon (EFIAPI *EFI_DISCONNECT_CONTROLLER) (
480530d68baSNigel Croxon     IN EFI_HANDLE               ControllerHandle,
481530d68baSNigel Croxon     IN EFI_HANDLE               DriverImageHandle OPTIONAL,
482530d68baSNigel Croxon     IN EFI_HANDLE               ChildHandle OPTIONAL
483530d68baSNigel Croxon     );
484530d68baSNigel Croxon 
485530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL  0x00000001
486530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_GET_PROTOCOL        0x00000002
487530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_TEST_PROTOCOL       0x00000004
488530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
489530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_BY_DRIVER           0x00000010
490530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_EXCLUSIVE           0x00000020
491530d68baSNigel Croxon 
492530d68baSNigel Croxon typedef
493530d68baSNigel Croxon EFI_STATUS
494530d68baSNigel Croxon (EFIAPI *EFI_OPEN_PROTOCOL) (
495530d68baSNigel Croxon     IN EFI_HANDLE               Handle,
496530d68baSNigel Croxon     IN EFI_GUID                 *Protocol,
497530d68baSNigel Croxon     OUT VOID                    **Interface OPTIONAL,
498530d68baSNigel Croxon     IN EFI_HANDLE               AgentHandle,
499530d68baSNigel Croxon     IN EFI_HANDLE               ControllerHandle,
500530d68baSNigel Croxon     IN UINT32                   Attributes
501530d68baSNigel Croxon     );
502530d68baSNigel Croxon 
503530d68baSNigel Croxon typedef
504530d68baSNigel Croxon EFI_STATUS
505530d68baSNigel Croxon (EFIAPI *EFI_CLOSE_PROTOCOL) (
506530d68baSNigel Croxon     IN EFI_HANDLE               Handle,
507530d68baSNigel Croxon     IN EFI_GUID                 *Protocol,
508530d68baSNigel Croxon     IN EFI_HANDLE               AgentHandle,
509530d68baSNigel Croxon     IN EFI_HANDLE               ControllerHandle
510530d68baSNigel Croxon     );
511530d68baSNigel Croxon 
512530d68baSNigel Croxon typedef struct {
513530d68baSNigel Croxon     EFI_HANDLE                  AgentHandle;
514530d68baSNigel Croxon     EFI_HANDLE                  ControllerHandle;
515530d68baSNigel Croxon     UINT32                      Attributes;
516530d68baSNigel Croxon     UINT32                      OpenCount;
517530d68baSNigel Croxon } EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
518530d68baSNigel Croxon 
519530d68baSNigel Croxon typedef
520530d68baSNigel Croxon EFI_STATUS
521530d68baSNigel Croxon (EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (
522530d68baSNigel Croxon     IN EFI_HANDLE               Handle,
523530d68baSNigel Croxon     IN EFI_GUID                 *Protocol,
524530d68baSNigel Croxon     OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
525530d68baSNigel Croxon     OUT UINTN                   *EntryCount
526530d68baSNigel Croxon     );
527530d68baSNigel Croxon 
528530d68baSNigel Croxon typedef
529530d68baSNigel Croxon EFI_STATUS
530530d68baSNigel Croxon (EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (
531530d68baSNigel Croxon     IN EFI_HANDLE               Handle,
532530d68baSNigel Croxon     OUT EFI_GUID                ***ProtocolBuffer,
533530d68baSNigel Croxon     OUT UINTN                   *ProtocolBufferCount
534530d68baSNigel Croxon     );
535530d68baSNigel Croxon 
536530d68baSNigel Croxon typedef enum {
537530d68baSNigel Croxon     AllHandles,
538530d68baSNigel Croxon     ByRegisterNotify,
539530d68baSNigel Croxon     ByProtocol
540530d68baSNigel Croxon } EFI_LOCATE_SEARCH_TYPE;
541530d68baSNigel Croxon 
542530d68baSNigel Croxon typedef
543530d68baSNigel Croxon EFI_STATUS
544530d68baSNigel Croxon (EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (
545530d68baSNigel Croxon     IN EFI_LOCATE_SEARCH_TYPE   SearchType,
546530d68baSNigel Croxon     IN EFI_GUID                 *Protocol OPTIONAL,
547530d68baSNigel Croxon     IN VOID                     *SearchKey OPTIONAL,
548530d68baSNigel Croxon     IN OUT UINTN                *NoHandles,
549530d68baSNigel Croxon     OUT EFI_HANDLE              **Buffer
550530d68baSNigel Croxon     );
551530d68baSNigel Croxon 
552530d68baSNigel Croxon typedef
553530d68baSNigel Croxon EFI_STATUS
554530d68baSNigel Croxon (EFIAPI *EFI_LOCATE_PROTOCOL) (
555530d68baSNigel Croxon     IN EFI_GUID                 *Protocol,
556530d68baSNigel Croxon     IN VOID                     *Registration OPTIONAL,
557530d68baSNigel Croxon     OUT VOID                    **Interface
558530d68baSNigel Croxon     );
559530d68baSNigel Croxon 
560530d68baSNigel Croxon typedef
561530d68baSNigel Croxon EFI_STATUS
562530d68baSNigel Croxon (EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
563530d68baSNigel Croxon     IN OUT EFI_HANDLE           *Handle,
564530d68baSNigel Croxon     ...
565530d68baSNigel Croxon     );
566530d68baSNigel Croxon 
567530d68baSNigel Croxon typedef
568530d68baSNigel Croxon EFI_STATUS
569530d68baSNigel Croxon (EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
570530d68baSNigel Croxon     IN OUT EFI_HANDLE           Handle,
571530d68baSNigel Croxon     ...
572530d68baSNigel Croxon     );
573530d68baSNigel Croxon 
574530d68baSNigel Croxon typedef
575530d68baSNigel Croxon EFI_STATUS
576530d68baSNigel Croxon (EFIAPI *EFI_CALCULATE_CRC32) (
577530d68baSNigel Croxon     IN VOID                     *Data,
578530d68baSNigel Croxon     IN UINTN                    DataSize,
579530d68baSNigel Croxon     OUT UINT32                  *Crc32
580530d68baSNigel Croxon     );
581530d68baSNigel Croxon 
582530d68baSNigel Croxon typedef
583530d68baSNigel Croxon VOID
584530d68baSNigel Croxon (EFIAPI *EFI_COPY_MEM) (
585530d68baSNigel Croxon     IN VOID                     *Destination,
586530d68baSNigel Croxon     IN VOID                     *Source,
587530d68baSNigel Croxon     IN UINTN                    Length
588530d68baSNigel Croxon     );
589530d68baSNigel Croxon 
590530d68baSNigel Croxon typedef
591530d68baSNigel Croxon VOID
592530d68baSNigel Croxon (EFIAPI *EFI_SET_MEM) (
593530d68baSNigel Croxon     IN VOID                     *Buffer,
594530d68baSNigel Croxon     IN UINTN                    Size,
595530d68baSNigel Croxon     IN UINT8                    Value
596530d68baSNigel Croxon     );
597530d68baSNigel Croxon 
598530d68baSNigel Croxon 
599530d68baSNigel Croxon typedef
600530d68baSNigel Croxon EFI_STATUS
601530d68baSNigel Croxon (EFIAPI *EFI_CREATE_EVENT_EX) (
602530d68baSNigel Croxon     IN UINT32                   Type,
603530d68baSNigel Croxon     IN EFI_TPL                  NotifyTpl,
604530d68baSNigel Croxon     IN EFI_EVENT_NOTIFY         NotifyFunction OPTIONAL,
605530d68baSNigel Croxon     IN const VOID               *NotifyContext OPTIONAL,
606238358c6Sleo     IN const EFI_GUID           *EventGroup OPTIONAL,
607530d68baSNigel Croxon     OUT EFI_EVENT               *Event
608530d68baSNigel Croxon     );
609530d68baSNigel Croxon 
610530d68baSNigel Croxon typedef enum {
611530d68baSNigel Croxon     EfiResetCold,
612530d68baSNigel Croxon     EfiResetWarm,
613530d68baSNigel Croxon     EfiResetShutdown
614530d68baSNigel Croxon } EFI_RESET_TYPE;
615530d68baSNigel Croxon 
616530d68baSNigel Croxon typedef
617530d68baSNigel Croxon EFI_STATUS
618530d68baSNigel Croxon (EFIAPI *EFI_RESET_SYSTEM) (
619530d68baSNigel Croxon     IN EFI_RESET_TYPE           ResetType,
620530d68baSNigel Croxon     IN EFI_STATUS               ResetStatus,
621530d68baSNigel Croxon     IN UINTN                    DataSize,
622530d68baSNigel Croxon     IN CHAR16                   *ResetData OPTIONAL
623530d68baSNigel Croxon     );
624530d68baSNigel Croxon 
625530d68baSNigel Croxon typedef
626530d68baSNigel Croxon EFI_STATUS
627530d68baSNigel Croxon (EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT) (
628530d68baSNigel Croxon     OUT UINT64                  *Count
629530d68baSNigel Croxon     );
630530d68baSNigel Croxon 
631530d68baSNigel Croxon typedef
632530d68baSNigel Croxon EFI_STATUS
633530d68baSNigel Croxon (EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) (
634530d68baSNigel Croxon     OUT UINT32                  *HighCount
635530d68baSNigel Croxon     );
636530d68baSNigel Croxon 
637530d68baSNigel Croxon typedef struct {
638530d68baSNigel Croxon     UINT64                      Length;
639530d68baSNigel Croxon     union {
640530d68baSNigel Croxon         EFI_PHYSICAL_ADDRESS    DataBlock;
641530d68baSNigel Croxon        EFI_PHYSICAL_ADDRESS    ContinuationPointer;
642530d68baSNigel Croxon     } Union;
643530d68baSNigel Croxon } EFI_CAPSULE_BLOCK_DESCRIPTOR;
644530d68baSNigel Croxon 
645530d68baSNigel Croxon typedef struct {
646530d68baSNigel Croxon     EFI_GUID                    CapsuleGuid;
647530d68baSNigel Croxon     UINT32                      HeaderSize;
648530d68baSNigel Croxon     UINT32                      Flags;
649530d68baSNigel Croxon     UINT32                      CapsuleImageSize;
650530d68baSNigel Croxon } EFI_CAPSULE_HEADER;
651530d68baSNigel Croxon 
652530d68baSNigel Croxon #define CAPSULE_FLAGS_PERSIST_ACROSS_RESET    0x00010000
653530d68baSNigel Croxon #define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE   0x00020000
654530d68baSNigel Croxon #define CAPSULE_FLAGS_INITIATE_RESET          0x00040000
655530d68baSNigel Croxon 
656530d68baSNigel Croxon typedef
657530d68baSNigel Croxon EFI_STATUS
658530d68baSNigel Croxon (EFIAPI *EFI_UPDATE_CAPSULE) (
659530d68baSNigel Croxon     IN EFI_CAPSULE_HEADER       **CapsuleHeaderArray,
660530d68baSNigel Croxon     IN UINTN                    CapsuleCount,
661530d68baSNigel Croxon     IN EFI_PHYSICAL_ADDRESS     ScatterGatherList OPTIONAL
662530d68baSNigel Croxon     );
663530d68baSNigel Croxon 
664530d68baSNigel Croxon typedef
665530d68baSNigel Croxon EFI_STATUS
666530d68baSNigel Croxon (EFIAPI *EFI_QUERY_CAPSULE_CAPABILITIES) (
667530d68baSNigel Croxon     IN  EFI_CAPSULE_HEADER       **CapsuleHeaderArray,
668530d68baSNigel Croxon     IN  UINTN                    CapsuleCount,
669530d68baSNigel Croxon     OUT UINT64                   *MaximumCapsuleSize,
670530d68baSNigel Croxon     OUT EFI_RESET_TYPE           *ResetType
671530d68baSNigel Croxon     );
672530d68baSNigel Croxon 
673530d68baSNigel Croxon typedef
674530d68baSNigel Croxon EFI_STATUS
675530d68baSNigel Croxon (EFIAPI *EFI_QUERY_VARIABLE_INFO) (
676530d68baSNigel Croxon     IN  UINT32                  Attributes,
677530d68baSNigel Croxon     OUT UINT64                  *MaximumVariableStorageSize,
678530d68baSNigel Croxon     OUT UINT64                  *RemainingVariableStorageSize,
679530d68baSNigel Croxon     OUT UINT64                  *MaximumVariableSize
680530d68baSNigel Croxon     );
681530d68baSNigel Croxon 
682530d68baSNigel Croxon //
683530d68baSNigel Croxon // Protocol handler functions
684530d68baSNigel Croxon //
685530d68baSNigel Croxon 
686530d68baSNigel Croxon typedef enum {
687530d68baSNigel Croxon     EFI_NATIVE_INTERFACE,
688530d68baSNigel Croxon     EFI_PCODE_INTERFACE
689530d68baSNigel Croxon } EFI_INTERFACE_TYPE;
690530d68baSNigel Croxon 
691530d68baSNigel Croxon typedef
692530d68baSNigel Croxon EFI_STATUS
693530d68baSNigel Croxon (EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) (
694530d68baSNigel Croxon     IN OUT EFI_HANDLE           *Handle,
695530d68baSNigel Croxon     IN EFI_GUID                 *Protocol,
696530d68baSNigel Croxon     IN EFI_INTERFACE_TYPE       InterfaceType,
697530d68baSNigel Croxon     IN VOID                     *Interface
698530d68baSNigel Croxon     );
699530d68baSNigel Croxon 
700530d68baSNigel Croxon typedef
701530d68baSNigel Croxon EFI_STATUS
702530d68baSNigel Croxon (EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE) (
703530d68baSNigel Croxon     IN EFI_HANDLE               Handle,
704530d68baSNigel Croxon     IN EFI_GUID                 *Protocol,
705530d68baSNigel Croxon     IN VOID                     *OldInterface,
706530d68baSNigel Croxon     IN VOID                     *NewInterface
707530d68baSNigel Croxon     );
708530d68baSNigel Croxon 
709530d68baSNigel Croxon typedef
710530d68baSNigel Croxon EFI_STATUS
711530d68baSNigel Croxon (EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE) (
712530d68baSNigel Croxon     IN EFI_HANDLE               Handle,
713530d68baSNigel Croxon     IN EFI_GUID                 *Protocol,
714530d68baSNigel Croxon     IN VOID                     *Interface
715530d68baSNigel Croxon     );
716530d68baSNigel Croxon 
717530d68baSNigel Croxon typedef
718530d68baSNigel Croxon EFI_STATUS
719530d68baSNigel Croxon (EFIAPI *EFI_HANDLE_PROTOCOL) (
720530d68baSNigel Croxon     IN EFI_HANDLE               Handle,
721530d68baSNigel Croxon     IN EFI_GUID                 *Protocol,
722530d68baSNigel Croxon     OUT VOID                    **Interface
723530d68baSNigel Croxon     );
724530d68baSNigel Croxon 
725530d68baSNigel Croxon typedef
726530d68baSNigel Croxon EFI_STATUS
727530d68baSNigel Croxon (EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) (
728530d68baSNigel Croxon     IN EFI_GUID                 *Protocol,
729530d68baSNigel Croxon     IN EFI_EVENT                Event,
730530d68baSNigel Croxon     OUT VOID                    **Registration
731530d68baSNigel Croxon     );
732530d68baSNigel Croxon 
733530d68baSNigel Croxon typedef
734530d68baSNigel Croxon EFI_STATUS
735530d68baSNigel Croxon (EFIAPI *EFI_LOCATE_HANDLE) (
736530d68baSNigel Croxon     IN EFI_LOCATE_SEARCH_TYPE   SearchType,
737530d68baSNigel Croxon     IN EFI_GUID                 *Protocol OPTIONAL,
738530d68baSNigel Croxon     IN VOID                     *SearchKey OPTIONAL,
739530d68baSNigel Croxon     IN OUT UINTN                *BufferSize,
740530d68baSNigel Croxon     OUT EFI_HANDLE              *Buffer
741530d68baSNigel Croxon     );
742530d68baSNigel Croxon 
743530d68baSNigel Croxon typedef
744530d68baSNigel Croxon EFI_STATUS
745530d68baSNigel Croxon (EFIAPI *EFI_LOCATE_DEVICE_PATH) (
746530d68baSNigel Croxon     IN EFI_GUID                 *Protocol,
747530d68baSNigel Croxon     IN OUT EFI_DEVICE_PATH      **DevicePath,
748530d68baSNigel Croxon     OUT EFI_HANDLE              *Device
749530d68baSNigel Croxon     );
750530d68baSNigel Croxon 
751530d68baSNigel Croxon typedef
752530d68baSNigel Croxon EFI_STATUS
753530d68baSNigel Croxon (EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) (
754530d68baSNigel Croxon     IN EFI_GUID                 *Guid,
755530d68baSNigel Croxon     IN VOID                     *Table
756530d68baSNigel Croxon     );
757530d68baSNigel Croxon 
758530d68baSNigel Croxon typedef
759530d68baSNigel Croxon EFI_STATUS
760530d68baSNigel Croxon (EFIAPI *EFI_RESERVED_SERVICE) (
761530d68baSNigel Croxon     );
762530d68baSNigel Croxon 
763530d68baSNigel Croxon //
764530d68baSNigel Croxon // Standard EFI table header
765530d68baSNigel Croxon //
766530d68baSNigel Croxon 
767530d68baSNigel Croxon typedef struct _EFI_TABLE_HEADER {
768530d68baSNigel Croxon     UINT64                      Signature;
769530d68baSNigel Croxon     UINT32                      Revision;
770530d68baSNigel Croxon     UINT32                      HeaderSize;
771530d68baSNigel Croxon     UINT32                      CRC32;
772530d68baSNigel Croxon     UINT32                      Reserved;
773530d68baSNigel Croxon } EFI_TABLE_HEADER;
774530d68baSNigel Croxon 
775530d68baSNigel Croxon 
776530d68baSNigel Croxon //
777530d68baSNigel Croxon // EFI Runtime Serivces Table
778530d68baSNigel Croxon //
779530d68baSNigel Croxon 
780530d68baSNigel Croxon #define EFI_RUNTIME_SERVICES_SIGNATURE      0x56524553544e5552
7817c6975aaSCallum Farmer #define EFI_1_02_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(1, 02)
7827c6975aaSCallum Farmer #define EFI_1_10_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(1, 10)
7837c6975aaSCallum Farmer #define EFI_2_00_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 00)
7847c6975aaSCallum Farmer #define EFI_2_10_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 10)
7857c6975aaSCallum Farmer #define EFI_2_20_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 20)
7867c6975aaSCallum Farmer #define EFI_2_30_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 30)
7877c6975aaSCallum Farmer #define EFI_2_31_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 31)
7887c6975aaSCallum Farmer #define EFI_2_40_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 40)
7897c6975aaSCallum Farmer #define EFI_2_50_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 50)
7907c6975aaSCallum Farmer #define EFI_2_60_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 60)
7917c6975aaSCallum Farmer #define EFI_2_70_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 70)
7927c6975aaSCallum Farmer #define EFI_2_80_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 80)
7937c6975aaSCallum Farmer #define EFI_2_90_RUNTIME_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 90)
7947c6975aaSCallum Farmer #define EFI_2_100_RUNTIME_SERVICES_REVISION EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 100)
7957c6975aaSCallum Farmer #define EFI_RUNTIME_SERVICES_REVISION       EFI_SPECIFICATION_VERSION
796530d68baSNigel Croxon 
797530d68baSNigel Croxon typedef struct  {
798530d68baSNigel Croxon     EFI_TABLE_HEADER                Hdr;
799530d68baSNigel Croxon 
800530d68baSNigel Croxon     //
801530d68baSNigel Croxon     // Time services
802530d68baSNigel Croxon     //
803530d68baSNigel Croxon 
804530d68baSNigel Croxon     EFI_GET_TIME                    GetTime;
805530d68baSNigel Croxon     EFI_SET_TIME                    SetTime;
806530d68baSNigel Croxon     EFI_GET_WAKEUP_TIME             GetWakeupTime;
807530d68baSNigel Croxon     EFI_SET_WAKEUP_TIME             SetWakeupTime;
808530d68baSNigel Croxon 
809530d68baSNigel Croxon     //
810530d68baSNigel Croxon     // Virtual memory services
811530d68baSNigel Croxon     //
812530d68baSNigel Croxon 
813530d68baSNigel Croxon     EFI_SET_VIRTUAL_ADDRESS_MAP     SetVirtualAddressMap;
814530d68baSNigel Croxon     EFI_CONVERT_POINTER             ConvertPointer;
815530d68baSNigel Croxon 
816530d68baSNigel Croxon     //
817530d68baSNigel Croxon     // Variable serviers
818530d68baSNigel Croxon     //
819530d68baSNigel Croxon 
820530d68baSNigel Croxon     EFI_GET_VARIABLE                GetVariable;
821530d68baSNigel Croxon     EFI_GET_NEXT_VARIABLE_NAME      GetNextVariableName;
822530d68baSNigel Croxon     EFI_SET_VARIABLE                SetVariable;
823530d68baSNigel Croxon 
824530d68baSNigel Croxon     //
825530d68baSNigel Croxon     // Misc
826530d68baSNigel Croxon     //
827530d68baSNigel Croxon 
828530d68baSNigel Croxon     EFI_GET_NEXT_HIGH_MONO_COUNT    GetNextHighMonotonicCount;
829530d68baSNigel Croxon     EFI_RESET_SYSTEM                ResetSystem;
830530d68baSNigel Croxon 
831530d68baSNigel Croxon     EFI_UPDATE_CAPSULE              UpdateCapsule;
832530d68baSNigel Croxon     EFI_QUERY_CAPSULE_CAPABILITIES  QueryCapsuleCapabilities;
833530d68baSNigel Croxon     EFI_QUERY_VARIABLE_INFO         QueryVariableInfo;
834530d68baSNigel Croxon } EFI_RUNTIME_SERVICES;
835530d68baSNigel Croxon 
836530d68baSNigel Croxon 
837530d68baSNigel Croxon //
838530d68baSNigel Croxon // EFI Boot Services Table
839530d68baSNigel Croxon //
840530d68baSNigel Croxon 
841530d68baSNigel Croxon #define EFI_BOOT_SERVICES_SIGNATURE      0x56524553544f4f42
8427c6975aaSCallum Farmer #define EFI_1_02_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(1, 02)
8437c6975aaSCallum Farmer #define EFI_1_10_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(1, 10)
8447c6975aaSCallum Farmer #define EFI_2_00_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 00)
8457c6975aaSCallum Farmer #define EFI_2_10_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 10)
8467c6975aaSCallum Farmer #define EFI_2_20_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 20)
8477c6975aaSCallum Farmer #define EFI_2_30_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 30)
8487c6975aaSCallum Farmer #define EFI_2_31_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 31)
8497c6975aaSCallum Farmer #define EFI_2_40_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 40)
8507c6975aaSCallum Farmer #define EFI_2_50_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 50)
8517c6975aaSCallum Farmer #define EFI_2_60_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 60)
8527c6975aaSCallum Farmer #define EFI_2_70_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 70)
8537c6975aaSCallum Farmer #define EFI_2_80_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 80)
8547c6975aaSCallum Farmer #define EFI_2_90_BOOT_SERVICES_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 90)
8557c6975aaSCallum Farmer #define EFI_2_100_BOOT_SERVICES_REVISION EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 100)
8567c6975aaSCallum Farmer #define EFI_BOOT_SERVICES_REVISION       EFI_SPECIFICATION_VERSION
857530d68baSNigel Croxon 
858530d68baSNigel Croxon typedef struct _EFI_BOOT_SERVICES {
859530d68baSNigel Croxon 
860530d68baSNigel Croxon     EFI_TABLE_HEADER                Hdr;
861530d68baSNigel Croxon 
862530d68baSNigel Croxon     //
863530d68baSNigel Croxon     // Task priority functions
864530d68baSNigel Croxon     //
865530d68baSNigel Croxon 
866530d68baSNigel Croxon     EFI_RAISE_TPL                   RaiseTPL;
867530d68baSNigel Croxon     EFI_RESTORE_TPL                 RestoreTPL;
868530d68baSNigel Croxon 
869530d68baSNigel Croxon     //
870530d68baSNigel Croxon     // Memory functions
871530d68baSNigel Croxon     //
872530d68baSNigel Croxon 
873530d68baSNigel Croxon     EFI_ALLOCATE_PAGES              AllocatePages;
874530d68baSNigel Croxon     EFI_FREE_PAGES                  FreePages;
875530d68baSNigel Croxon     EFI_GET_MEMORY_MAP              GetMemoryMap;
876530d68baSNigel Croxon     EFI_ALLOCATE_POOL               AllocatePool;
877530d68baSNigel Croxon     EFI_FREE_POOL                   FreePool;
878530d68baSNigel Croxon 
879530d68baSNigel Croxon     //
880530d68baSNigel Croxon     // Event & timer functions
881530d68baSNigel Croxon     //
882530d68baSNigel Croxon 
883530d68baSNigel Croxon     EFI_CREATE_EVENT                CreateEvent;
884530d68baSNigel Croxon     EFI_SET_TIMER                   SetTimer;
885530d68baSNigel Croxon     EFI_WAIT_FOR_EVENT              WaitForEvent;
886530d68baSNigel Croxon     EFI_SIGNAL_EVENT                SignalEvent;
887530d68baSNigel Croxon     EFI_CLOSE_EVENT                 CloseEvent;
888530d68baSNigel Croxon     EFI_CHECK_EVENT                 CheckEvent;
889530d68baSNigel Croxon 
890530d68baSNigel Croxon     //
891530d68baSNigel Croxon     // Protocol handler functions
892530d68baSNigel Croxon     //
893530d68baSNigel Croxon 
894530d68baSNigel Croxon     EFI_INSTALL_PROTOCOL_INTERFACE  InstallProtocolInterface;
895530d68baSNigel Croxon     EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
896530d68baSNigel Croxon     EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
897530d68baSNigel Croxon     EFI_HANDLE_PROTOCOL             HandleProtocol;
898530d68baSNigel Croxon     EFI_HANDLE_PROTOCOL             PCHandleProtocol;
899530d68baSNigel Croxon     EFI_REGISTER_PROTOCOL_NOTIFY    RegisterProtocolNotify;
900530d68baSNigel Croxon     EFI_LOCATE_HANDLE               LocateHandle;
901530d68baSNigel Croxon     EFI_LOCATE_DEVICE_PATH          LocateDevicePath;
902530d68baSNigel Croxon     EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
903530d68baSNigel Croxon 
904530d68baSNigel Croxon     //
905530d68baSNigel Croxon     // Image functions
906530d68baSNigel Croxon     //
907530d68baSNigel Croxon 
908530d68baSNigel Croxon     EFI_IMAGE_LOAD                  LoadImage;
909530d68baSNigel Croxon     EFI_IMAGE_START                 StartImage;
910530d68baSNigel Croxon     EFI_EXIT                        Exit;
911530d68baSNigel Croxon     EFI_IMAGE_UNLOAD                UnloadImage;
912530d68baSNigel Croxon     EFI_EXIT_BOOT_SERVICES          ExitBootServices;
913530d68baSNigel Croxon 
914530d68baSNigel Croxon     //
915530d68baSNigel Croxon     // Misc functions
916530d68baSNigel Croxon     //
917530d68baSNigel Croxon 
918530d68baSNigel Croxon     EFI_GET_NEXT_MONOTONIC_COUNT    GetNextMonotonicCount;
919530d68baSNigel Croxon     EFI_STALL                       Stall;
920530d68baSNigel Croxon     EFI_SET_WATCHDOG_TIMER          SetWatchdogTimer;
921530d68baSNigel Croxon 
922530d68baSNigel Croxon     //
923530d68baSNigel Croxon     // DriverSupport Services
924530d68baSNigel Croxon     //
925530d68baSNigel Croxon 
926530d68baSNigel Croxon     EFI_CONNECT_CONTROLLER          ConnectController;
927530d68baSNigel Croxon     EFI_DISCONNECT_CONTROLLER       DisconnectController;
928530d68baSNigel Croxon 
929530d68baSNigel Croxon     //
930530d68baSNigel Croxon     // Open and Close Protocol Services
931530d68baSNigel Croxon     //
932530d68baSNigel Croxon     EFI_OPEN_PROTOCOL               OpenProtocol;
933530d68baSNigel Croxon     EFI_CLOSE_PROTOCOL              CloseProtocol;
934530d68baSNigel Croxon     EFI_OPEN_PROTOCOL_INFORMATION   OpenProtocolInformation;
935530d68baSNigel Croxon 
936530d68baSNigel Croxon     //
937530d68baSNigel Croxon     // Library Services
938530d68baSNigel Croxon     //
939530d68baSNigel Croxon     EFI_PROTOCOLS_PER_HANDLE        ProtocolsPerHandle;
940530d68baSNigel Croxon     EFI_LOCATE_HANDLE_BUFFER        LocateHandleBuffer;
941530d68baSNigel Croxon     EFI_LOCATE_PROTOCOL             LocateProtocol;
942530d68baSNigel Croxon     EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
943530d68baSNigel Croxon     EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;
944530d68baSNigel Croxon 
945530d68baSNigel Croxon     //
946530d68baSNigel Croxon     // 32-bit CRC Services
947530d68baSNigel Croxon     //
948530d68baSNigel Croxon     EFI_CALCULATE_CRC32             CalculateCrc32;
949530d68baSNigel Croxon 
950530d68baSNigel Croxon     //
951530d68baSNigel Croxon     // Misc Services
952530d68baSNigel Croxon     //
953530d68baSNigel Croxon     EFI_COPY_MEM                    CopyMem;
954530d68baSNigel Croxon     EFI_SET_MEM                     SetMem;
955530d68baSNigel Croxon     EFI_CREATE_EVENT_EX             CreateEventEx;
956530d68baSNigel Croxon } EFI_BOOT_SERVICES;
957530d68baSNigel Croxon 
958530d68baSNigel Croxon 
959530d68baSNigel Croxon //
960530d68baSNigel Croxon // EFI Configuration Table and GUID definitions
961530d68baSNigel Croxon //
962530d68baSNigel Croxon 
963530d68baSNigel Croxon #define MPS_TABLE_GUID    \
964530d68baSNigel Croxon     { 0xeb9d2d2f, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
965530d68baSNigel Croxon 
966530d68baSNigel Croxon #define ACPI_TABLE_GUID    \
967530d68baSNigel Croxon     { 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
968530d68baSNigel Croxon 
969530d68baSNigel Croxon #define ACPI_20_TABLE_GUID  \
970530d68baSNigel Croxon     { 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} }
971530d68baSNigel Croxon 
972530d68baSNigel Croxon #define SMBIOS_TABLE_GUID    \
973530d68baSNigel Croxon     { 0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
974530d68baSNigel Croxon 
975ef81c051SNigel Croxon #define SMBIOS3_TABLE_GUID    \
976ef81c051SNigel Croxon     { 0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94} }
977ef81c051SNigel Croxon 
978530d68baSNigel Croxon #define SAL_SYSTEM_TABLE_GUID    \
979530d68baSNigel Croxon     { 0xeb9d2d32, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
980530d68baSNigel Croxon 
981fbbbf47eSAlfonso Sánchez-Beato #define EFI_DTB_TABLE_GUID \
982fbbbf47eSAlfonso Sánchez-Beato     { 0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0} }
983530d68baSNigel Croxon 
984530d68baSNigel Croxon typedef struct _EFI_CONFIGURATION_TABLE {
985530d68baSNigel Croxon     EFI_GUID                VendorGuid;
986530d68baSNigel Croxon     VOID                    *VendorTable;
987530d68baSNigel Croxon } EFI_CONFIGURATION_TABLE;
988530d68baSNigel Croxon 
989530d68baSNigel Croxon 
990530d68baSNigel Croxon //
991530d68baSNigel Croxon // EFI System Table
992530d68baSNigel Croxon //
993530d68baSNigel Croxon 
994530d68baSNigel Croxon 
995530d68baSNigel Croxon 
996530d68baSNigel Croxon 
997530d68baSNigel Croxon #define EFI_SYSTEM_TABLE_SIGNATURE      0x5453595320494249
9987c6975aaSCallum Farmer #define EFI_1_02_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(1, 02)
9997c6975aaSCallum Farmer #define EFI_1_10_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(1, 10)
10007c6975aaSCallum Farmer #define EFI_2_00_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 00)
10017c6975aaSCallum Farmer #define EFI_2_10_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 10)
10027c6975aaSCallum Farmer #define EFI_2_20_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 20)
10037c6975aaSCallum Farmer #define EFI_2_30_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 30)
10047c6975aaSCallum Farmer #define EFI_2_31_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 31)
10057c6975aaSCallum Farmer #define EFI_2_40_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 40)
10067c6975aaSCallum Farmer #define EFI_2_50_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 50)
10077c6975aaSCallum Farmer #define EFI_2_60_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 60)
10087c6975aaSCallum Farmer #define EFI_2_70_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 70)
10097c6975aaSCallum Farmer #define EFI_2_80_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 80)
10107c6975aaSCallum Farmer #define EFI_2_90_SYSTEM_TABLE_REVISION  EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 90)
10117c6975aaSCallum Farmer #define EFI_2_100_SYSTEM_TABLE_REVISION EFI_SPECIFICATION_REVISION_MAJORMINOR(2, 100)
10127c6975aaSCallum Farmer #define EFI_SYSTEM_TABLE_REVISION       EFI_SPECIFICATION_VERSION
1013530d68baSNigel Croxon 
1014530d68baSNigel Croxon typedef struct _EFI_SYSTEM_TABLE {
1015530d68baSNigel Croxon     EFI_TABLE_HEADER                Hdr;
1016530d68baSNigel Croxon 
1017530d68baSNigel Croxon     CHAR16                          *FirmwareVendor;
1018530d68baSNigel Croxon     UINT32                          FirmwareRevision;
1019530d68baSNigel Croxon 
1020530d68baSNigel Croxon     EFI_HANDLE                      ConsoleInHandle;
1021530d68baSNigel Croxon     SIMPLE_INPUT_INTERFACE          *ConIn;
1022530d68baSNigel Croxon 
1023530d68baSNigel Croxon     EFI_HANDLE                      ConsoleOutHandle;
1024530d68baSNigel Croxon     SIMPLE_TEXT_OUTPUT_INTERFACE    *ConOut;
1025530d68baSNigel Croxon 
1026530d68baSNigel Croxon     EFI_HANDLE                      StandardErrorHandle;
1027530d68baSNigel Croxon     SIMPLE_TEXT_OUTPUT_INTERFACE    *StdErr;
1028530d68baSNigel Croxon 
1029530d68baSNigel Croxon     EFI_RUNTIME_SERVICES            *RuntimeServices;
1030530d68baSNigel Croxon     EFI_BOOT_SERVICES               *BootServices;
1031530d68baSNigel Croxon 
1032530d68baSNigel Croxon     UINTN                           NumberOfTableEntries;
1033530d68baSNigel Croxon     EFI_CONFIGURATION_TABLE         *ConfigurationTable;
1034530d68baSNigel Croxon 
1035530d68baSNigel Croxon } EFI_SYSTEM_TABLE;
1036530d68baSNigel Croxon 
1037530d68baSNigel Croxon #endif
1038530d68baSNigel Croxon 
1039