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