Move definition of EFI_PARTITION_ENTRY_STATUS from IndustryStandard in MDE Package...
[mirror_edk2.git] / MdePkg / Include / Uefi / UefiSpec.h
CommitLineData
959ccb23 1/** @file\r
2 Include file that supportes UEFI.\r
3\r
4 This include file must only contain things defined in the UEFI 2.0 specification.\r
5 If a code construct is defined in the UEFI 2.0 specification it must be included\r
6 by this include file.\r
7\r
8 Copyright (c) 2006 - 2007, Intel Corporation\r
9 All rights reserved. This program and the accompanying materials\r
10 are licensed and made available under the terms and conditions of the BSD License\r
11 which accompanies this distribution. The full text of the license may be found at\r
12 http://opensource.org/licenses/bsd-license.php\r
13\r
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16\r
959ccb23 17**/\r
18\r
19#ifndef __UEFI_SPEC_H__\r
20#define __UEFI_SPEC_H__\r
21\r
22#include <Uefi/UefiMultiPhase.h>\r
23\r
24#include <Protocol/DevicePath.h>\r
25#include <Protocol/SimpleTextIn.h>\r
26#include <Protocol/SimpleTextOut.h>\r
27\r
8b13229b 28///\r
29/// Enumeration of memory allocation.\r
30///\r
959ccb23 31typedef enum {\r
32 AllocateAnyPages,\r
33 AllocateMaxAddress,\r
34 AllocateAddress,\r
35 MaxAllocateType\r
36} EFI_ALLOCATE_TYPE;\r
37\r
5413e8e8 38//\r
39// Bit definitions for EFI_TIME.Daylight\r
40//\r
41#define EFI_TIME_ADJUST_DAYLIGHT 0x01\r
42#define EFI_TIME_IN_DAYLIGHT 0x02\r
43\r
8b13229b 44///\r
45/// Value definition for EFI_TIME.TimeZone\r
46///\r
5413e8e8 47#define EFI_UNSPECIFIED_TIMEZONE 0x07FF\r
959ccb23 48\r
49//\r
50// possible caching types for the memory range\r
51//\r
52#define EFI_MEMORY_UC 0x0000000000000001ULL\r
53#define EFI_MEMORY_WC 0x0000000000000002ULL\r
54#define EFI_MEMORY_WT 0x0000000000000004ULL\r
55#define EFI_MEMORY_WB 0x0000000000000008ULL\r
56#define EFI_MEMORY_UCE 0x0000000000000010ULL\r
57\r
58//\r
59// physical memory protection on range\r
60//\r
00edb218
A
61#define EFI_MEMORY_WP 0x0000000000001000ULL\r
62#define EFI_MEMORY_RP 0x0000000000002000ULL\r
63#define EFI_MEMORY_XP 0x0000000000004000ULL\r
959ccb23 64\r
8b13229b 65///\r
66/// range requires a runtime mapping\r
67///\r
959ccb23 68#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL\r
69\r
70#define EFI_MEMORY_DESCRIPTOR_VERSION 1\r
71typedef struct {\r
00edb218
A
72 UINT32 Type;\r
73 EFI_PHYSICAL_ADDRESS PhysicalStart;\r
74 EFI_VIRTUAL_ADDRESS VirtualStart;\r
75 UINT64 NumberOfPages;\r
76 UINT64 Attribute;\r
959ccb23 77} EFI_MEMORY_DESCRIPTOR;\r
78\r
8b13229b 79///\r
80/// Build macros to find next EFI_MEMORY_DESCRIPTOR.\r
81///\r
959ccb23 82#define NextMemoryDescriptor(_Ptr, _Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size)))\r
83#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size) NextMemoryDescriptor (_Ptr, _Size)\r
84\r
8b13229b 85///\r
86/// Declare forward referenced data structures\r
87///\r
959ccb23 88typedef struct _EFI_SYSTEM_TABLE EFI_SYSTEM_TABLE;\r
89\r
90/**\r
91 Allocates memory pages from the system.\r
92\r
93 @param Type The type of allocation to perform.\r
94 @param MemoryType The type of memory to allocate.\r
95 @param Pages The number of contiguous 4 KB pages to allocate.\r
96 @param Memory Pointer to a physical address. On input, the way in which the address is\r
97 used depends on the value of Type.\r
98\r
99 @retval EFI_SUCCESS The requested pages were allocated.\r
100 @retval EFI_INVALID_PARAMETER 1) Type is not AllocateAnyPages or\r
101 AllocateMaxAddress or AllocateAddress.\r
102 2) MemoryType is in the range\r
103 EfiMaxMemoryType..0x7FFFFFFF.\r
104 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.\r
105 @retval EFI_NOT_FOUND The requested pages could not be found.\r
106\r
107**/\r
108typedef\r
109EFI_STATUS\r
8b13229b 110(EFIAPI *EFI_ALLOCATE_PAGES)(\r
959ccb23 111 IN EFI_ALLOCATE_TYPE Type,\r
112 IN EFI_MEMORY_TYPE MemoryType,\r
113 IN UINTN Pages,\r
114 IN OUT EFI_PHYSICAL_ADDRESS *Memory\r
115 );\r
116\r
117/**\r
118 Frees memory pages.\r
119\r
120 @param Memory The base physical address of the pages to be freed.\r
121 @param Pages The number of contiguous 4 KB pages to free.\r
122\r
123 @retval EFI_SUCCESS The requested pages were freed.\r
124 @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.\r
125 @retval EFI_NOT_FOUND The requested memory pages were not allocated with\r
126 AllocatePages().\r
127\r
128**/\r
129typedef\r
130EFI_STATUS\r
8b13229b 131(EFIAPI *EFI_FREE_PAGES)(\r
959ccb23 132 IN EFI_PHYSICAL_ADDRESS Memory,\r
133 IN UINTN Pages\r
134 );\r
135\r
136/**\r
137 Returns the current memory map.\r
138\r
139 @param MemoryMapSize A pointer to the size, in bytes, of the MemoryMap buffer.\r
140 @param MemoryMap A pointer to the buffer in which firmware places the current memory\r
141 map.\r
142 @param MapKey A pointer to the location in which firmware returns the key for the\r
143 current memory map.\r
144 @param DescriptorSize A pointer to the location in which firmware returns the size, in bytes, of\r
145 an individual EFI_MEMORY_DESCRIPTOR.\r
146 @param DescriptorVersion A pointer to the location in which firmware returns the version number\r
147 associated with the EFI_MEMORY_DESCRIPTOR.\r
148\r
149 @retval EFI_SUCCESS The memory map was returned in the MemoryMap buffer.\r
150 @retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current buffer size\r
151 needed to hold the memory map is returned in MemoryMapSize.\r
152 @retval EFI_INVALID_PARAMETER 1) MemoryMapSize is NULL.\r
153 2) The MemoryMap buffer is not too small and MemoryMap is\r
154 NULL.\r
155\r
156**/\r
157typedef\r
158EFI_STATUS\r
8b13229b 159(EFIAPI *EFI_GET_MEMORY_MAP)(\r
959ccb23 160 IN OUT UINTN *MemoryMapSize,\r
161 IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,\r
162 OUT UINTN *MapKey,\r
163 OUT UINTN *DescriptorSize,\r
164 OUT UINT32 *DescriptorVersion\r
165 );\r
166\r
167/**\r
168 Allocates pool memory.\r
169\r
170 @param PoolType The type of pool to allocate.\r
171 @param Size The number of bytes to allocate from the pool.\r
172 @param Buffer A pointer to a pointer to the allocated buffer if the call succeeds;\r
173 undefined otherwise.\r
174\r
175 @retval EFI_SUCCESS The requested number of bytes was allocated.\r
176 @retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated.\r
177 @retval EFI_INVALID_PARAMETER PoolType was invalid.\r
178\r
179**/\r
180typedef\r
181EFI_STATUS\r
8b13229b 182(EFIAPI *EFI_ALLOCATE_POOL)(\r
959ccb23 183 IN EFI_MEMORY_TYPE PoolType,\r
184 IN UINTN Size,\r
185 OUT VOID **Buffer\r
186 );\r
187\r
188/**\r
189 Returns pool memory to the system.\r
190\r
191 @param Buffer Pointer to the buffer to free.\r
192\r
193 @retval EFI_SUCCESS The memory was returned to the system.\r
194 @retval EFI_INVALID_PARAMETER Buffer was invalid.\r
195\r
196**/\r
197typedef\r
198EFI_STATUS\r
8b13229b 199(EFIAPI *EFI_FREE_POOL)(\r
959ccb23 200 IN VOID *Buffer\r
201 );\r
202\r
203/**\r
204 Changes the runtime addressing mode of EFI firmware from physical to virtual.\r
205\r
206 @param MemoryMapSize The size in bytes of VirtualMap.\r
207 @param DescriptorSize The size in bytes of an entry in the VirtualMap.\r
208 @param DescriptorVersion The version of the structure entries in VirtualMap.\r
209 @param VirtualMap An array of memory descriptors which contain new virtual\r
210 address mapping information for all runtime ranges.\r
211\r
212 @retval EFI_SUCCESS The virtual address map has been applied.\r
213 @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in\r
214 virtual address mapped mode.\r
215 @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.\r
216 @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory\r
217 map that requires a mapping.\r
218 @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found\r
219 in the memory map.\r
220\r
221**/\r
222typedef\r
223EFI_STATUS\r
8b13229b 224(EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP)(\r
959ccb23 225 IN UINTN MemoryMapSize,\r
226 IN UINTN DescriptorSize,\r
227 IN UINT32 DescriptorVersion,\r
228 IN EFI_MEMORY_DESCRIPTOR *VirtualMap\r
229 );\r
230\r
231/**\r
232 Connects one or more drivers to a controller.\r
233\r
234 @param ControllerHandle The handle of the controller to which driver(s) are to be connected.\r
235 @param DriverImageHandle A pointer to an ordered list handles that support the\r
236 EFI_DRIVER_BINDING_PROTOCOL.\r
237 @param RemainingDevicePath A pointer to the device path that specifies a child of the\r
238 controller specified by ControllerHandle.\r
239 @param Recursive If TRUE, then ConnectController() is called recursively\r
240 until the entire tree of controllers below the controller specified\r
241 by ControllerHandle have been created. If FALSE, then\r
242 the tree of controllers is only expanded one level.\r
243\r
244 @retval EFI_SUCCESS 1) One or more drivers were connected to ControllerHandle.\r
245 2) No drivers were connected to ControllerHandle, but\r
246 RemainingDevicePath is not NULL, and it is an End Device\r
247 Path Node.\r
248 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
249 @retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances\r
250 present in the system.\r
251 2) No drivers were connected to ControllerHandle.\r
252\r
253**/\r
254typedef\r
255EFI_STATUS\r
8b13229b 256(EFIAPI *EFI_CONNECT_CONTROLLER)(\r
959ccb23 257 IN EFI_HANDLE ControllerHandle,\r
258 IN EFI_HANDLE *DriverImageHandle, OPTIONAL\r
259 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath, OPTIONAL\r
260 IN BOOLEAN Recursive\r
261 );\r
262\r
263/**\r
264 Disconnects one or more drivers from a controller.\r
265\r
266 @param ControllerHandle The handle of the controller from which driver(s) are to be disconnected.\r
267 @param DriverImageHandle The driver to disconnect from ControllerHandle.\r
268 @param ChildHandle The handle of the child to destroy.\r
269\r
270 @retval EFI_SUCCESS 1) One or more drivers were disconnected from the controller.\r
271 2) On entry, no drivers are managing ControllerHandle.\r
272 3) DriverImageHandle is not NULL, and on entry\r
273 DriverImageHandle is not managing ControllerHandle.\r
274\r
275 @retval EFI_INVALID_PARAMETER One ore more parameters are invalid.\r
276 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to disconnect any drivers from\r
277 ControllerHandle.\r
278 @retval EFI_DEVICE_ERROR The controller could not be disconnected because of a device error.\r
279\r
280**/\r
281typedef\r
282EFI_STATUS\r
8b13229b 283(EFIAPI *EFI_DISCONNECT_CONTROLLER)(\r
959ccb23 284 IN EFI_HANDLE ControllerHandle,\r
285 IN EFI_HANDLE DriverImageHandle, OPTIONAL\r
286 IN EFI_HANDLE ChildHandle OPTIONAL\r
287 );\r
288\r
289\r
290\r
291//\r
292// ConvertPointer DebugDisposition type.\r
293//\r
294#define EFI_OPTIONAL_PTR 0x00000001\r
295#define EFI_OPTIONAL_POINTER EFI_OPTIONAL_PTR\r
296\r
297/**\r
298 Determines the new virtual address that is to be used on subsequent memory accesses.\r
299\r
300 @param DebugDisposition Supplies type information for the pointer being converted.\r
301 @param Address A pointer to a pointer that is to be fixed to be the value needed\r
302 for the new virtual address mappings being applied.\r
303\r
304 @retval EFI_SUCCESS The pointer pointed to by Address was modified.\r
305 @retval EFI_INVALID_PARAMETER 1) Address is NULL.\r
306 2) *Address is NULL and DebugDisposition does\r
307 not have the EFI_OPTIONAL_PTR bit set.\r
308 @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part\r
309 of the current memory map. This is normally fatal.\r
310\r
311**/\r
312typedef\r
313EFI_STATUS\r
8b13229b 314(EFIAPI *EFI_CONVERT_POINTER)(\r
959ccb23 315 IN UINTN DebugDisposition,\r
316 IN OUT VOID **Address\r
317 );\r
318\r
319\r
320//\r
ac644614 321// These types can be ORed together as needed - for example,\r
93ce5aca 322// EVT_TIMER might be Ored with EVT_NOTIFY_WAIT or\r
959ccb23 323// EVT_NOTIFY_SIGNAL.\r
324//\r
00edb218
A
325#define EVT_TIMER 0x80000000\r
326#define EVT_RUNTIME 0x40000000\r
00edb218
A
327#define EVT_NOTIFY_WAIT 0x00000100\r
328#define EVT_NOTIFY_SIGNAL 0x00000200\r
93ce5aca 329\r
00edb218 330#define EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201\r
93ce5aca 331#define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202\r
959ccb23 332\r
333//\r
ac644614 334// The event's NotifyContext pointer points to a runtime memory\r
d0c64728 335// address.\r
959ccb23 336// The event is deprecated in UEFI2.0 and later specifications.\r
d0c64728 337//\r
959ccb23 338#define EVT_RUNTIME_CONTEXT 0x20000000\r
339\r
340\r
341/**\r
342 Invoke a notification event\r
343\r
344 @param Event Event whose notification function is being invoked.\r
345 @param Context Pointer to the notification function's context,\r
346 which is implementation-dependent.\r
347\r
348**/\r
349typedef\r
350VOID\r
8b13229b 351(EFIAPI *EFI_EVENT_NOTIFY)(\r
959ccb23 352 IN EFI_EVENT Event,\r
353 IN VOID *Context\r
354 );\r
355\r
356/**\r
357 Creates an event.\r
358\r
359 @param Type The type of event to create and its mode and attributes.\r
360 @param NotifyTpl Pointer to the notification function's context.\r
361 @param NotifyFunction Pointer to the event's notification function, if any.\r
362 @param NotifyContext Pointer to the notification function's context; corresponds to parameter\r
363 Context in the notification function.\r
364 @param Event Pointer to the newly created event if the call succeeds; undefined\r
365 otherwise.\r
366\r
367 @retval EFI_SUCCESS The event structure was created.\r
368 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
369 @retval EFI_OUT_OF_RESOURCES The event could not be allocated.\r
370\r
371**/\r
372typedef\r
373EFI_STATUS\r
8b13229b 374(EFIAPI *EFI_CREATE_EVENT)(\r
959ccb23 375 IN UINT32 Type,\r
376 IN EFI_TPL NotifyTpl,\r
377 IN EFI_EVENT_NOTIFY NotifyFunction,\r
378 IN VOID *NotifyContext,\r
379 OUT EFI_EVENT *Event\r
380 );\r
381\r
382/**\r
383 Creates an event in a group.\r
384\r
385 @param Type The type of event to create and its mode and attributes.\r
386 @param NotifyTpl Pointer to the notification function's context.\r
387 @param NotifyFunction Pointer to the event's notification function, if any.\r
388 @param NotifyContext Pointer to the notification function's context; corresponds to parameter\r
389 Context in the notification function.\r
390 @param EventGroup Pointer to the unique identifier of the group to which this event belongs.\r
391 @param Event Pointer to the newly created event if the call succeeds; undefined\r
392 otherwise.\r
393\r
394 @retval EFI_SUCCESS The event structure was created.\r
395 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
396 @retval EFI_OUT_OF_RESOURCES The event could not be allocated.\r
397\r
398**/\r
399typedef\r
400EFI_STATUS\r
8b13229b 401(EFIAPI *EFI_CREATE_EVENT_EX)(\r
959ccb23 402 IN UINT32 Type,\r
403 IN EFI_TPL NotifyTpl OPTIONAL,\r
404 IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,\r
405 IN CONST VOID *NotifyContext OPTIONAL,\r
406 IN CONST EFI_GUID *EventGroup OPTIONAL,\r
407 OUT EFI_EVENT *Event\r
408 );\r
409\r
410typedef enum {\r
411 TimerCancel,\r
412 TimerPeriodic,\r
413 TimerRelative\r
414} EFI_TIMER_DELAY;\r
415\r
416/**\r
417 Sets the type of timer and the trigger time for a timer event.\r
418\r
419 @param Event The timer event that is to be signaled at the specified time.\r
420 @param Type The type of time that is specified in TriggerTime.\r
421 @param TriggerTime The number of 100ns units until the timer expires.\r
422\r
423 @retval EFI_SUCCESS The event has been set to be signaled at the requested time.\r
424 @retval EFI_INVALID_PARAMETER Event or Type is not valid.\r
425\r
426**/\r
427typedef\r
428EFI_STATUS\r
8b13229b 429(EFIAPI *EFI_SET_TIMER)(\r
959ccb23 430 IN EFI_EVENT Event,\r
431 IN EFI_TIMER_DELAY Type,\r
432 IN UINT64 TriggerTime\r
433 );\r
434\r
435/**\r
436 Signals an event.\r
437\r
438 @param Event The event to signal.\r
439\r
440 @retval EFI_SUCCESS The event has been signaled.\r
441\r
442**/\r
443typedef\r
444EFI_STATUS\r
8b13229b 445(EFIAPI *EFI_SIGNAL_EVENT)(\r
959ccb23 446 IN EFI_EVENT Event\r
447 );\r
448\r
449/**\r
450 Stops execution until an event is signaled.\r
451\r
452 @param NumberOfEvents The number of events in the Event array.\r
453 @param Event An array of EFI_EVENT.\r
454 @param Index Pointer to the index of the event which satisfied the wait condition.\r
455\r
456 @retval EFI_SUCCESS The event indicated by Index was signaled.\r
457 @retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0.\r
458 2) The event indicated by Index is of type\r
459 EVT_NOTIFY_SIGNAL.\r
460 @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION.\r
461\r
462**/\r
463typedef\r
464EFI_STATUS\r
8b13229b 465(EFIAPI *EFI_WAIT_FOR_EVENT)(\r
959ccb23 466 IN UINTN NumberOfEvents,\r
467 IN EFI_EVENT *Event,\r
468 OUT UINTN *Index\r
469 );\r
470\r
471/**\r
472 Closes an event.\r
473\r
474 @param Event The event to close.\r
475\r
476 @retval EFI_SUCCESS The event has been closed.\r
477\r
478**/\r
479typedef\r
480EFI_STATUS\r
8b13229b 481(EFIAPI *EFI_CLOSE_EVENT)(\r
959ccb23 482 IN EFI_EVENT Event\r
483 );\r
484\r
485/**\r
486 Checks whether an event is in the signaled state.\r
487\r
488 @param Event The event to check.\r
489\r
490 @retval EFI_SUCCESS The event is in the signaled state.\r
491 @retval EFI_NOT_READY The event is not in the signaled state.\r
492 @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL.\r
493\r
494**/\r
495typedef\r
496EFI_STATUS\r
8b13229b 497(EFIAPI *EFI_CHECK_EVENT)(\r
959ccb23 498 IN EFI_EVENT Event\r
499 );\r
500\r
501\r
502//\r
503// Task priority level (name defined in spec).\r
504//\r
505#define TPL_APPLICATION 4\r
506#define TPL_CALLBACK 8\r
507#define TPL_NOTIFY 16\r
508#define TPL_HIGH_LEVEL 31\r
509\r
510\r
511/**\r
512 Raises a task's priority level and returns its previous level.\r
513\r
514 @param NewTpl The new task priority level.\r
515\r
516 @retval Previous task priority level\r
517\r
518**/\r
519typedef\r
520EFI_TPL\r
8b13229b 521(EFIAPI *EFI_RAISE_TPL)(\r
959ccb23 522 IN EFI_TPL NewTpl\r
523 );\r
524\r
525/**\r
526 Restores a task's priority level to its previous value.\r
527\r
528 @param OldTpl The previous task priority level to restore\r
529\r
530**/\r
531typedef\r
532VOID\r
8b13229b 533(EFIAPI *EFI_RESTORE_TPL)(\r
959ccb23 534 IN EFI_TPL OldTpl\r
535 );\r
536\r
537/**\r
538 Returns the value of a variable.\r
539\r
540 @param VariableName A Null-terminated Unicode string that is the name of the\r
541 vendor's variable.\r
542 @param VendorGuid A unique identifier for the vendor.\r
543 @param Attributes If not NULL, a pointer to the memory location to return the\r
544 attributes bitmask for the variable.\r
545 @param DataSize On input, the size in bytes of the return Data buffer.\r
546 On output the size of data returned in Data.\r
547 @param Data The buffer to return the contents of the variable.\r
548\r
549 @retval EFI_SUCCESS The function completed successfully.\r
550 @retval EFI_NOT_FOUND The variable was not found.\r
551 @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result.\r
552 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
553 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
554\r
555**/\r
556typedef\r
557EFI_STATUS\r
8b13229b 558(EFIAPI *EFI_GET_VARIABLE)(\r
959ccb23 559 IN CHAR16 *VariableName,\r
560 IN EFI_GUID *VendorGuid,\r
561 OUT UINT32 *Attributes, OPTIONAL\r
562 IN OUT UINTN *DataSize,\r
563 OUT VOID *Data\r
564 );\r
565\r
566/**\r
567 Enumerates the current variable names.\r
568\r
569 @param VariableNameSize The size of the VariableName buffer.\r
570 @param VariableName On input, supplies the last VariableName that was returned\r
571 by GetNextVariableName(). On output, returns the Nullterminated\r
572 Unicode string of the current variable.\r
573 @param VendorGuid On input, supplies the last VendorGuid that was returned by\r
574 GetNextVariableName(). On output, returns the\r
575 VendorGuid of the current variable.\r
576\r
577 @retval EFI_SUCCESS The function completed successfully.\r
578 @retval EFI_NOT_FOUND The next variable was not found.\r
579 @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.\r
580 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
581 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
582\r
583**/\r
584typedef\r
585EFI_STATUS\r
8b13229b 586(EFIAPI *EFI_GET_NEXT_VARIABLE_NAME)(\r
959ccb23 587 IN OUT UINTN *VariableNameSize,\r
588 IN OUT CHAR16 *VariableName,\r
589 IN OUT EFI_GUID *VendorGuid\r
590 );\r
591\r
592/**\r
593 Sets the value of a variable.\r
594\r
595 @param VariableName A Null-terminated Unicode string that is the name of the\r
596 vendor's variable.\r
597 @param VendorGuid A unique identifier for the vendor.\r
598 @param Attributes Attributes bitmask to set for the variable.\r
599 @param DataSize The size in bytes of the Data buffer.\r
600 @param Data The contents for the variable.\r
601\r
602 @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as\r
603 defined by the Attributes.\r
604 @retval EFI_WRITE_PROTECTED The variable in question is read-only.\r
605 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r
606 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
607 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
608\r
609**/\r
610typedef\r
611EFI_STATUS\r
8b13229b 612(EFIAPI *EFI_SET_VARIABLE)(\r
959ccb23 613 IN CHAR16 *VariableName,\r
614 IN EFI_GUID *VendorGuid,\r
615 IN UINT32 Attributes,\r
616 IN UINTN DataSize,\r
617 IN VOID *Data\r
618 );\r
619\r
620\r
d0c64728 621//\r
959ccb23 622// This provides the capabilities of the\r
623// real time clock device as exposed through the EFI interfaces.\r
d0c64728 624//\r
959ccb23 625typedef struct {\r
00edb218
A
626 UINT32 Resolution;\r
627 UINT32 Accuracy;\r
628 BOOLEAN SetsToZero;\r
959ccb23 629} EFI_TIME_CAPABILITIES;\r
630\r
631/**\r
632 Returns the current time and date information, and the time-keeping capabilities\r
633 of the hardware platform.\r
634\r
635 @param Time A pointer to storage to receive a snapshot of the current time.\r
636 @param Capabilities An optional pointer to a buffer to receive the real time clock\r
637 device's capabilities.\r
638\r
639 @retval EFI_SUCCESS The operation completed successfully.\r
640 @retval EFI_INVALID_PARAMETER Time is NULL.\r
641 @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.\r
642\r
643**/\r
644typedef\r
645EFI_STATUS\r
8b13229b 646(EFIAPI *EFI_GET_TIME)(\r
959ccb23 647 OUT EFI_TIME *Time,\r
648 OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL\r
649 );\r
650\r
651/**\r
652 Sets the current local time and date information.\r
653\r
654 @param Time A pointer to the current time.\r
655\r
656 @retval EFI_SUCCESS The operation completed successfully.\r
657 @retval EFI_INVALID_PARAMETER A time field is out of range.\r
658 @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error.\r
659\r
660**/\r
661typedef\r
662EFI_STATUS\r
8b13229b 663(EFIAPI *EFI_SET_TIME)(\r
959ccb23 664 IN EFI_TIME *Time\r
665 );\r
666\r
667/**\r
668 Returns the current wakeup alarm clock setting.\r
669\r
670 @param Enabled Indicates if the alarm is currently enabled or disabled.\r
671 @param Pending Indicates if the alarm signal is pending and requires acknowledgement.\r
672 @param Time The current alarm setting.\r
673\r
674 @retval EFI_SUCCESS The alarm settings were returned.\r
675 @retval EFI_INVALID_PARAMETER Any parameter is NULL.\r
676 @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.\r
677\r
678**/\r
679typedef\r
680EFI_STATUS\r
8b13229b 681(EFIAPI *EFI_GET_WAKEUP_TIME)(\r
959ccb23 682 OUT BOOLEAN *Enabled,\r
683 OUT BOOLEAN *Pending,\r
684 OUT EFI_TIME *Time\r
685 );\r
686\r
687/**\r
688 Sets the system wakeup alarm clock time.\r
689\r
690 @param Enabled Enable or disable the wakeup alarm.\r
691 @param Time If Enable is TRUE, the time to set the wakeup alarm for.\r
692\r
693 @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If\r
694 Enable is FALSE, then the wakeup alarm was disabled.\r
695 @retval EFI_INVALID_PARAMETER A time field is out of range.\r
696 @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.\r
697 @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.\r
698\r
699**/\r
700typedef\r
701EFI_STATUS\r
8b13229b 702(EFIAPI *EFI_SET_WAKEUP_TIME)(\r
959ccb23 703 IN BOOLEAN Enable,\r
704 IN EFI_TIME *Time OPTIONAL\r
705 );\r
706\r
707/**\r
708 This is the declaration of an EFI image entry point. This can be the entry point to an application\r
709 written to this specification, an EFI boot service driver, or an EFI runtime driver.\r
710\r
711 @param ImageHandle Handle that identifies the loaded image.\r
712 @param SystemTable System Table for this image.\r
713\r
714 @retval EFI_SUCCESS The operation completed successfully.\r
715\r
716**/\r
717typedef\r
718EFI_STATUS\r
8b13229b 719(EFIAPI *EFI_IMAGE_ENTRY_POINT)(\r
959ccb23 720 IN EFI_HANDLE ImageHandle,\r
721 IN EFI_SYSTEM_TABLE *SystemTable\r
722 );\r
723\r
724/**\r
725 Loads an EFI image into memory.\r
726\r
727 @param BootPolicy If TRUE, indicates that the request originates from the boot\r
728 manager, and that the boot manager is attempting to load\r
729 FilePath as a boot selection. Ignored if SourceBuffer is\r
730 not NULL.\r
731 @param ParentImageHandle The caller's image handle.\r
732 @param FilePath The DeviceHandle specific file path from which the image is\r
733 loaded.\r
734 @param SourceBuffer If not NULL, a pointer to the memory location containing a copy\r
735 of the image to be loaded.\r
736 @param SourceSize The size in bytes of SourceBuffer.\r
737 @param ImageHandle Pointer to the returned image handle that is created when the\r
738 image is successfully loaded.\r
739\r
740 @retval EFI_SUCCESS Image was loaded into memory correctly.\r
741 @retval EFI_NOT_FOUND Both SourceBuffer and FilePath are NULL.\r
742 @retval EFI_INVALID_PARAMETER One or more parametes are invalid.\r
743 @retval EFI_UNSUPPORTED The image type is not supported.\r
744 @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient resources.\r
745 @retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not\r
746 understood.\r
747 @retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.\r
748\r
749**/\r
750typedef\r
751EFI_STATUS\r
8b13229b 752(EFIAPI *EFI_IMAGE_LOAD)(\r
959ccb23 753 IN BOOLEAN BootPolicy,\r
754 IN EFI_HANDLE ParentImageHandle,\r
755 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
756 IN VOID *SourceBuffer OPTIONAL,\r
757 IN UINTN SourceSize,\r
758 OUT EFI_HANDLE *ImageHandle\r
759 );\r
760\r
761/**\r
762 Transfers control to a loaded image's entry point.\r
763\r
764 @param ImageHandle Handle of image to be started.\r
765 @param ExitDataSize Pointer to the size, in bytes, of ExitData.\r
766 @param ExitData Pointer to a pointer to a data buffer that includes a Null-terminated\r
767 Unicode string, optionally followed by additional binary data.\r
768\r
769 @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image\r
770 has already been initialized with StartImage\r
771 @retval Exit code from image Exit code from image\r
772\r
773**/\r
774typedef\r
775EFI_STATUS\r
8b13229b 776(EFIAPI *EFI_IMAGE_START)(\r
959ccb23 777 IN EFI_HANDLE ImageHandle,\r
778 OUT UINTN *ExitDataSize,\r
779 OUT CHAR16 **ExitData OPTIONAL\r
780 );\r
781\r
782/**\r
783 Terminates a loaded EFI image and returns control to boot services.\r
784\r
785 @param ImageHandle Handle that identifies the image.\r
786 @param ExitStatus The image's exit code.\r
787 @param ExitDataSize The size, in bytes, of ExitData.\r
788 @param ExitData Pointer to a data buffer that includes a Null-terminated Unicode string,\r
789 optionally followed by additional binary data.\r
790\r
791 @retval EFI_SUCCESS The image specified by ImageHandle was unloaded.\r
792 @retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and\r
793 started with LoadImage() and StartImage(), but the\r
794 image is not the currently executing image.\r
795\r
796**/\r
797typedef\r
798EFI_STATUS\r
8b13229b 799(EFIAPI *EFI_EXIT)(\r
959ccb23 800 IN EFI_HANDLE ImageHandle,\r
801 IN EFI_STATUS ExitStatus,\r
802 IN UINTN ExitDataSize,\r
803 IN CHAR16 *ExitData OPTIONAL\r
804 );\r
805\r
806/**\r
807 Unloads an image.\r
808\r
809 @param ImageHandle Handle that identifies the image to be unloaded.\r
810\r
811 @retval EFI_SUCCESS The image has been unloaded.\r
812 @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.\r
813 @retval EFI_UNSUPPORTED The image has been started, and does not support unload.\r
814 @retval Exit code from the image's unload handler\r
815\r
816**/\r
817typedef\r
818EFI_STATUS\r
8b13229b 819(EFIAPI *EFI_IMAGE_UNLOAD)(\r
959ccb23 820 IN EFI_HANDLE ImageHandle\r
821 );\r
822\r
823/**\r
824 Terminates all boot services.\r
825\r
826 @param ImageHandle Handle that identifies the exiting image.\r
827 @param MapKey Key to the latest memory map.\r
828\r
829 @retval EFI_SUCCESS Boot services have been terminated.\r
830 @retval EFI_INVALID_PARAMETER MapKey is incorrect.\r
831\r
832**/\r
833typedef\r
834EFI_STATUS\r
8b13229b 835(EFIAPI *EFI_EXIT_BOOT_SERVICES)(\r
959ccb23 836 IN EFI_HANDLE ImageHandle,\r
837 IN UINTN MapKey\r
838 );\r
839\r
840/**\r
841 Induces a fine-grained stall.\r
842\r
843 @param Microseconds The number of microseconds to stall execution.\r
844\r
845 @retval EFI_SUCCESS Execution was stalled at least the requested number of\r
846 Microseconds.\r
847\r
848**/\r
849typedef\r
850EFI_STATUS\r
8b13229b 851(EFIAPI *EFI_STALL)(\r
959ccb23 852 IN UINTN Microseconds\r
853 );\r
854\r
855/**\r
856 Sets the system's watchdog timer.\r
857\r
858 @param Timeout The number of seconds to set the watchdog timer to.\r
859 @param WatchdogCode The numeric code to log on a watchdog timer timeout event.\r
860 @param DataSize The size, in bytes, of WatchdogData.\r
861 @param WatchdogData A data buffer that includes a Null-terminated Unicode string, optionally\r
862 followed by additional binary data.\r
863\r
864 @retval EFI_SUCCESS The timeout has been set.\r
865 @retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid.\r
866 @retval EFI_UNSUPPORTED The system does not have a watchdog timer.\r
867 @retval EFI_DEVICE_ERROR The watch dog timer could not be programmed due to a hardware\r
868 error.\r
869\r
870**/\r
871typedef\r
872EFI_STATUS\r
8b13229b 873(EFIAPI *EFI_SET_WATCHDOG_TIMER)(\r
959ccb23 874 IN UINTN Timeout,\r
875 IN UINT64 WatchdogCode,\r
876 IN UINTN DataSize,\r
877 IN CHAR16 *WatchdogData OPTIONAL\r
878 );\r
879\r
880//\r
881// Enumeration of reset types.\r
d0c64728 882//\r
959ccb23 883typedef enum {\r
884 EfiResetCold,\r
885 EfiResetWarm,\r
886 EfiResetShutdown,\r
981a648d 887 EfiResetUpdate\r
959ccb23 888} EFI_RESET_TYPE;\r
889\r
890/**\r
891 Resets the entire platform.\r
892\r
893 @param ResetType The type of reset to perform.\r
894 @param ResetStatus The status code for the reset.\r
895 @param DataSize The size, in bytes, of WatchdogData.\r
896 @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or\r
897 EfiResetShutdown the data buffer starts with a Null-terminated\r
898 Unicode string, optionally followed by additional binary data.\r
899\r
900**/\r
901typedef\r
902VOID\r
8b13229b 903(EFIAPI *EFI_RESET_SYSTEM)(\r
959ccb23 904 IN EFI_RESET_TYPE ResetType,\r
905 IN EFI_STATUS ResetStatus,\r
906 IN UINTN DataSize,\r
907 IN CHAR16 *ResetData OPTIONAL\r
908 );\r
909\r
910/**\r
911 Returns a monotonically increasing count for the platform.\r
912\r
913 @param Count Pointer to returned value.\r
914\r
915 @retval EFI_SUCCESS The next monotonic count was returned.\r
916 @retval EFI_INVALID_PARAMETER Count is NULL.\r
917 @retval EFI_DEVICE_ERROR The device is not functioning properly.\r
918\r
919**/\r
920typedef\r
921EFI_STATUS\r
8b13229b 922(EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT)(\r
959ccb23 923 OUT UINT64 *Count\r
924 );\r
925\r
926/**\r
927 Returns the next high 32 bits of the platform's monotonic counter.\r
928\r
929 @param HighCount Pointer to returned value.\r
930\r
931 @retval EFI_SUCCESS The next high monotonic count was returned.\r
932 @retval EFI_INVALID_PARAMETER HighCount is NULL.\r
933 @retval EFI_DEVICE_ERROR The device is not functioning properly.\r
934\r
935**/\r
936typedef\r
937EFI_STATUS\r
8b13229b 938(EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT)(\r
959ccb23 939 OUT UINT32 *HighCount\r
940 );\r
941\r
942/**\r
943 Computes and returns a 32-bit CRC for a data buffer.\r
944\r
945 @param Data A pointer to the buffer on which the 32-bit CRC is to be computed.\r
946 @param DataSize The number of bytes in the buffer Data.\r
947 @param Crc32 The 32-bit CRC that was computed for the data buffer specified by Data\r
948 and DataSize.\r
949\r
950 @retval EFI_SUCCESS The 32-bit CRC was computed for the data buffer and returned in\r
951 Crc32.\r
952 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
953\r
954**/\r
955typedef\r
956EFI_STATUS\r
8b13229b 957(EFIAPI *EFI_CALCULATE_CRC32)(\r
959ccb23 958 IN VOID *Data,\r
959 IN UINTN DataSize,\r
960 OUT UINT32 *Crc32\r
961 );\r
962\r
963/**\r
964 Copies the contents of one buffer to another buffer.\r
965\r
966 @param Destination Pointer to the destination buffer of the memory copy.\r
967 @param Source Pointer to the source buffer of the memory copy.\r
968 @param Length Number of bytes to copy from Source to Destination.\r
969\r
970**/\r
971typedef\r
972VOID\r
8b13229b 973(EFIAPI *EFI_COPY_MEM)(\r
959ccb23 974 IN VOID *Destination,\r
975 IN VOID *Source,\r
976 IN UINTN Length\r
977 );\r
978\r
979/**\r
980 The SetMem() function fills a buffer with a specified value.\r
981\r
982 @param Buffer Pointer to the buffer to fill.\r
983 @param Size Number of bytes in Buffer to fill.\r
984 @param Value Value to fill Buffer with.\r
985\r
986**/\r
987typedef\r
988VOID\r
8b13229b 989(EFIAPI *EFI_SET_MEM)(\r
959ccb23 990 IN VOID *Buffer,\r
991 IN UINTN Size,\r
992 IN UINT8 Value\r
993 );\r
994\r
995\r
996//\r
997// Protocol handler functions\r
998//\r
999typedef enum {\r
1000 EFI_NATIVE_INTERFACE\r
1001} EFI_INTERFACE_TYPE;\r
1002\r
1003/**\r
1004 Installs a protocol interface on a device handle. If the handle does not exist, it is created and added\r
1005 to the list of handles in the system. InstallMultipleProtocolInterfaces() performs\r
1006 more error checking than InstallProtocolInterface(), so it is recommended that\r
1007 InstallMultipleProtocolInterfaces() be used in place of\r
1008 InstallProtocolInterface()\r
1009\r
1010 @param Handle A pointer to the EFI_HANDLE on which the interface is to be installed.\r
1011 @param Protocol The numeric ID of the protocol interface.\r
1012 @param InterfaceType Indicates whether Interface is supplied in native form.\r
1013 @param Interface A pointer to the protocol interface.\r
1014\r
1015 @retval EFI_SUCCESS The protocol interface was installed.\r
1016 @retval EFI_OUT_OF_RESOURCES Space for a new handle could not be allocated.\r
1017 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1018\r
1019**/\r
1020typedef\r
1021EFI_STATUS\r
8b13229b 1022(EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE)(\r
959ccb23 1023 IN OUT EFI_HANDLE *Handle,\r
1024 IN EFI_GUID *Protocol,\r
1025 IN EFI_INTERFACE_TYPE InterfaceType,\r
1026 IN VOID *Interface\r
1027 );\r
1028\r
1029/**\r
1030 Installs one or more protocol interfaces into the boot services environment.\r
1031\r
1032 @param Handle The handle to install the new protocol interfaces on, or NULL if a new\r
1033 handle is to be allocated.\r
1034 @param ... A variable argument list containing pairs of protocol GUIDs and protocol\r
1035 interfaces.\r
1036\r
1037 @retval EFI_SUCCESS All the protocol interface was installed.\r
1038 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.\r
1039 @retval EFI_ALREADY_STARTED A Device Path Protocol instance was passed in that is already present in\r
1040 the handle database.\r
1041\r
1042**/\r
1043typedef\r
1044EFI_STATUS\r
8b13229b 1045(EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES)(\r
959ccb23 1046 IN OUT EFI_HANDLE *Handle,\r
1047 ...\r
1048 );\r
1049\r
1050/**\r
1051 Reinstalls a protocol interface on a device handle.\r
1052\r
1053 @param Handle Handle on which the interface is to be reinstalled.\r
1054 @param Protocol The numeric ID of the interface.\r
1055 @param OldInterface A pointer to the old interface. NULL can be used if a structure is not\r
1056 associated with Protocol.\r
1057 @param NewInterface A pointer to the new interface.\r
1058\r
1059 @retval EFI_SUCCESS The protocol interface was reinstalled.\r
1060 @retval EFI_NOT_FOUND The OldInterface on the handle was not found.\r
1061 @retval EFI_ACCESS_DENIED The protocol interface could not be reinstalled,\r
1062 because OldInterface is still being used by a\r
1063 driver that will not release it.\r
1064 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1065\r
1066**/\r
1067typedef\r
1068EFI_STATUS\r
8b13229b 1069(EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE)(\r
959ccb23 1070 IN EFI_HANDLE Handle,\r
1071 IN EFI_GUID *Protocol,\r
1072 IN VOID *OldInterface,\r
1073 IN VOID *NewInterface\r
1074 );\r
1075\r
1076/**\r
1077 Removes a protocol interface from a device handle. It is recommended that\r
1078 UninstallMultipleProtocolInterfaces() be used in place of\r
1079 UninstallProtocolInterface().\r
1080\r
1081 @param Handle The handle on which the interface was installed.\r
1082 @param Protocol The numeric ID of the interface.\r
1083 @param Interface A pointer to the interface.\r
1084\r
1085 @retval EFI_SUCCESS The interface was removed.\r
1086 @retval EFI_NOT_FOUND The interface was not found.\r
1087 @retval EFI_ACCESS_DENIED The interface was not removed because the interface\r
1088 is still being used by a driver.\r
1089 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1090\r
1091**/\r
1092typedef\r
1093EFI_STATUS\r
8b13229b 1094(EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE)(\r
959ccb23 1095 IN EFI_HANDLE Handle,\r
1096 IN EFI_GUID *Protocol,\r
1097 IN VOID *Interface\r
1098 );\r
1099\r
1100/**\r
1101 Removes one or more protocol interfaces into the boot services environment.\r
1102\r
1103 @param Handle The handle to remove the protocol interfaces from.\r
1104 @param ... A variable argument list containing pairs of protocol GUIDs and\r
1105 protocol interfaces.\r
1106\r
1107 @retval EFI_SUCCESS All the protocol interfaces were removed.\r
1108 @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.\r
1109\r
1110**/\r
1111typedef\r
1112EFI_STATUS\r
8b13229b 1113(EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES)(\r
959ccb23 1114 IN EFI_HANDLE Handle,\r
1115 ...\r
1116 );\r
1117\r
1118/**\r
1119 Queries a handle to determine if it supports a specified protocol.\r
1120\r
1121 @param Handle The handle being queried.\r
1122 @param Protocol The published unique identifier of the protocol.\r
1123 @param Interface Supplies the address where a pointer to the corresponding Protocol\r
1124 Interface is returned.\r
1125 @retval EFI_SUCCESS The interface information for the specified protocol was returned.\r
1126 @retval EFI_UNSUPPORTED The device does not support the specified protocol.\r
1127 @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.\r
1128\r
1129**/\r
1130typedef\r
1131EFI_STATUS\r
8b13229b 1132(EFIAPI *EFI_HANDLE_PROTOCOL)(\r
959ccb23 1133 IN EFI_HANDLE Handle,\r
1134 IN EFI_GUID *Protocol,\r
1135 OUT VOID **Interface\r
1136 );\r
1137\r
1138#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001\r
1139#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002\r
1140#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004\r
1141#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008\r
1142#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010\r
1143#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020\r
1144\r
1145/**\r
1146 Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the\r
1147 handle, it opens the protocol on behalf of the calling agent.\r
1148\r
1149 @param Handle The handle for the protocol interface that is being opened.\r
1150 @param Protocol The published unique identifier of the protocol.\r
1151 @param Interface Supplies the address where a pointer to the corresponding Protocol\r
1152 Interface is returned.\r
1153 @param AgentHandle The handle of the agent that is opening the protocol interface\r
1154 specified by Protocol and Interface.\r
1155 @param ControllerHandle If the agent that is opening a protocol is a driver that follows the\r
1156 UEFI Driver Model, then this parameter is the controller handle\r
1157 that requires the protocol interface. If the agent does not follow\r
1158 the UEFI Driver Model, then this parameter is optional and may\r
1159 be NULL.\r
1160 @param Attributes The open mode of the protocol interface specified by Handle\r
1161 and Protocol.\r
1162\r
1163 @retval EFI_SUCCESS An item was added to the open list for the protocol interface, and the\r
1164 protocol interface was returned in Interface.\r
1165 @retval EFI_UNSUPPORTED Handle does not support Protocol.\r
1166 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1167 @retval EFI_ACCESS_DENIED Required attributes can't be supported in current environment.\r
1168 @retval EFI_ALREADY_STARTED Item on the open list already has requierd attributes whose agent\r
1169 handle is the same as AgentHandle.\r
1170\r
1171**/\r
1172typedef\r
1173EFI_STATUS\r
8b13229b 1174(EFIAPI *EFI_OPEN_PROTOCOL)(\r
959ccb23 1175 IN EFI_HANDLE Handle,\r
1176 IN EFI_GUID *Protocol,\r
1177 OUT VOID **Interface,\r
1178 IN EFI_HANDLE AgentHandle,\r
1179 IN EFI_HANDLE ControllerHandle, OPTIONAL\r
1180 IN UINT32 Attributes\r
1181 );\r
1182\r
1183\r
1184/**\r
1185 Closes a protocol on a handle that was opened using OpenProtocol().\r
1186\r
1187 @param Handle The handle for the protocol interface that was previously opened\r
1188 with OpenProtocol(), and is now being closed.\r
1189 @param Protocol The published unique identifier of the protocol.\r
1190 @param Interface Supplies the address where a pointer to the corresponding Protocol\r
1191 Interface is returned.\r
1192 @param AgentHandle The handle of the agent that is closing the protocol interface.\r
1193 @param ControllerHandle If the agent that opened a protocol is a driver that follows the\r
1194 UEFI Driver Model, then this parameter is the controller handle\r
1195 that required the protocol interface.\r
1196\r
1197 @retval EFI_SUCCESS The protocol instance was closed.\r
1198 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1199 @retval EFI_NOT_FOUND 1) Handle does not support the protocol specified by Protocol.\r
1200 2) The protocol interface specified by Handle and Protocol is not\r
1201 currently open by AgentHandle and ControllerHandle.\r
1202\r
1203**/\r
1204typedef\r
1205EFI_STATUS\r
8b13229b 1206(EFIAPI *EFI_CLOSE_PROTOCOL)(\r
959ccb23 1207 IN EFI_HANDLE Handle,\r
1208 IN EFI_GUID *Protocol,\r
1209 IN EFI_HANDLE AgentHandle,\r
1210 IN EFI_HANDLE ControllerHandle\r
1211 );\r
1212\r
1213\r
1214typedef struct {\r
1215 EFI_HANDLE AgentHandle;\r
1216 EFI_HANDLE ControllerHandle;\r
1217 UINT32 Attributes;\r
1218 UINT32 OpenCount;\r
1219} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;\r
1220\r
1221/**\r
1222 Retrieves the list of agents that currently have a protocol interface opened.\r
1223\r
1224 @param Handle The handle for the protocol interface that is being queried.\r
1225 @param Protocol The published unique identifier of the protocol.\r
1226 @param EntryBuffer A pointer to a buffer of open protocol information in the form of\r
1227 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.\r
1228 @param EntryCount A pointer to the number of entries in EntryBuffer.\r
1229\r
1230 @retval EFI_SUCCESS The open protocol information was returned in EntryBuffer, and the\r
1231 number of entries was returned EntryCount.\r
1232 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate EntryBuffer.\r
1233 @retval EFI_NOT_FOUND Handle does not support the protocol specified by Protocol.\r
1234\r
1235**/\r
1236typedef\r
1237EFI_STATUS\r
8b13229b 1238(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION)(\r
959ccb23 1239 IN EFI_HANDLE Handle,\r
1240 IN EFI_GUID *Protocol,\r
1241 IN EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,\r
1242 OUT UINTN *EntryCount\r
1243 );\r
1244\r
1245/**\r
1246 Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r
1247 from pool.\r
1248\r
1249 @param Handle The handle from which to retrieve the list of protocol interface\r
1250 GUIDs.\r
1251 @param ProtocolBuffer A pointer to the list of protocol interface GUID pointers that are\r
1252 installed on Handle.\r
1253 @param ProtocolBufferCount A pointer to the number of GUID pointers present in\r
1254 ProtocolBuffer.\r
1255\r
1256 @retval EFI_SUCCESS The list of protocol interface GUIDs installed on Handle was returned in\r
1257 ProtocolBuffer. The number of protocol interface GUIDs was\r
1258 returned in ProtocolBufferCount.\r
1259 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.\r
1260 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1261\r
1262**/\r
1263typedef\r
1264EFI_STATUS\r
8b13229b 1265(EFIAPI *EFI_PROTOCOLS_PER_HANDLE)(\r
959ccb23 1266 IN EFI_HANDLE Handle,\r
1267 OUT EFI_GUID ***ProtocolBuffer,\r
1268 OUT UINTN *ProtocolBufferCount\r
1269 );\r
1270\r
1271/**\r
1272 Creates an event that is to be signaled whenever an interface is installed for a specified protocol.\r
1273\r
1274 @param Protocol The numeric ID of the protocol for which the event is to be registered.\r
1275 @param Event Event that is to be signaled whenever a protocol interface is registered\r
1276 for Protocol.\r
1277 @param Registration A pointer to a memory location to receive the registration value.\r
1278\r
1279 @retval EFI_SUCCESS The notification event has been registered.\r
1280 @retval EFI_OUT_OF_RESOURCES Space for the notification event could not be allocated.\r
1281 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1282\r
1283**/\r
1284typedef\r
1285EFI_STATUS\r
8b13229b 1286(EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY)(\r
959ccb23 1287 IN EFI_GUID *Protocol,\r
1288 IN EFI_EVENT Event,\r
1289 OUT VOID **Registration\r
1290 );\r
1291\r
1292\r
1293typedef enum {\r
1294 AllHandles,\r
1295 ByRegisterNotify,\r
1296 ByProtocol\r
1297} EFI_LOCATE_SEARCH_TYPE;\r
1298\r
1299/**\r
1300 Returns an array of handles that support a specified protocol.\r
1301\r
1302 @param SearchType Specifies which handle(s) are to be returned.\r
1303 @param Protocol Specifies the protocol to search by.\r
1304 @param SearchKey Specifies the search key.\r
1305 @param BufferSize On input, the size in bytes of Buffer. On output, the size in bytes of\r
1306 the array returned in Buffer (if the buffer was large enough) or the\r
1307 size, in bytes, of the buffer needed to obtain the array (if the buffer was\r
1308 not large enough).\r
1309 @param Buffer The buffer in which the array is returned.\r
1310\r
1311 @retval EFI_SUCCESS The array of handles was returned.\r
1312 @retval EFI_NOT_FOUND No handles match the search.\r
1313 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.\r
1314 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1315\r
1316**/\r
1317typedef\r
1318EFI_STATUS\r
8b13229b 1319(EFIAPI *EFI_LOCATE_HANDLE)(\r
959ccb23 1320 IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
1321 IN EFI_GUID *Protocol, OPTIONAL\r
1322 IN VOID *SearchKey, OPTIONAL\r
1323 IN OUT UINTN *BufferSize,\r
1324 OUT EFI_HANDLE *Buffer\r
1325 );\r
1326\r
1327/**\r
1328 Locates the handle to a device on the device path that supports the specified protocol.\r
1329\r
1330 @param Protocol Specifies the protocol to search for.\r
1331 @param DevicePath On input, a pointer to a pointer to the device path. On output, the device\r
1332 path pointer is modified to point to the remaining part of the device\r
1333 path.\r
1334 @param Device A pointer to the returned device handle.\r
1335\r
1336 @retval EFI_SUCCESS The resulting handle was returned.\r
1337 @retval EFI_NOT_FOUND No handles match the search.\r
1338 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1339\r
1340**/\r
1341typedef\r
1342EFI_STATUS\r
8b13229b 1343(EFIAPI *EFI_LOCATE_DEVICE_PATH)(\r
959ccb23 1344 IN EFI_GUID *Protocol,\r
1345 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,\r
1346 OUT EFI_HANDLE *Device\r
1347 );\r
1348\r
1349/**\r
1350 Adds, updates, or removes a configuration table entry from the EFI System Table.\r
1351\r
1352 @param Guid A pointer to the GUID for the entry to add, update, or remove.\r
1353 @param Table A pointer to the configuration table for the entry to add, update, or\r
1354 remove. May be NULL.\r
1355\r
1356 @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.\r
1357 @retval EFI_NOT_FOUND An attempt was made to delete a nonexistent entry.\r
1358 @retval EFI_INVALID_PARAMETER Guid is not valid.\r
1359 @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.\r
1360\r
1361**/\r
1362typedef\r
1363EFI_STATUS\r
8b13229b 1364(EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE)(\r
959ccb23 1365 IN EFI_GUID *Guid,\r
1366 IN VOID *Table\r
1367 );\r
1368\r
1369\r
1370/**\r
1371 Returns an array of handles that support the requested protocol in a buffer allocated from pool.\r
1372\r
1373 @param SearchType Specifies which handle(s) are to be returned.\r
1374 @param Protocol Specifies the protocol to search by.\r
1375 @param SearchKey Supplies the search key depending on the SearchType.\r
1376 @param NoHandles The number of handles returned in Buffer.\r
1377 @param Buffer A pointer to the buffer to return the requested array of handles that\r
1378 support Protocol.\r
1379\r
1380 @retval EFI_SUCCESS The array of handles was returned in Buffer, and the number of\r
1381 handles in Buffer was returned in NoHandles.\r
1382 @retval EFI_NOT_FOUND No handles match the search.\r
1383 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the matching results.\r
1384 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1385\r
1386**/\r
1387typedef\r
1388EFI_STATUS\r
8b13229b 1389(EFIAPI *EFI_LOCATE_HANDLE_BUFFER)(\r
959ccb23 1390 IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
1391 IN EFI_GUID *Protocol, OPTIONAL\r
1392 IN VOID *SearchKey, OPTIONAL\r
1393 IN OUT UINTN *NoHandles,\r
1394 OUT EFI_HANDLE **Buffer\r
1395 );\r
1396\r
1397/**\r
1398 Returns the first protocol instance that matches the given protocol.\r
1399\r
1400 @param Protocol Provides the protocol to search for.\r
1401 @param Registration Optional registration key returned from\r
1402 RegisterProtocolNotify().\r
1403 @param Interface On return, a pointer to the first interface that matches Protocol and\r
1404 Registration.\r
1405\r
1406 @retval EFI_SUCCESS A protocol instance matching Protocol was found and returned in\r
1407 Interface.\r
1408 @retval EFI_NOT_FOUND No protocol instances were found that match Protocol and\r
1409 Registration.\r
1410 @retval EFI_INVALID_PARAMETER Interface is NULL.\r
1411\r
1412**/\r
1413typedef\r
1414EFI_STATUS\r
8b13229b 1415(EFIAPI *EFI_LOCATE_PROTOCOL)(\r
959ccb23 1416 IN EFI_GUID *Protocol,\r
1417 IN VOID *Registration, OPTIONAL\r
1418 OUT VOID **Interface\r
1419 );\r
1420\r
1421typedef struct {\r
1422 UINT64 Length;\r
1423 union {\r
1424 EFI_PHYSICAL_ADDRESS DataBlock;\r
1425 EFI_PHYSICAL_ADDRESS ContinuationPointer;\r
1426 } Union;\r
45ad5569 1427} EFI_CAPSULE_BLOCK_DESCRIPTOR;\r
959ccb23 1428\r
1429typedef struct {\r
1430 EFI_GUID CapsuleGuid;\r
1431 UINT32 HeaderSize;\r
1432 UINT32 Flags;\r
1433 UINT32 CapsuleImageSize;\r
45ad5569 1434} EFI_CAPSULE_HEADER;\r
959ccb23 1435\r
176a6bb3
LG
1436typedef struct {\r
1437 UINT32 CapsuleArrayNumber;\r
1438 VOID* CapsulePtr[1];\r
1439} EFI_CAPSULE_TABLE;\r
1440\r
959ccb23 1441#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000\r
1442#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000\r
1443\r
1444/**\r
1445 Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended\r
1446 consumption, the firmware may process the capsule immediately. If the payload should persist\r
1447 across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must\r
1448 be passed into ResetSystem() and will cause the capsule to be processed by the firmware as\r
1449 part of the reset process.\r
1450\r
1451 @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules\r
1452 being passed into update capsule.\r
1453 @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r
1454 CaspuleHeaderArray.\r
1455 @param ScatterGatherList Physical pointer to a set of\r
1456 EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the\r
1457 location in physical memory of a set of capsules.\r
1458\r
1459 @retval EFI_SUCCESS Valid capsule was passed. If\r
1460 CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the\r
1461 capsule has been successfully processed by the firmware.\r
1462 @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error.\r
1463 @retval EFI_INVALID_PARAMETER CapsuleSize is NULL.\r
1464\r
1465**/\r
1466typedef\r
1467EFI_STATUS\r
8b13229b 1468(EFIAPI *EFI_UPDATE_CAPSULE)(\r
531febc2 1469 IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,\r
959ccb23 1470 IN UINTN CapsuleCount,\r
1471 IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL\r
1472 );\r
1473\r
1474/**\r
1475 Returns if the capsule can be supported via UpdateCapsule().\r
1476\r
1477 @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules\r
1478 being passed into update capsule.\r
1479 @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r
1480 CaspuleHeaderArray.\r
1481 @param MaxiumCapsuleSize On output the maximum size that UpdateCapsule() can\r
1482 support as an argument to UpdateCapsule() via\r
1483 CapsuleHeaderArray and ScatterGatherList.\r
1484 @param ResetType Returns the type of reset required for the capsule update.\r
1485\r
1486 @retval EFI_SUCCESS Valid answer returned.\r
1487 @retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and\r
1488 MaximumCapsuleSize and ResetType are undefined.\r
1489 @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.\r
1490\r
1491**/\r
1492typedef\r
1493EFI_STATUS\r
8b13229b 1494(EFIAPI *EFI_QUERY_CAPSULE_CAPABILITIES)(\r
531febc2 1495 IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,\r
959ccb23 1496 IN UINTN CapsuleCount,\r
1497 OUT UINT64 *MaximumCapsuleSize,\r
1498 OUT EFI_RESET_TYPE *ResetType\r
1499 );\r
1500\r
1501/**\r
1502 Returns information about the EFI variables.\r
1503\r
1504 @param Attributes Attributes bitmask to specify the type of variables on\r
1505 which to return information.\r
1506 @param MaximumVariableStorageSize On output the maximum size of the storage space\r
1507 available for the EFI variables associated with the\r
1508 attributes specified.\r
1509 @param RemainingVariableStorageSize Returns the remaining size of the storage space\r
1510 available for the EFI variables associated with the\r
1511 attributes specified.\r
1512 @param MaximumVariableSize Returns the maximum size of the individual EFI\r
1513 variables associated with the attributes specified.\r
1514\r
1515 @retval EFI_SUCCESS Valid answer returned.\r
1516 @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied\r
1517 @retval EFI_UNSUPPORTED The attribute is not supported on this platform, and the\r
1518 MaximumVariableStorageSize,\r
1519 RemainingVariableStorageSize, MaximumVariableSize\r
1520 are undefined.\r
1521\r
1522**/\r
1523typedef\r
1524EFI_STATUS\r
8b13229b 1525(EFIAPI *EFI_QUERY_VARIABLE_INFO)(\r
959ccb23 1526 IN UINT32 Attributes,\r
1527 OUT UINT64 *MaximumVariableStorageSize,\r
1528 OUT UINT64 *RemainingVariableStorageSize,\r
1529 OUT UINT64 *MaximumVariableSize\r
1530 );\r
1531\r
1532\r
1533//\r
1534// EFI Runtime Services Table\r
1535//\r
f490a61d 1536#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249ULL\r
00edb218
A
1537#define EFI_SYSTEM_TABLE_REVISION ((2<<16) | (10))\r
1538#define EFI_2_10_SYSTEM_TABLE_REVISION ((2<<16) | (10))\r
1539#define EFI_2_00_SYSTEM_TABLE_REVISION ((2<<16) | (00))\r
1540#define EFI_1_10_SYSTEM_TABLE_REVISION ((1<<16) | (10))\r
1541#define EFI_1_02_SYSTEM_TABLE_REVISION ((1<<16) | (02))\r
959ccb23 1542\r
f490a61d 1543#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552ULL\r
d1f95000 1544#define EFI_RUNTIME_SERVICES_REVISION EFI_2_10_SYSTEM_TABLE_REVISION\r
959ccb23 1545\r
1546typedef struct {\r
c9a0a0fc 1547 EFI_TABLE_HEADER Hdr;\r
00edb218
A
1548\r
1549 //\r
1550 // Time Services\r
1551 //\r
1552 EFI_GET_TIME GetTime;\r
1553 EFI_SET_TIME SetTime;\r
1554 EFI_GET_WAKEUP_TIME GetWakeupTime;\r
1555 EFI_SET_WAKEUP_TIME SetWakeupTime;\r
1556\r
1557 //\r
1558 // Virtual Memory Services\r
1559 //\r
1560 EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap;\r
1561 EFI_CONVERT_POINTER ConvertPointer;\r
1562\r
1563 //\r
1564 // Variable Services\r
1565 //\r
1566 EFI_GET_VARIABLE GetVariable;\r
1567 EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName;\r
1568 EFI_SET_VARIABLE SetVariable;\r
1569\r
1570 //\r
1571 // Miscellaneous Services\r
1572 //\r
1573 EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount;\r
1574 EFI_RESET_SYSTEM ResetSystem;\r
1575\r
1576 //\r
1577 // UEFI 2.0 Capsule Services\r
1578 //\r
1579 EFI_UPDATE_CAPSULE UpdateCapsule;\r
1580 EFI_QUERY_CAPSULE_CAPABILITIES QueryCapsuleCapabilities;\r
1581\r
1582 //\r
1583 // Miscellaneous UEFI 2.0 Service\r
1584 //\r
1585 EFI_QUERY_VARIABLE_INFO QueryVariableInfo;\r
959ccb23 1586} EFI_RUNTIME_SERVICES;\r
1587\r
1588\r
f490a61d 1589#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42ULL\r
d1f95000 1590#define EFI_BOOT_SERVICES_REVISION EFI_2_10_SYSTEM_TABLE_REVISION\r
959ccb23 1591\r
1592typedef struct {\r
c9a0a0fc 1593 EFI_TABLE_HEADER Hdr;\r
d0c64728 1594\r
00edb218
A
1595 //\r
1596 // Task Priority Services\r
1597 //\r
1598 EFI_RAISE_TPL RaiseTPL;\r
1599 EFI_RESTORE_TPL RestoreTPL;\r
1600\r
1601 //\r
1602 // Memory Services\r
1603 //\r
1604 EFI_ALLOCATE_PAGES AllocatePages;\r
1605 EFI_FREE_PAGES FreePages;\r
1606 EFI_GET_MEMORY_MAP GetMemoryMap;\r
1607 EFI_ALLOCATE_POOL AllocatePool;\r
1608 EFI_FREE_POOL FreePool;\r
1609\r
1610 //\r
1611 // Event & Timer Services\r
1612 //\r
1613 EFI_CREATE_EVENT CreateEvent;\r
1614 EFI_SET_TIMER SetTimer;\r
1615 EFI_WAIT_FOR_EVENT WaitForEvent;\r
1616 EFI_SIGNAL_EVENT SignalEvent;\r
1617 EFI_CLOSE_EVENT CloseEvent;\r
1618 EFI_CHECK_EVENT CheckEvent;\r
1619\r
1620 //\r
1621 // Protocol Handler Services\r
1622 //\r
1623 EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;\r
1624 EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;\r
1625 EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;\r
1626 EFI_HANDLE_PROTOCOL HandleProtocol;\r
1627 VOID *Reserved;\r
1628 EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;\r
1629 EFI_LOCATE_HANDLE LocateHandle;\r
1630 EFI_LOCATE_DEVICE_PATH LocateDevicePath;\r
1631 EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;\r
1632\r
1633 //\r
1634 // Image Services\r
1635 //\r
1636 EFI_IMAGE_LOAD LoadImage;\r
1637 EFI_IMAGE_START StartImage;\r
1638 EFI_EXIT Exit;\r
1639 EFI_IMAGE_UNLOAD UnloadImage;\r
1640 EFI_EXIT_BOOT_SERVICES ExitBootServices;\r
1641\r
1642 //\r
1643 // Miscellaneous Services\r
1644 //\r
1645 EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;\r
1646 EFI_STALL Stall;\r
1647 EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;\r
1648\r
1649 //\r
1650 // DriverSupport Services\r
1651 //\r
1652 EFI_CONNECT_CONTROLLER ConnectController;\r
1653 EFI_DISCONNECT_CONTROLLER DisconnectController;\r
1654\r
1655 //\r
1656 // Open and Close Protocol Services\r
1657 //\r
1658 EFI_OPEN_PROTOCOL OpenProtocol;\r
1659 EFI_CLOSE_PROTOCOL CloseProtocol;\r
1660 EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation;\r
1661\r
1662 //\r
1663 // Library Services\r
1664 //\r
1665 EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle;\r
1666 EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer;\r
1667 EFI_LOCATE_PROTOCOL LocateProtocol;\r
1668 EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;\r
1669 EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;\r
1670\r
1671 //\r
1672 // 32-bit CRC Services\r
1673 //\r
1674 EFI_CALCULATE_CRC32 CalculateCrc32;\r
1675\r
1676 //\r
1677 // Miscellaneous Services\r
1678 //\r
1679 EFI_COPY_MEM CopyMem;\r
1680 EFI_SET_MEM SetMem;\r
1681\r
1682 EFI_CREATE_EVENT_EX CreateEventEx;\r
959ccb23 1683} EFI_BOOT_SERVICES;\r
1684\r
1685//\r
d0c64728 1686// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the\r
959ccb23 1687// EFI System Table.\r
d0c64728 1688//\r
959ccb23 1689typedef struct{\r
00edb218
A
1690 EFI_GUID VendorGuid;\r
1691 VOID *VendorTable;\r
959ccb23 1692} EFI_CONFIGURATION_TABLE;\r
1693\r
1694struct _EFI_SYSTEM_TABLE {\r
c9a0a0fc 1695 EFI_TABLE_HEADER Hdr;\r
00edb218
A
1696 CHAR16 *FirmwareVendor;\r
1697 UINT32 FirmwareRevision;\r
1698 EFI_HANDLE ConsoleInHandle;\r
1699 EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ConIn;\r
1700 EFI_HANDLE ConsoleOutHandle;\r
1701 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;\r
1702 EFI_HANDLE StandardErrorHandle;\r
1703 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *StdErr;\r
1704 EFI_RUNTIME_SERVICES *RuntimeServices;\r
1705 EFI_BOOT_SERVICES *BootServices;\r
1706 UINTN NumberOfTableEntries;\r
1707 EFI_CONFIGURATION_TABLE *ConfigurationTable;\r
959ccb23 1708};\r
1709\r
95cba3ee
A
1710//\r
1711// EFI Load Options Attributes\r
1712//\r
1713#define LOAD_OPTION_ACTIVE 0x00000001\r
1714#define LOAD_OPTION_FORCE_RECONNECT 0x00000002\r
95cba3ee
A
1715#define LOAD_OPTION_HIDDEN 0x00000008\r
1716#define LOAD_OPTION_CATEGORY 0x00001F00\r
1717\r
1718#define LOAD_OPTION_CATEGORY_BOOT 0x00000000\r
1719#define LOAD_OPTION_CATEGORY_APP 0x00000100\r
1720\r
1721#define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001\r
1722#define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002\r
1723#define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300\r
1724\r
1725typedef union {\r
1726 struct {\r
1727 UINT32 Revision : 8;\r
1728 UINT32 ShiftPressed : 1;\r
1729 UINT32 ControlPressed : 1;\r
1730 UINT32 AltPressed : 1;\r
1731 UINT32 LogoPressed : 1;\r
1732 UINT32 MenuPressed : 1;\r
1733 UINT32 SysReqPessed : 1;\r
1734 UINT32 Reserved : 16;\r
1735 UINT32 InputKeyCount : 2;\r
1736 } Options;\r
1737 UINT32 PackedValue;\r
0d332fdc 1738} HOT_KEY_EFI_KEY_DATA;\r
95cba3ee
A
1739\r
1740typedef struct {\r
0d332fdc
A
1741 HOT_KEY_EFI_KEY_DATA KeyOptions;\r
1742 UINT32 BootOptionCrc;\r
1743 UINT16 BootOption;\r
1744//EFI_INPUT_KEY Keys[];\r
95cba3ee
A
1745} EFI_KEY_OPTION;\r
1746\r
4bb89f14
A
1747#define EFI_KEY_OPTION_SHIFT 0x00000001\r
1748#define EFI_KEY_OPTION_CONTROL 0x00000002\r
1749#define EFI_KEY_OPTION_ALT 0x00000004\r
1750#define EFI_KEY_OPTION_LOGO 0x00000008\r
1751#define EFI_KEY_OPTION_MENU 0x00000010\r
1752#define EFI_KEY_OPTION_SYSREQ 0x00000020\r
1753#define EFI_KEY_CODE_COUNT 0x00000300\r
1754\r
1755\r
959ccb23 1756//\r
1757// EFI File location to boot from on removable media devices\r
1758//\r
1759#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI"\r
1760#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI"\r
1761#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI"\r
1762#define EFI_REMOVABLE_MEDIA_FILE_NAME_EBC L"\\EFI\\BOOT\\BOOTEBC.EFI"\r
1763\r
1764#if defined (MDE_CPU_IA32)\r
1765 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA32\r
1766#elif defined (MDE_CPU_IPF)\r
1767 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA64\r
1768#elif defined (MDE_CPU_X64)\r
1769 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64\r
1770#elif defined (MDE_CPU_EBC)\r
1771 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_EBC\r
1772#else\r
1773 #error Unknown Processor Type\r
1774#endif\r
1775\r
959ccb23 1776#include <Uefi/UefiPxe.h>\r
1777#include <Uefi/UefiGpt.h>\r
1778#include <Uefi/UefiInternalFormRepresentation.h>\r
1779\r
1780#endif\r