]> git.proxmox.com Git - mirror_edk2.git/blame - OldMdePkg/Include/Uefi/UefiSpec.h
Add some definitions for efi event in Uefi/UefiSpec.h to follow spec.
[mirror_edk2.git] / OldMdePkg / Include / Uefi / UefiSpec.h
CommitLineData
878ddf1f 1/** @file\r
2 Include file that supportes UEFI.\r
c0b162a2 3\r
878ddf1f 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
c0b162a2 7\r
8 Copyright (c) 2006 - 2007, Intel Corporation\r
878ddf1f 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
c0b162a2 13\r
878ddf1f 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
c0b162a2 16\r
878ddf1f 17 Module Name: UefiSpec.h\r
c0b162a2 18\r
878ddf1f 19**/\r
20\r
21#ifndef __UEFI_SPEC_H__\r
22#define __UEFI_SPEC_H__\r
23\r
24#include <Common/MultiPhase.h>\r
25\r
878ddf1f 26//\r
27// EFI Data Types derived from other EFI data types.\r
28//\r
878ddf1f 29#define NULL_HANDLE ((VOID *) 0)\r
30\r
30a60d29 31typedef VOID *EFI_EVENT;\r
878ddf1f 32typedef UINTN EFI_TPL;\r
33\r
878ddf1f 34//\r
35// Networking\r
36//\r
37typedef struct {\r
38 UINT8 Addr[4];\r
39} EFI_IPv4_ADDRESS;\r
40\r
41typedef struct {\r
42 UINT8 Addr[16];\r
43} EFI_IPv6_ADDRESS;\r
44\r
45typedef struct {\r
46 UINT8 Addr[32];\r
47} EFI_MAC_ADDRESS;\r
48\r
49typedef union {\r
50 UINT32 Addr[4];\r
51 EFI_IPv4_ADDRESS v4;\r
52 EFI_IPv6_ADDRESS v6;\r
53} EFI_IP_ADDRESS;\r
54\r
55\r
56typedef enum {\r
57 AllocateAnyPages,\r
58 AllocateMaxAddress,\r
59 AllocateAddress,\r
60 MaxAllocateType\r
61} EFI_ALLOCATE_TYPE;\r
62\r
63\r
64//\r
65// possible caching types for the memory range\r
66//\r
67#define EFI_MEMORY_UC 0x0000000000000001ULL\r
68#define EFI_MEMORY_WC 0x0000000000000002ULL\r
69#define EFI_MEMORY_WT 0x0000000000000004ULL\r
70#define EFI_MEMORY_WB 0x0000000000000008ULL\r
71#define EFI_MEMORY_UCE 0x0000000000000010ULL\r
72\r
73//\r
74// physical memory protection on range\r
75//\r
76#define EFI_MEMORY_WP 0x0000000000001000ULL\r
77#define EFI_MEMORY_RP 0x0000000000002000ULL\r
78#define EFI_MEMORY_XP 0x0000000000004000ULL\r
79\r
80//\r
81// range requires a runtime mapping\r
82//\r
83#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL\r
84\r
85typedef UINT64 EFI_VIRTUAL_ADDRESS;\r
86\r
87#define EFI_MEMORY_DESCRIPTOR_VERSION 1\r
88typedef struct {\r
89 UINT32 Type;\r
90 UINT32 Pad;\r
91 EFI_PHYSICAL_ADDRESS PhysicalStart;\r
92 EFI_VIRTUAL_ADDRESS VirtualStart;\r
93 UINT64 NumberOfPages;\r
94 UINT64 Attribute;\r
95} EFI_MEMORY_DESCRIPTOR;\r
96\r
97//\r
98// EFI_FIELD_OFFSET - returns the byte offset to a field within a structure\r
99//\r
100#define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(&(((TYPE *) 0)->Field)))\r
101\r
102#include <Protocol/DevicePath.h>\r
103#include <Protocol/SimpleTextIn.h>\r
104#include <Protocol/SimpleTextOut.h>\r
105\r
106//\r
107// Declare forward referenced data structures\r
108//\r
30a60d29 109typedef struct _EFI_SYSTEM_TABLE EFI_SYSTEM_TABLE;\r
878ddf1f 110\r
111/**\r
112 Allocates memory pages from the system.\r
c0b162a2 113\r
878ddf1f 114 @param Type The type of allocation to perform.\r
115 @param MemoryType The type of memory to allocate.\r
116 @param Pages The number of contiguous 4 KB pages to allocate.\r
117 @param Memory Pointer to a physical address. On input, the way in which the address is\r
c0b162a2 118 used depends on the value of Type.\r
119\r
878ddf1f 120 @retval EFI_SUCCESS The requested pages were allocated.\r
121 @retval EFI_INVALID_PARAMETER 1) Type is not AllocateAnyPages or\r
122 AllocateMaxAddress or AllocateAddress.\r
123 2) MemoryType is in the range\r
124 EfiMaxMemoryType..0x7FFFFFFF.\r
125 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.\r
126 @retval EFI_NOT_FOUND The requested pages could not be found.\r
c0b162a2 127\r
128**/\r
129typedef\r
130EFI_STATUS\r
878ddf1f 131(EFIAPI *EFI_ALLOCATE_PAGES) (\r
30a60d29
LG
132 IN EFI_ALLOCATE_TYPE Type,\r
133 IN EFI_MEMORY_TYPE MemoryType,\r
134 IN UINTN Pages,\r
135 IN OUT EFI_PHYSICAL_ADDRESS *Memory\r
878ddf1f 136 );\r
137\r
138/**\r
139 Frees memory pages.\r
c0b162a2 140\r
878ddf1f 141 @param Memory The base physical address of the pages to be freed.\r
142 @param Pages The number of contiguous 4 KB pages to free.\r
c0b162a2 143\r
878ddf1f 144 @retval EFI_SUCCESS The requested pages were freed.\r
c0b162a2 145 @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.\r
878ddf1f 146 @retval EFI_NOT_FOUND The requested memory pages were not allocated with\r
147 AllocatePages().\r
c0b162a2 148\r
149**/\r
878ddf1f 150typedef\r
151EFI_STATUS\r
152(EFIAPI *EFI_FREE_PAGES) (\r
30a60d29
LG
153 IN EFI_PHYSICAL_ADDRESS Memory,\r
154 IN UINTN Pages\r
878ddf1f 155 );\r
156\r
157/**\r
158 Returns the current memory map.\r
c0b162a2 159\r
878ddf1f 160 @param MemoryMapSize A pointer to the size, in bytes, of the MemoryMap buffer.\r
161 @param MemoryMap A pointer to the buffer in which firmware places the current memory\r
162 map.\r
163 @param MapKey A pointer to the location in which firmware returns the key for the\r
c0b162a2 164 current memory map.\r
878ddf1f 165 @param DescriptorSize A pointer to the location in which firmware returns the size, in bytes, of\r
c0b162a2 166 an individual EFI_MEMORY_DESCRIPTOR.\r
878ddf1f 167 @param DescriptorVersion A pointer to the location in which firmware returns the version number\r
c0b162a2 168 associated with the EFI_MEMORY_DESCRIPTOR.\r
169\r
878ddf1f 170 @retval EFI_SUCCESS The memory map was returned in the MemoryMap buffer.\r
171 @retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current buffer size\r
172 needed to hold the memory map is returned in MemoryMapSize.\r
173 @retval EFI_INVALID_PARAMETER 1) MemoryMapSize is NULL.\r
174 2) The MemoryMap buffer is not too small and MemoryMap is\r
c0b162a2 175 NULL.\r
176\r
177**/\r
878ddf1f 178typedef\r
179EFI_STATUS\r
180(EFIAPI *EFI_GET_MEMORY_MAP) (\r
30a60d29
LG
181 IN OUT UINTN *MemoryMapSize,\r
182 IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,\r
183 OUT UINTN *MapKey,\r
184 OUT UINTN *DescriptorSize,\r
185 OUT UINT32 *DescriptorVersion\r
878ddf1f 186 );\r
187\r
188#define NextMemoryDescriptor(_Ptr, _Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size)))\r
189#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size) NextMemoryDescriptor (_Ptr, _Size)\r
190\r
191/**\r
192 Allocates pool memory.\r
c0b162a2 193\r
878ddf1f 194 @param PoolType The type of pool to allocate.\r
c0b162a2 195 @param Size The number of bytes to allocate from the pool.\r
878ddf1f 196 @param Buffer A pointer to a pointer to the allocated buffer if the call succeeds;\r
c0b162a2 197 undefined otherwise.\r
198\r
878ddf1f 199 @retval EFI_SUCCESS The requested number of bytes was allocated.\r
c0b162a2 200 @retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated.\r
201 @retval EFI_INVALID_PARAMETER PoolType was invalid.\r
202\r
203**/\r
878ddf1f 204typedef\r
205EFI_STATUS\r
206(EFIAPI *EFI_ALLOCATE_POOL) (\r
30a60d29
LG
207 IN EFI_MEMORY_TYPE PoolType,\r
208 IN UINTN Size,\r
209 OUT VOID **Buffer\r
878ddf1f 210 );\r
211\r
212/**\r
213 Returns pool memory to the system.\r
c0b162a2 214\r
215 @param Buffer Pointer to the buffer to free.\r
216\r
217 @retval EFI_SUCCESS The memory was returned to the system.\r
878ddf1f 218 @retval EFI_INVALID_PARAMETER Buffer was invalid.\r
c0b162a2 219\r
220**/\r
878ddf1f 221typedef\r
222EFI_STATUS\r
223(EFIAPI *EFI_FREE_POOL) (\r
30a60d29 224 IN VOID *Buffer\r
878ddf1f 225 );\r
226\r
227/**\r
228 Changes the runtime addressing mode of EFI firmware from physical to virtual.\r
c0b162a2 229\r
878ddf1f 230 @param MemoryMapSize The size in bytes of VirtualMap.\r
231 @param DescriptorSize The size in bytes of an entry in the VirtualMap.\r
232 @param DescriptorVersion The version of the structure entries in VirtualMap.\r
233 @param VirtualMap An array of memory descriptors which contain new virtual\r
234 address mapping information for all runtime ranges.\r
c0b162a2 235\r
878ddf1f 236 @retval EFI_SUCCESS The virtual address map has been applied.\r
237 @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in\r
c0b162a2 238 virtual address mapped mode.\r
239 @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.\r
878ddf1f 240 @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory\r
c0b162a2 241 map that requires a mapping.\r
878ddf1f 242 @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found\r
c0b162a2 243 in the memory map.\r
244\r
245**/\r
878ddf1f 246typedef\r
247EFI_STATUS\r
248(EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) (\r
30a60d29
LG
249 IN UINTN MemoryMapSize,\r
250 IN UINTN DescriptorSize,\r
251 IN UINT32 DescriptorVersion,\r
252 IN EFI_MEMORY_DESCRIPTOR *VirtualMap\r
878ddf1f 253 );\r
254\r
255/**\r
256 Connects one or more drivers to a controller.\r
c0b162a2 257\r
878ddf1f 258 @param ControllerHandle The handle of the controller to which driver(s) are to be connected.\r
259 @param DriverImageHandle A pointer to an ordered list handles that support the\r
c0b162a2 260 EFI_DRIVER_BINDING_PROTOCOL.\r
878ddf1f 261 @param RemainingDevicePath A pointer to the device path that specifies a child of the\r
c0b162a2 262 controller specified by ControllerHandle.\r
263 @param Recursive If TRUE, then ConnectController() is called recursively\r
878ddf1f 264 until the entire tree of controllers below the controller specified\r
c0b162a2 265 by ControllerHandle have been created. If FALSE, then\r
266 the tree of controllers is only expanded one level.\r
267\r
878ddf1f 268 @retval EFI_SUCCESS 1) One or more drivers were connected to ControllerHandle.\r
c0b162a2 269 2) No drivers were connected to ControllerHandle, but\r
878ddf1f 270 RemainingDevicePath is not NULL, and it is an End Device\r
c0b162a2 271 Path Node.\r
272 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
878ddf1f 273 @retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances\r
c0b162a2 274 present in the system.\r
878ddf1f 275 2) No drivers were connected to ControllerHandle.\r
c0b162a2 276\r
277**/\r
878ddf1f 278typedef\r
279EFI_STATUS\r
280(EFIAPI *EFI_CONNECT_CONTROLLER) (\r
281 IN EFI_HANDLE ControllerHandle,\r
282 IN EFI_HANDLE *DriverImageHandle, OPTIONAL\r
283 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath, OPTIONAL\r
284 IN BOOLEAN Recursive\r
285 );\r
286\r
287/**\r
288 Disconnects one or more drivers from a controller.\r
c0b162a2 289\r
878ddf1f 290 @param ControllerHandle The handle of the controller from which driver(s) are to be disconnected.\r
c0b162a2 291 @param DriverImageHandle The driver to disconnect from ControllerHandle.\r
292 @param ChildHandle The handle of the child to destroy.\r
293\r
878ddf1f 294 @retval EFI_SUCCESS 1) One or more drivers were disconnected from the controller.\r
295 2) On entry, no drivers are managing ControllerHandle.\r
296 3) DriverImageHandle is not NULL, and on entry\r
297 DriverImageHandle is not managing ControllerHandle.\r
c0b162a2 298\r
878ddf1f 299 @retval EFI_INVALID_PARAMETER One ore more parameters are invalid.\r
300 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to disconnect any drivers from\r
c0b162a2 301 ControllerHandle.\r
302 @retval EFI_DEVICE_ERROR The controller could not be disconnected because of a device error.\r
303\r
304**/\r
878ddf1f 305typedef\r
306EFI_STATUS\r
307(EFIAPI *EFI_DISCONNECT_CONTROLLER) (\r
30a60d29
LG
308 IN EFI_HANDLE ControllerHandle,\r
309 IN EFI_HANDLE DriverImageHandle, OPTIONAL\r
310 IN EFI_HANDLE ChildHandle OPTIONAL\r
878ddf1f 311 );\r
312\r
313//\r
314// ConvertPointer DebugDisposition type.\r
315//\r
316#define EFI_OPTIONAL_PTR 0x00000001\r
317#define EFI_OPTIONAL_POINTER EFI_OPTIONAL_PTR\r
318\r
319/**\r
320 Determines the new virtual address that is to be used on subsequent memory accesses.\r
c0b162a2 321\r
878ddf1f 322 @param DebugDisposition Supplies type information for the pointer being converted.\r
323 @param Address A pointer to a pointer that is to be fixed to be the value needed\r
c0b162a2 324 for the new virtual address mappings being applied.\r
325\r
326 @retval EFI_SUCCESS The pointer pointed to by Address was modified.\r
878ddf1f 327 @retval EFI_INVALID_PARAMETER 1) Address is NULL.\r
328 2) *Address is NULL and DebugDisposition does\r
c0b162a2 329 not have the EFI_OPTIONAL_PTR bit set.\r
878ddf1f 330 @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part\r
c0b162a2 331 of the current memory map. This is normally fatal.\r
332\r
333**/\r
878ddf1f 334typedef\r
335EFI_STATUS\r
336(EFIAPI *EFI_CONVERT_POINTER) (\r
30a60d29 337 IN UINTN DebugDisposition,\r
878ddf1f 338 IN OUT VOID **Address\r
339 );\r
340\r
341//\r
342// EFI Event Types (name defined in spec)\r
343//\r
93b0fbc8 344#define EVT_TIMER 0x80000000\r
345#define EVT_RUNTIME 0x40000000\r
346\r
347#define EVT_NOTIFY_WAIT 0x00000100\r
348#define EVT_NOTIFY_SIGNAL 0x00000200\r
349#define EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201\r
350#define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202\r
878ddf1f 351\r
93b0fbc8 352#define EVENT_TIMER EVT_TIMER\r
353#define EVENT_RUNTIME EVT_RUNTIME\r
354#define EVENT_RUNTIME_CONTEXT 0x20000000\r
878ddf1f 355\r
93b0fbc8 356#define EVENT_NOTIFY_WAIT EVT_NOTIFY_WAIT\r
357#define EVENT_NOTIFY_SIGNAL EVT_NOTIFY_SIGNAL\r
358#define EVENT_SIGNAL_EXIT_BOOT_SERVICES EVT_SIGNAL_EXIT_BOOT_SERVICES\r
359#define EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE\r
878ddf1f 360\r
878ddf1f 361//\r
362// Prior to UEFI 2.0 Tiano extended these enums. This was replaced by\r
363// CreateEventEx() Event Groups in UEFI 2.0\r
364//\r
365#define EFI_EVENT_NOTIFY_SIGNAL_ALL 0x00000400\r
366\r
367#define EFI_EVENT_SIGNAL_READY_TO_BOOT 0x00000203\r
368#define EFI_EVENT_SIGNAL_LEGACY_BOOT 0x00000204\r
369\r
878ddf1f 370\r
371//\r
372// EFI Event Types (name following coding style)\r
373//\r
374#define EFI_EVENT_TIMER EVENT_TIMER\r
375#define EFI_EVENT_RUNTIME EVENT_RUNTIME\r
376#define EFI_EVENT_RUNTIME_CONTEXT EVENT_RUNTIME_CONTEXT\r
377\r
378#define EFI_EVENT_NOTIFY_WAIT EVENT_NOTIFY_WAIT\r
379#define EFI_EVENT_NOTIFY_SIGNAL EVENT_NOTIFY_SIGNAL\r
380\r
381#define EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES EVENT_SIGNAL_EXIT_BOOT_SERVICES\r
382#define EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE\r
383\r
384\r
c0b162a2 385/**\r
878ddf1f 386 Invoke a notification event\r
c0b162a2 387\r
878ddf1f 388 @param Event Event whose notification function is being invoked.\r
c0b162a2 389 @param Context Pointer to the notification function's context,\r
390 which is implementation-dependent.\r
391\r
392**/\r
878ddf1f 393typedef\r
394VOID\r
395(EFIAPI *EFI_EVENT_NOTIFY) (\r
30a60d29
LG
396 IN EFI_EVENT Event,\r
397 IN VOID *Context\r
878ddf1f 398 );\r
399\r
c0b162a2 400/**\r
878ddf1f 401 Creates an event.\r
c0b162a2 402\r
878ddf1f 403 @param Type The type of event to create and its mode and attributes.\r
511710d6 404 @param NotifyTpl Pointer to the notification function's context.\r
c0b162a2 405 @param NotifyFunction Pointer to the event's notification function, if any.\r
511710d6 406 @param NotifyContext Pointer to the notification function's context; corresponds to parameter\r
c0b162a2 407 Context in the notification function.\r
408 @param Event Pointer to the newly created event if the call succeeds; undefined\r
409 otherwise.\r
878ddf1f 410\r
c0b162a2 411 @retval EFI_SUCCESS The event structure was created.\r
878ddf1f 412 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
413 @retval EFI_OUT_OF_RESOURCES The event could not be allocated.\r
c0b162a2 414\r
415**/\r
878ddf1f 416typedef\r
417EFI_STATUS\r
418(EFIAPI *EFI_CREATE_EVENT) (\r
30a60d29
LG
419 IN UINT32 Type,\r
420 IN EFI_TPL NotifyTpl,\r
421 IN EFI_EVENT_NOTIFY NotifyFunction,\r
422 IN VOID *NotifyContext,\r
423 OUT EFI_EVENT *Event\r
878ddf1f 424 );\r
425\r
c0b162a2 426/**\r
878ddf1f 427 Creates an event in a group.\r
c0b162a2 428\r
878ddf1f 429 @param Type The type of event to create and its mode and attributes.\r
511710d6 430 @param NotifyTpl Pointer to the notification function's context.\r
c0b162a2 431 @param NotifyFunction Pointer to the event's notification function, if any.\r
511710d6 432 @param NotifyContext Pointer to the notification function's context; corresponds to parameter\r
c0b162a2 433 Context in the notification function.\r
434 @param EventGroup Pointer to the unique identifier of the group to which this event belongs.\r
435 @param Event Pointer to the newly created event if the call succeeds; undefined\r
436 otherwise.\r
878ddf1f 437\r
c0b162a2 438 @retval EFI_SUCCESS The event structure was created.\r
878ddf1f 439 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
440 @retval EFI_OUT_OF_RESOURCES The event could not be allocated.\r
c0b162a2 441\r
442**/\r
878ddf1f 443typedef\r
444EFI_STATUS\r
445(EFIAPI *EFI_CREATE_EVENT_EX) (\r
30a60d29
LG
446 IN UINT32 Type,\r
447 IN EFI_TPL NotifyTpl OPTIONAL,\r
448 IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,\r
449 IN CONST VOID *NotifyContext OPTIONAL,\r
450 IN CONST EFI_GUID *EventGroup OPTIONAL,\r
451 OUT EFI_EVENT *Event\r
878ddf1f 452 );\r
453\r
454typedef enum {\r
455 TimerCancel,\r
456 TimerPeriodic,\r
457 TimerRelative\r
458} EFI_TIMER_DELAY;\r
459\r
c0b162a2 460/**\r
878ddf1f 461 Sets the type of timer and the trigger time for a timer event.\r
c0b162a2 462\r
878ddf1f 463 @param Event The timer event that is to be signaled at the specified time.\r
464 @param Type The type of time that is specified in TriggerTime.\r
c0b162a2 465 @param TriggerTime The number of 100ns units until the timer expires.\r
878ddf1f 466\r
c0b162a2 467 @retval EFI_SUCCESS The event has been set to be signaled at the requested time.\r
878ddf1f 468 @retval EFI_INVALID_PARAMETER Event or Type is not valid.\r
c0b162a2 469\r
470**/\r
878ddf1f 471typedef\r
472EFI_STATUS\r
473(EFIAPI *EFI_SET_TIMER) (\r
30a60d29
LG
474 IN EFI_EVENT Event,\r
475 IN EFI_TIMER_DELAY Type,\r
476 IN UINT64 TriggerTime\r
878ddf1f 477 );\r
478\r
c0b162a2 479/**\r
878ddf1f 480 Signals an event.\r
c0b162a2 481\r
878ddf1f 482 @param Event The event to signal.\r
483\r
c0b162a2 484 @retval EFI_SUCCESS The event has been signaled.\r
485\r
486**/\r
878ddf1f 487typedef\r
488EFI_STATUS\r
489(EFIAPI *EFI_SIGNAL_EVENT) (\r
30a60d29 490 IN EFI_EVENT Event\r
878ddf1f 491 );\r
492\r
c0b162a2 493/**\r
878ddf1f 494 Stops execution until an event is signaled.\r
c0b162a2 495\r
878ddf1f 496 @param NumberOfEvents The number of events in the Event array.\r
497 @param Event An array of EFI_EVENT.\r
498 @param Index Pointer to the index of the event which satisfied the wait condition.\r
499\r
500 @retval EFI_SUCCESS The event indicated by Index was signaled.\r
501 @retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0.\r
502 2) The event indicated by Index is of type\r
c0b162a2 503 EVT_NOTIFY_SIGNAL.\r
504 @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION.\r
505\r
506**/\r
878ddf1f 507typedef\r
508EFI_STATUS\r
509(EFIAPI *EFI_WAIT_FOR_EVENT) (\r
30a60d29
LG
510 IN UINTN NumberOfEvents,\r
511 IN EFI_EVENT *Event,\r
512 OUT UINTN *Index\r
878ddf1f 513 );\r
514\r
c0b162a2 515/**\r
878ddf1f 516 Closes an event.\r
c0b162a2 517\r
878ddf1f 518 @param Event The event to close.\r
519\r
c0b162a2 520 @retval EFI_SUCCESS The event has been closed.\r
521\r
522**/\r
878ddf1f 523typedef\r
524EFI_STATUS\r
525(EFIAPI *EFI_CLOSE_EVENT) (\r
526 IN EFI_EVENT Event\r
527 );\r
528\r
c0b162a2 529/**\r
878ddf1f 530 Checks whether an event is in the signaled state.\r
c0b162a2 531\r
878ddf1f 532 @param Event The event to check.\r
533\r
534 @retval EFI_SUCCESS The event is in the signaled state.\r
535 @retval EFI_NOT_READY The event is not in the signaled state.\r
536 @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL.\r
c0b162a2 537\r
538**/\r
878ddf1f 539typedef\r
540EFI_STATUS\r
541(EFIAPI *EFI_CHECK_EVENT) (\r
542 IN EFI_EVENT Event\r
543 );\r
544\r
545//\r
546// Task priority level (name defined in spec).\r
547//\r
548#define TPL_APPLICATION 4\r
549#define TPL_CALLBACK 8\r
550#define TPL_NOTIFY 16\r
551#define TPL_HIGH_LEVEL 31\r
552\r
553//\r
554// Task priority level (name following coding style).\r
555//\r
556#define EFI_TPL_APPLICATION TPL_APPLICATION\r
557#define EFI_TPL_CALLBACK TPL_CALLBACK\r
558#define EFI_TPL_NOTIFY TPL_NOTIFY\r
559#define EFI_TPL_HIGH_LEVEL TPL_HIGH_LEVEL\r
560\r
c0b162a2 561/**\r
511710d6 562 Raises a task's priority level and returns its previous level.\r
c0b162a2 563\r
878ddf1f 564 @param NewTpl The new task priority level.\r
c0b162a2 565\r
566 @retval Previous task priority level\r
567\r
568**/\r
878ddf1f 569typedef\r
570EFI_TPL\r
571(EFIAPI *EFI_RAISE_TPL) (\r
572 IN EFI_TPL NewTpl\r
573 );\r
574\r
c0b162a2 575/**\r
511710d6 576 Restores a task's priority level to its previous value.\r
c0b162a2 577\r
578 @param OldTpl The previous task priority level to restore\r
579\r
580**/\r
878ddf1f 581typedef\r
582VOID\r
583(EFIAPI *EFI_RESTORE_TPL) (\r
584 IN EFI_TPL OldTpl\r
585 );\r
586\r
587//\r
588// Variable attributes\r
589//\r
06fb8ffd 590#define EFI_VARIABLE_NON_VOLATILE 0x00000001\r
591#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002\r
592#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004\r
593#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008\r
878ddf1f 594\r
c0b162a2 595/**\r
878ddf1f 596 Returns the value of a variable.\r
c0b162a2 597\r
878ddf1f 598 @param VariableName A Null-terminated Unicode string that is the name of the\r
c0b162a2 599 vendor's variable.\r
600 @param VendorGuid A unique identifier for the vendor.\r
878ddf1f 601 @param Attributes If not NULL, a pointer to the memory location to return the\r
c0b162a2 602 attributes bitmask for the variable.\r
878ddf1f 603 @param DataSize On input, the size in bytes of the return Data buffer.\r
c0b162a2 604 On output the size of data returned in Data.\r
605 @param Data The buffer to return the contents of the variable.\r
606\r
878ddf1f 607 @retval EFI_SUCCESS The function completed successfully.\r
608 @retval EFI_NOT_FOUND The variable was not found.\r
609 @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result.\r
610 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
611 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
c0b162a2 612\r
613**/\r
878ddf1f 614typedef\r
615EFI_STATUS\r
616(EFIAPI *EFI_GET_VARIABLE) (\r
30a60d29
LG
617 IN CHAR16 *VariableName,\r
618 IN EFI_GUID *VendorGuid,\r
619 OUT UINT32 *Attributes, OPTIONAL\r
620 IN OUT UINTN *DataSize,\r
621 OUT VOID *Data\r
878ddf1f 622 );\r
623\r
c0b162a2 624/**\r
878ddf1f 625 Enumerates the current variable names.\r
c0b162a2 626\r
878ddf1f 627 @param VariableNameSize The size of the VariableName buffer.\r
c0b162a2 628 @param VariableName On input, supplies the last VariableName that was returned\r
878ddf1f 629 by GetNextVariableName(). On output, returns the Nullterminated\r
c0b162a2 630 Unicode string of the current variable.\r
878ddf1f 631 @param VendorGuid On input, supplies the last VendorGuid that was returned by\r
c0b162a2 632 GetNextVariableName(). On output, returns the\r
633 VendorGuid of the current variable.\r
634\r
878ddf1f 635 @retval EFI_SUCCESS The function completed successfully.\r
636 @retval EFI_NOT_FOUND The next variable was not found.\r
637 @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.\r
638 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
639 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
c0b162a2 640\r
641**/\r
878ddf1f 642typedef\r
643EFI_STATUS\r
644(EFIAPI *EFI_GET_NEXT_VARIABLE_NAME) (\r
645 IN OUT UINTN *VariableNameSize,\r
646 IN OUT CHAR16 *VariableName,\r
647 IN OUT EFI_GUID *VendorGuid\r
648 );\r
649\r
c0b162a2 650/**\r
878ddf1f 651 Sets the value of a variable.\r
c0b162a2 652\r
878ddf1f 653 @param VariableName A Null-terminated Unicode string that is the name of the\r
c0b162a2 654 vendor's variable.\r
655 @param VendorGuid A unique identifier for the vendor.\r
656 @param Attributes Attributes bitmask to set for the variable.\r
878ddf1f 657 @param DataSize The size in bytes of the Data buffer.\r
658 @param Data The contents for the variable.\r
c0b162a2 659\r
878ddf1f 660 @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as\r
c0b162a2 661 defined by the Attributes.\r
878ddf1f 662 @retval EFI_WRITE_PROTECTED The variable in question is read-only.\r
663 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r
c0b162a2 664 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
665 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
666\r
667**/\r
878ddf1f 668typedef\r
669EFI_STATUS\r
670(EFIAPI *EFI_SET_VARIABLE) (\r
30a60d29
LG
671 IN CHAR16 *VariableName,\r
672 IN EFI_GUID *VendorGuid,\r
673 IN UINT32 Attributes,\r
674 IN UINTN DataSize,\r
675 IN VOID *Data\r
878ddf1f 676 );\r
677\r
678//\r
679// EFI Time\r
680//\r
681typedef struct {\r
682 UINT32 Resolution;\r
683 UINT32 Accuracy;\r
684 BOOLEAN SetsToZero;\r
685} EFI_TIME_CAPABILITIES;\r
686\r
c0b162a2 687/**\r
688 Returns the current time and date information, and the time-keeping capabilities\r
878ddf1f 689 of the hardware platform.\r
c0b162a2 690\r
691 @param Time A pointer to storage to receive a snapshot of the current time.\r
692 @param Capabilities An optional pointer to a buffer to receive the real time clock\r
693 device's capabilities.\r
694\r
695 @retval EFI_SUCCESS The operation completed successfully.\r
878ddf1f 696 @retval EFI_INVALID_PARAMETER Time is NULL.\r
697 @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.\r
c0b162a2 698\r
699**/\r
878ddf1f 700typedef\r
701EFI_STATUS\r
702(EFIAPI *EFI_GET_TIME) (\r
30a60d29
LG
703 OUT EFI_TIME *Time,\r
704 OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL\r
878ddf1f 705 );\r
706\r
c0b162a2 707/**\r
878ddf1f 708 Sets the current local time and date information.\r
c0b162a2 709\r
878ddf1f 710 @param Time A pointer to the current time.\r
c0b162a2 711\r
712 @retval EFI_SUCCESS The operation completed successfully.\r
878ddf1f 713 @retval EFI_INVALID_PARAMETER A time field is out of range.\r
714 @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error.\r
c0b162a2 715\r
716**/\r
878ddf1f 717typedef\r
718EFI_STATUS\r
719(EFIAPI *EFI_SET_TIME) (\r
30a60d29 720 IN EFI_TIME *Time\r
878ddf1f 721 );\r
c0b162a2 722\r
723/**\r
878ddf1f 724 Returns the current wakeup alarm clock setting.\r
c0b162a2 725\r
878ddf1f 726 @param Enabled Indicates if the alarm is currently enabled or disabled.\r
c0b162a2 727 @param Pending Indicates if the alarm signal is pending and requires acknowledgement.\r
878ddf1f 728 @param Time The current alarm setting.\r
c0b162a2 729\r
878ddf1f 730 @retval EFI_SUCCESS The alarm settings were returned.\r
731 @retval EFI_INVALID_PARAMETER Any parameter is NULL.\r
732 @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.\r
c0b162a2 733\r
734**/\r
878ddf1f 735typedef\r
736EFI_STATUS\r
737(EFIAPI *EFI_GET_WAKEUP_TIME) (\r
738 OUT BOOLEAN *Enabled,\r
739 OUT BOOLEAN *Pending,\r
740 OUT EFI_TIME *Time\r
741 );\r
742\r
c0b162a2 743/**\r
878ddf1f 744 Sets the system wakeup alarm clock time.\r
c0b162a2 745\r
746 @param Enabled Enable or disable the wakeup alarm.\r
878ddf1f 747 @param Time If Enable is TRUE, the time to set the wakeup alarm for.\r
c0b162a2 748\r
878ddf1f 749 @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If\r
c0b162a2 750 Enable is FALSE, then the wakeup alarm was disabled.\r
878ddf1f 751 @retval EFI_INVALID_PARAMETER A time field is out of range.\r
752 @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.\r
753 @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.\r
c0b162a2 754\r
755**/\r
878ddf1f 756typedef\r
757EFI_STATUS\r
758(EFIAPI *EFI_SET_WAKEUP_TIME) (\r
30a60d29
LG
759 IN BOOLEAN Enable,\r
760 IN EFI_TIME *Time OPTIONAL\r
878ddf1f 761 );\r
762\r
c0b162a2 763/**\r
878ddf1f 764 This is the declaration of an EFI image entry point. This can be the entry point to an application\r
c0b162a2 765 written to this specification, an EFI boot service driver, or an EFI runtime driver.\r
766\r
878ddf1f 767 @param ImageHandle Handle that identifies the loaded image.\r
768 @param SystemTable System Table for this image.\r
c0b162a2 769\r
770 @retval EFI_SUCCESS The operation completed successfully.\r
771\r
772**/\r
878ddf1f 773typedef\r
774EFI_STATUS\r
775(EFIAPI *EFI_IMAGE_ENTRY_POINT) (\r
30a60d29
LG
776 IN EFI_HANDLE ImageHandle,\r
777 IN EFI_SYSTEM_TABLE *SystemTable\r
878ddf1f 778 );\r
779\r
c0b162a2 780/**\r
878ddf1f 781 Loads an EFI image into memory.\r
c0b162a2 782\r
878ddf1f 783 @param BootPolicy If TRUE, indicates that the request originates from the boot\r
c0b162a2 784 manager, and that the boot manager is attempting to load\r
785 FilePath as a boot selection. Ignored if SourceBuffer is\r
786 not NULL.\r
511710d6 787 @param ParentImageHandle The caller's image handle.\r
878ddf1f 788 @param FilePath The DeviceHandle specific file path from which the image is\r
c0b162a2 789 loaded.\r
878ddf1f 790 @param SourceBuffer If not NULL, a pointer to the memory location containing a copy\r
c0b162a2 791 of the image to be loaded.\r
792 @param SourceSize The size in bytes of SourceBuffer.\r
878ddf1f 793 @param ImageHandle Pointer to the returned image handle that is created when the\r
c0b162a2 794 image is successfully loaded.\r
795\r
878ddf1f 796 @retval EFI_SUCCESS Image was loaded into memory correctly.\r
797 @retval EFI_NOT_FOUND Both SourceBuffer and FilePath are NULL.\r
798 @retval EFI_INVALID_PARAMETER One or more parametes are invalid.\r
799 @retval EFI_UNSUPPORTED The image type is not supported.\r
800 @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient resources.\r
801 @retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not\r
c0b162a2 802 understood.\r
803 @retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.\r
804\r
805**/\r
878ddf1f 806typedef\r
807EFI_STATUS\r
808(EFIAPI *EFI_IMAGE_LOAD) (\r
30a60d29
LG
809 IN BOOLEAN BootPolicy,\r
810 IN EFI_HANDLE ParentImageHandle,\r
811 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
812 IN VOID *SourceBuffer OPTIONAL,\r
813 IN UINTN SourceSize,\r
814 OUT EFI_HANDLE *ImageHandle\r
878ddf1f 815 );\r
816\r
c0b162a2 817/**\r
511710d6 818 Transfers control to a loaded image's entry point.\r
c0b162a2 819\r
820 @param ImageHandle Handle of image to be started.\r
878ddf1f 821 @param ExitDataSize Pointer to the size, in bytes, of ExitData.\r
822 @param ExitData Pointer to a pointer to a data buffer that includes a Null-terminated\r
c0b162a2 823 Unicode string, optionally followed by additional binary data.\r
824\r
878ddf1f 825 @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image\r
826 has already been initialized with StartImage\r
827 @retval Exit code from image Exit code from image\r
c0b162a2 828\r
829**/\r
878ddf1f 830typedef\r
831EFI_STATUS\r
832(EFIAPI *EFI_IMAGE_START) (\r
30a60d29 833 IN EFI_HANDLE ImageHandle,\r
878ddf1f 834 OUT UINTN *ExitDataSize,\r
835 OUT CHAR16 **ExitData OPTIONAL\r
836 );\r
837\r
c0b162a2 838/**\r
878ddf1f 839 Terminates a loaded EFI image and returns control to boot services.\r
c0b162a2 840\r
878ddf1f 841 @param ImageHandle Handle that identifies the image.\r
511710d6 842 @param ExitStatus The image's exit code.\r
878ddf1f 843 @param ExitDataSize The size, in bytes, of ExitData.\r
c0b162a2 844 @param ExitData Pointer to a data buffer that includes a Null-terminated Unicode string,\r
845 optionally followed by additional binary data.\r
846\r
847 @retval EFI_SUCCESS The image specified by ImageHandle was unloaded.\r
878ddf1f 848 @retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and\r
c0b162a2 849 started with LoadImage() and StartImage(), but the\r
850 image is not the currently executing image.\r
851\r
852**/\r
878ddf1f 853typedef\r
854EFI_STATUS\r
855(EFIAPI *EFI_EXIT) (\r
30a60d29
LG
856 IN EFI_HANDLE ImageHandle,\r
857 IN EFI_STATUS ExitStatus,\r
858 IN UINTN ExitDataSize,\r
859 IN CHAR16 *ExitData OPTIONAL\r
878ddf1f 860 );\r
861\r
c0b162a2 862/**\r
878ddf1f 863 Unloads an image.\r
c0b162a2 864\r
878ddf1f 865 @param ImageHandle Handle that identifies the image to be unloaded.\r
c0b162a2 866\r
878ddf1f 867 @retval EFI_SUCCESS The image has been unloaded.\r
868 @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.\r
869 @retval EFI_UNSUPPORTED The image has been started, and does not support unload.\r
c0b162a2 870 @retval Exit code from the image's unload handler\r
871\r
872**/\r
878ddf1f 873typedef\r
874EFI_STATUS\r
875(EFIAPI *EFI_IMAGE_UNLOAD) (\r
30a60d29 876 IN EFI_HANDLE ImageHandle\r
878ddf1f 877 );\r
878\r
c0b162a2 879/**\r
878ddf1f 880 Terminates all boot services.\r
c0b162a2 881\r
878ddf1f 882 @param ImageHandle Handle that identifies the exiting image.\r
883 @param MapKey Key to the latest memory map.\r
c0b162a2 884\r
878ddf1f 885 @retval EFI_SUCCESS Boot services have been terminated.\r
c0b162a2 886 @retval EFI_INVALID_PARAMETER MapKey is incorrect.\r
887\r
888**/\r
878ddf1f 889typedef\r
890EFI_STATUS\r
891(EFIAPI *EFI_EXIT_BOOT_SERVICES) (\r
30a60d29
LG
892 IN EFI_HANDLE ImageHandle,\r
893 IN UINTN MapKey\r
878ddf1f 894 );\r
895\r
c0b162a2 896/**\r
878ddf1f 897 Induces a fine-grained stall.\r
c0b162a2 898\r
899 @param Microseconds The number of microseconds to stall execution.\r
900\r
878ddf1f 901 @retval EFI_SUCCESS Execution was stalled at least the requested number of\r
c0b162a2 902 Microseconds.\r
903\r
904**/\r
878ddf1f 905typedef\r
906EFI_STATUS\r
907(EFIAPI *EFI_STALL) (\r
30a60d29 908 IN UINTN Microseconds\r
878ddf1f 909 );\r
910\r
c0b162a2 911/**\r
511710d6 912 Sets the system's watchdog timer.\r
c0b162a2 913\r
878ddf1f 914 @param Timeout The number of seconds to set the watchdog timer to.\r
915 @param WatchdogCode The numeric code to log on a watchdog timer timeout event.\r
916 @param DataSize The size, in bytes, of WatchdogData.\r
917 @param WatchdogData A data buffer that includes a Null-terminated Unicode string, optionally\r
c0b162a2 918 followed by additional binary data.\r
919\r
878ddf1f 920 @retval EFI_SUCCESS The timeout has been set.\r
c0b162a2 921 @retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid.\r
878ddf1f 922 @retval EFI_UNSUPPORTED The system does not have a watchdog timer.\r
923 @retval EFI_DEVICE_ERROR The watch dog timer could not be programmed due to a hardware\r
c0b162a2 924 error.\r
925\r
926**/\r
878ddf1f 927typedef\r
928EFI_STATUS\r
929(EFIAPI *EFI_SET_WATCHDOG_TIMER) (\r
930 IN UINTN Timeout,\r
931 IN UINT64 WatchdogCode,\r
932 IN UINTN DataSize,\r
933 IN CHAR16 *WatchdogData OPTIONAL\r
934 );\r
935\r
936typedef enum {\r
937 EfiResetCold,\r
938 EfiResetWarm,\r
939 EfiResetShutdown,\r
940#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))\r
941 //\r
942 // Tiano extension for capsules that was removed after UEFI 2.0 came out\r
943 //\r
944 EfiResetUpdate\r
945#endif\r
946} EFI_RESET_TYPE;\r
947\r
c0b162a2 948/**\r
878ddf1f 949 Resets the entire platform.\r
c0b162a2 950\r
878ddf1f 951 @param ResetType The type of reset to perform.\r
952 @param ResetStatus The status code for the reset.\r
953 @param DataSize The size, in bytes, of WatchdogData.\r
c0b162a2 954 @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or\r
878ddf1f 955 EfiResetShutdown the data buffer starts with a Null-terminated\r
956 Unicode string, optionally followed by additional binary data.\r
957\r
c0b162a2 958**/\r
878ddf1f 959typedef\r
960VOID\r
961(EFIAPI *EFI_RESET_SYSTEM) (\r
962 IN EFI_RESET_TYPE ResetType,\r
963 IN EFI_STATUS ResetStatus,\r
964 IN UINTN DataSize,\r
965 IN CHAR16 *ResetData OPTIONAL\r
966 );\r
967\r
c0b162a2 968/**\r
878ddf1f 969 Returns a monotonically increasing count for the platform.\r
c0b162a2 970\r
878ddf1f 971 @param Count Pointer to returned value.\r
c0b162a2 972\r
878ddf1f 973 @retval EFI_SUCCESS The next monotonic count was returned.\r
c0b162a2 974 @retval EFI_INVALID_PARAMETER Count is NULL.\r
975 @retval EFI_DEVICE_ERROR The device is not functioning properly.\r
976\r
977**/\r
878ddf1f 978typedef\r
979EFI_STATUS\r
980(EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT) (\r
981 OUT UINT64 *Count\r
982 );\r
983\r
c0b162a2 984/**\r
511710d6 985 Returns the next high 32 bits of the platform's monotonic counter.\r
c0b162a2 986\r
878ddf1f 987 @param HighCount Pointer to returned value.\r
c0b162a2 988\r
878ddf1f 989 @retval EFI_SUCCESS The next high monotonic count was returned.\r
c0b162a2 990 @retval EFI_INVALID_PARAMETER HighCount is NULL.\r
991 @retval EFI_DEVICE_ERROR The device is not functioning properly.\r
992\r
993**/\r
878ddf1f 994typedef\r
995EFI_STATUS\r
996(EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) (\r
997 OUT UINT32 *HighCount\r
998 );\r
999\r
c0b162a2 1000/**\r
878ddf1f 1001 Computes and returns a 32-bit CRC for a data buffer.\r
c0b162a2 1002\r
878ddf1f 1003 @param Data A pointer to the buffer on which the 32-bit CRC is to be computed.\r
1004 @param DataSize The number of bytes in the buffer Data.\r
1005 @param Crc32 The 32-bit CRC that was computed for the data buffer specified by Data\r
1006 and DataSize.\r
c0b162a2 1007\r
878ddf1f 1008 @retval EFI_SUCCESS The 32-bit CRC was computed for the data buffer and returned in\r
c0b162a2 1009 Crc32.\r
1010 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1011\r
1012**/\r
878ddf1f 1013typedef\r
1014EFI_STATUS\r
1015(EFIAPI *EFI_CALCULATE_CRC32) (\r
1016 IN VOID *Data,\r
1017 IN UINTN DataSize,\r
1018 OUT UINT32 *Crc32\r
1019 );\r
1020\r
c0b162a2 1021/**\r
878ddf1f 1022 Copies the contents of one buffer to another buffer.\r
c0b162a2 1023\r
878ddf1f 1024 @param Destination Pointer to the destination buffer of the memory copy.\r
1025 @param Source Pointer to the source buffer of the memory copy.\r
c0b162a2 1026 @param Length Number of bytes to copy from Source to Destination.\r
1027\r
1028**/\r
878ddf1f 1029typedef\r
1030VOID\r
1031(EFIAPI *EFI_COPY_MEM) (\r
1032 IN VOID *Destination,\r
1033 IN VOID *Source,\r
1034 IN UINTN Length\r
1035 );\r
1036\r
c0b162a2 1037/**\r
878ddf1f 1038 The SetMem() function fills a buffer with a specified value.\r
c0b162a2 1039\r
878ddf1f 1040 @param Buffer Pointer to the buffer to fill.\r
1041 @param Size Number of bytes in Buffer to fill.\r
1042 @param Value Value to fill Buffer with.\r
c0b162a2 1043\r
1044**/\r
878ddf1f 1045typedef\r
1046VOID\r
1047(EFIAPI *EFI_SET_MEM) (\r
1048 IN VOID *Buffer,\r
1049 IN UINTN Size,\r
1050 IN UINT8 Value\r
1051 );\r
1052\r
1053//\r
1054// Protocol handler functions\r
1055//\r
1056typedef enum {\r
1057 EFI_NATIVE_INTERFACE\r
1058} EFI_INTERFACE_TYPE;\r
1059\r
c0b162a2 1060/**\r
878ddf1f 1061 Installs a protocol interface on a device handle. If the handle does not exist, it is created and added\r
c0b162a2 1062 to the list of handles in the system. InstallMultipleProtocolInterfaces() performs\r
1063 more error checking than InstallProtocolInterface(), so it is recommended that\r
1064 InstallMultipleProtocolInterfaces() be used in place of\r
1065 InstallProtocolInterface()\r
1066\r
878ddf1f 1067 @param Handle A pointer to the EFI_HANDLE on which the interface is to be installed.\r
1068 @param Protocol The numeric ID of the protocol interface.\r
c0b162a2 1069 @param InterfaceType Indicates whether Interface is supplied in native form.\r
878ddf1f 1070 @param Interface A pointer to the protocol interface.\r
c0b162a2 1071\r
878ddf1f 1072 @retval EFI_SUCCESS The protocol interface was installed.\r
c0b162a2 1073 @retval EFI_OUT_OF_RESOURCES Space for a new handle could not be allocated.\r
1074 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1075\r
1076**/\r
878ddf1f 1077typedef\r
1078EFI_STATUS\r
1079(EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) (\r
30a60d29
LG
1080 IN OUT EFI_HANDLE *Handle,\r
1081 IN EFI_GUID *Protocol,\r
1082 IN EFI_INTERFACE_TYPE InterfaceType,\r
1083 IN VOID *Interface\r
878ddf1f 1084 );\r
1085\r
c0b162a2 1086/**\r
878ddf1f 1087 Installs one or more protocol interfaces into the boot services environment.\r
c0b162a2 1088\r
878ddf1f 1089 @param Handle The handle to install the new protocol interfaces on, or NULL if a new\r
c0b162a2 1090 handle is to be allocated.\r
878ddf1f 1091 @param ... A variable argument list containing pairs of protocol GUIDs and protocol\r
c0b162a2 1092 interfaces.\r
878ddf1f 1093\r
1094 @retval EFI_SUCCESS All the protocol interface was installed.\r
1095 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.\r
1096 @retval EFI_ALREADY_STARTED A Device Path Protocol instance was passed in that is already present in\r
1097 the handle database.\r
c0b162a2 1098\r
1099**/\r
878ddf1f 1100typedef\r
1101EFI_STATUS\r
1102(EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (\r
1103 IN OUT EFI_HANDLE *Handle,\r
1104 ...\r
1105 );\r
1106\r
c0b162a2 1107/**\r
878ddf1f 1108 Reinstalls a protocol interface on a device handle.\r
c0b162a2 1109\r
1110 @param Handle Handle on which the interface is to be reinstalled.\r
878ddf1f 1111 @param Protocol The numeric ID of the interface.\r
1112 @param OldInterface A pointer to the old interface. NULL can be used if a structure is not\r
c0b162a2 1113 associated with Protocol.\r
1114 @param NewInterface A pointer to the new interface.\r
1115\r
878ddf1f 1116 @retval EFI_SUCCESS The protocol interface was reinstalled.\r
1117 @retval EFI_NOT_FOUND The OldInterface on the handle was not found.\r
1118 @retval EFI_ACCESS_DENIED The protocol interface could not be reinstalled,\r
c0b162a2 1119 because OldInterface is still being used by a\r
1120 driver that will not release it.\r
1121 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1122\r
1123**/\r
878ddf1f 1124typedef\r
1125EFI_STATUS\r
1126(EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE) (\r
1127 IN EFI_HANDLE Handle,\r
1128 IN EFI_GUID *Protocol,\r
1129 IN VOID *OldInterface,\r
1130 IN VOID *NewInterface\r
1131 );\r
1132\r
c0b162a2 1133/**\r
878ddf1f 1134 Removes a protocol interface from a device handle. It is recommended that\r
c0b162a2 1135 UninstallMultipleProtocolInterfaces() be used in place of\r
1136 UninstallProtocolInterface().\r
1137\r
878ddf1f 1138 @param Handle The handle on which the interface was installed.\r
1139 @param Protocol The numeric ID of the interface.\r
c0b162a2 1140 @param Interface A pointer to the interface.\r
1141\r
878ddf1f 1142 @retval EFI_SUCCESS The interface was removed.\r
1143 @retval EFI_NOT_FOUND The interface was not found.\r
1144 @retval EFI_ACCESS_DENIED The interface was not removed because the interface\r
c0b162a2 1145 is still being used by a driver.\r
1146 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1147\r
1148**/\r
878ddf1f 1149typedef\r
1150EFI_STATUS\r
1151(EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE) (\r
1152 IN EFI_HANDLE Handle,\r
1153 IN EFI_GUID *Protocol,\r
1154 IN VOID *Interface\r
1155 );\r
1156\r
c0b162a2 1157/**\r
1158 Removes one or more protocol interfaces into the boot services environment.\r
1159\r
1160 @param Handle The handle to remove the protocol interfaces from.\r
878ddf1f 1161 @param ... A variable argument list containing pairs of protocol GUIDs and\r
1162 protocol interfaces.\r
c0b162a2 1163\r
1164 @retval EFI_SUCCESS All the protocol interfaces were removed.\r
1165 @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.\r
1166\r
1167**/\r
878ddf1f 1168typedef\r
1169EFI_STATUS\r
1170(EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (\r
1171 IN EFI_HANDLE Handle,\r
1172 ...\r
1173 );\r
1174\r
c0b162a2 1175/**\r
878ddf1f 1176 Queries a handle to determine if it supports a specified protocol.\r
c0b162a2 1177\r
878ddf1f 1178 @param Handle The handle being queried.\r
1179 @param Protocol The published unique identifier of the protocol.\r
1180 @param Interface Supplies the address where a pointer to the corresponding Protocol\r
c0b162a2 1181 Interface is returned.\r
878ddf1f 1182 @retval EFI_SUCCESS The interface information for the specified protocol was returned.\r
1183 @retval EFI_UNSUPPORTED The device does not support the specified protocol.\r
c0b162a2 1184 @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.\r
1185\r
1186**/\r
878ddf1f 1187typedef\r
1188EFI_STATUS\r
1189(EFIAPI *EFI_HANDLE_PROTOCOL) (\r
30a60d29
LG
1190 IN EFI_HANDLE Handle,\r
1191 IN EFI_GUID *Protocol,\r
1192 OUT VOID **Interface\r
878ddf1f 1193 );\r
1194\r
1195#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001\r
1196#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002\r
1197#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004\r
1198#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008\r
1199#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010\r
1200#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020\r
1201\r
c0b162a2 1202/**\r
878ddf1f 1203 Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the\r
1204 handle, it opens the protocol on behalf of the calling agent.\r
c0b162a2 1205\r
878ddf1f 1206 @param Handle The handle for the protocol interface that is being opened.\r
1207 @param Protocol The published unique identifier of the protocol.\r
1208 @param Interface Supplies the address where a pointer to the corresponding Protocol\r
c0b162a2 1209 Interface is returned.\r
878ddf1f 1210 @param AgentHandle The handle of the agent that is opening the protocol interface\r
c0b162a2 1211 specified by Protocol and Interface.\r
1212 @param ControllerHandle If the agent that is opening a protocol is a driver that follows the\r
1213 UEFI Driver Model, then this parameter is the controller handle\r
1214 that requires the protocol interface. If the agent does not follow\r
1215 the UEFI Driver Model, then this parameter is optional and may\r
1216 be NULL.\r
1217 @param Attributes The open mode of the protocol interface specified by Handle\r
1218 and Protocol.\r
1219\r
878ddf1f 1220 @retval EFI_SUCCESS An item was added to the open list for the protocol interface, and the\r
c0b162a2 1221 protocol interface was returned in Interface.\r
878ddf1f 1222 @retval EFI_UNSUPPORTED Handle does not support Protocol.\r
1223 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
1224 @retval EFI_ACCESS_DENIED Required attributes can't be supported in current environment.\r
1225 @retval EFI_ALREADY_STARTED Item on the open list already has requierd attributes whose agent\r
c0b162a2 1226 handle is the same as AgentHandle.\r
1227\r
1228**/\r
878ddf1f 1229typedef\r
1230EFI_STATUS\r
1231(EFIAPI *EFI_OPEN_PROTOCOL) (\r
30a60d29
LG
1232 IN EFI_HANDLE Handle,\r
1233 IN EFI_GUID *Protocol,\r
878ddf1f 1234 OUT VOID **Interface,\r
1235 IN EFI_HANDLE AgentHandle,\r
1236 IN EFI_HANDLE ControllerHandle, OPTIONAL\r
1237 IN UINT32 Attributes\r
1238 );\r
1239\r
c0b162a2 1240\r
1241/**\r
878ddf1f 1242 Closes a protocol on a handle that was opened using OpenProtocol().\r
c0b162a2 1243\r
878ddf1f 1244 @param Handle The handle for the protocol interface that was previously opened\r
c0b162a2 1245 with OpenProtocol(), and is now being closed.\r
878ddf1f 1246 @param Protocol The published unique identifier of the protocol.\r
1247 @param Interface Supplies the address where a pointer to the corresponding Protocol\r
c0b162a2 1248 Interface is returned.\r
1249 @param AgentHandle The handle of the agent that is closing the protocol interface.\r
878ddf1f 1250 @param ControllerHandle If the agent that opened a protocol is a driver that follows the\r
c0b162a2 1251 UEFI Driver Model, then this parameter is the controller handle\r
1252 that required the protocol interface.\r
1253\r
1254 @retval EFI_SUCCESS The protocol instance was closed.\r
1255 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
878ddf1f 1256 @retval EFI_NOT_FOUND 1) Handle does not support the protocol specified by Protocol.\r
1257 2) The protocol interface specified by Handle and Protocol is not\r
c0b162a2 1258 currently open by AgentHandle and ControllerHandle.\r
1259\r
1260**/\r
878ddf1f 1261typedef\r
1262EFI_STATUS\r
1263(EFIAPI *EFI_CLOSE_PROTOCOL) (\r
1264 IN EFI_HANDLE Handle,\r
1265 IN EFI_GUID *Protocol,\r
1266 IN EFI_HANDLE AgentHandle,\r
1267 IN EFI_HANDLE ControllerHandle\r
1268 );\r
1269\r
1270typedef struct {\r
1271 EFI_HANDLE AgentHandle;\r
1272 EFI_HANDLE ControllerHandle;\r
1273 UINT32 Attributes;\r
1274 UINT32 OpenCount;\r
1275} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;\r
1276\r
c0b162a2 1277/**\r
878ddf1f 1278 Retrieves the list of agents that currently have a protocol interface opened.\r
c0b162a2 1279\r
1280 @param Handle The handle for the protocol interface that is being queried.\r
878ddf1f 1281 @param Protocol The published unique identifier of the protocol.\r
1282 @param EntryBuffer A pointer to a buffer of open protocol information in the form of\r
c0b162a2 1283 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.\r
878ddf1f 1284 @param EntryCount A pointer to the number of entries in EntryBuffer.\r
c0b162a2 1285\r
878ddf1f 1286 @retval EFI_SUCCESS The open protocol information was returned in EntryBuffer, and the\r
c0b162a2 1287 number of entries was returned EntryCount.\r
878ddf1f 1288 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate EntryBuffer.\r
1289 @retval EFI_NOT_FOUND Handle does not support the protocol specified by Protocol.\r
c0b162a2 1290\r
1291**/\r
878ddf1f 1292typedef\r
1293EFI_STATUS\r
1294(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (\r
1295 IN EFI_HANDLE Handle,\r
1296 IN EFI_GUID *Protocol,\r
1297 IN EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,\r
1298 OUT UINTN *EntryCount\r
1299 );\r
1300\r
c0b162a2 1301/**\r
878ddf1f 1302 Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r
c0b162a2 1303 from pool.\r
1304\r
878ddf1f 1305 @param Handle The handle from which to retrieve the list of protocol interface\r
c0b162a2 1306 GUIDs.\r
878ddf1f 1307 @param ProtocolBuffer A pointer to the list of protocol interface GUID pointers that are\r
c0b162a2 1308 installed on Handle.\r
1309 @param ProtocolBufferCount A pointer to the number of GUID pointers present in\r
1310 ProtocolBuffer.\r
1311\r
878ddf1f 1312 @retval EFI_SUCCESS The list of protocol interface GUIDs installed on Handle was returned in\r
c0b162a2 1313 ProtocolBuffer. The number of protocol interface GUIDs was\r
1314 returned in ProtocolBufferCount.\r
878ddf1f 1315 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.\r
1316 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
c0b162a2 1317\r
878ddf1f 1318**/\r
1319typedef\r
1320EFI_STATUS\r
1321(EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (\r
30a60d29 1322 IN EFI_HANDLE Handle,\r
878ddf1f 1323 OUT EFI_GUID ***ProtocolBuffer,\r
1324 OUT UINTN *ProtocolBufferCount\r
1325 );\r
1326\r
c0b162a2 1327/**\r
1328 Creates an event that is to be signaled whenever an interface is installed for a specified protocol.\r
1329\r
1330 @param Protocol The numeric ID of the protocol for which the event is to be registered.\r
878ddf1f 1331 @param Event Event that is to be signaled whenever a protocol interface is registered\r
c0b162a2 1332 for Protocol.\r
1333 @param Registration A pointer to a memory location to receive the registration value.\r
1334\r
1335 @retval EFI_SUCCESS The notification event has been registered.\r
878ddf1f 1336 @retval EFI_OUT_OF_RESOURCES Space for the notification event could not be allocated.\r
1337 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
c0b162a2 1338\r
878ddf1f 1339**/\r
1340typedef\r
1341EFI_STATUS\r
1342(EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) (\r
30a60d29
LG
1343 IN EFI_GUID *Protocol,\r
1344 IN EFI_EVENT Event,\r
1345 OUT VOID **Registration\r
878ddf1f 1346 );\r
1347\r
1348typedef enum {\r
1349 AllHandles,\r
1350 ByRegisterNotify,\r
1351 ByProtocol\r
1352} EFI_LOCATE_SEARCH_TYPE;\r
1353\r
c0b162a2 1354/**\r
878ddf1f 1355 Returns an array of handles that support a specified protocol.\r
c0b162a2 1356\r
878ddf1f 1357 @param SearchType Specifies which handle(s) are to be returned.\r
1358 @param Protocol Specifies the protocol to search by.\r
c0b162a2 1359 @param SearchKey Specifies the search key.\r
1360 @param BufferSize On input, the size in bytes of Buffer. On output, the size in bytes of\r
1361 the array returned in Buffer (if the buffer was large enough) or the\r
878ddf1f 1362 size, in bytes, of the buffer needed to obtain the array (if the buffer was\r
c0b162a2 1363 not large enough).\r
878ddf1f 1364 @param Buffer The buffer in which the array is returned.\r
c0b162a2 1365\r
878ddf1f 1366 @retval EFI_SUCCESS The array of handles was returned.\r
1367 @retval EFI_NOT_FOUND No handles match the search.\r
c0b162a2 1368 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.\r
878ddf1f 1369 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
c0b162a2 1370\r
878ddf1f 1371**/\r
1372typedef\r
1373EFI_STATUS\r
1374(EFIAPI *EFI_LOCATE_HANDLE) (\r
30a60d29
LG
1375 IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
1376 IN EFI_GUID *Protocol, OPTIONAL\r
1377 IN VOID *SearchKey, OPTIONAL\r
1378 IN OUT UINTN *BufferSize,\r
1379 OUT EFI_HANDLE *Buffer\r
878ddf1f 1380 );\r
1381\r
c0b162a2 1382/**\r
878ddf1f 1383 Locates the handle to a device on the device path that supports the specified protocol.\r
c0b162a2 1384\r
878ddf1f 1385 @param Protocol Specifies the protocol to search for.\r
1386 @param DevicePath On input, a pointer to a pointer to the device path. On output, the device\r
c0b162a2 1387 path pointer is modified to point to the remaining part of the device\r
1388 path.\r
1389 @param Device A pointer to the returned device handle.\r
1390\r
878ddf1f 1391 @retval EFI_SUCCESS The resulting handle was returned.\r
c0b162a2 1392 @retval EFI_NOT_FOUND No handles match the search.\r
878ddf1f 1393 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
c0b162a2 1394\r
878ddf1f 1395**/\r
1396typedef\r
1397EFI_STATUS\r
1398(EFIAPI *EFI_LOCATE_DEVICE_PATH) (\r
30a60d29
LG
1399 IN EFI_GUID *Protocol,\r
1400 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,\r
1401 OUT EFI_HANDLE *Device\r
878ddf1f 1402 );\r
1403\r
c0b162a2 1404/**\r
878ddf1f 1405 Adds, updates, or removes a configuration table entry from the EFI System Table.\r
c0b162a2 1406\r
878ddf1f 1407 @param Guid A pointer to the GUID for the entry to add, update, or remove.\r
1408 @param Table A pointer to the configuration table for the entry to add, update, or\r
c0b162a2 1409 remove. May be NULL.\r
1410\r
878ddf1f 1411 @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.\r
1412 @retval EFI_NOT_FOUND An attempt was made to delete a nonexistent entry.\r
1413 @retval EFI_INVALID_PARAMETER Guid is not valid.\r
1414 @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.\r
c0b162a2 1415\r
878ddf1f 1416**/\r
1417typedef\r
1418EFI_STATUS\r
1419(EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) (\r
1420 IN EFI_GUID *Guid,\r
1421 IN VOID *Table\r
1422 );\r
1423\r
c0b162a2 1424/**\r
878ddf1f 1425 Reserved service.\r
c0b162a2 1426\r
878ddf1f 1427 @retval EFI_SUCCESS The operation has been completed successfully.\r
c0b162a2 1428\r
878ddf1f 1429**/\r
1430typedef\r
1431EFI_STATUS\r
1432(EFIAPI *EFI_RESERVED_SERVICE) (\r
1433 VOID\r
1434 );\r
1435\r
c0b162a2 1436/**\r
878ddf1f 1437 Returns an array of handles that support the requested protocol in a buffer allocated from pool.\r
c0b162a2 1438\r
878ddf1f 1439 @param SearchType Specifies which handle(s) are to be returned.\r
1440 @param Protocol Specifies the protocol to search by.\r
1441 @param SearchKey Supplies the search key depending on the SearchType.\r
1442 @param NoHandles The number of handles returned in Buffer.\r
1443 @param Buffer A pointer to the buffer to return the requested array of handles that\r
c0b162a2 1444 support Protocol.\r
1445\r
878ddf1f 1446 @retval EFI_SUCCESS The array of handles was returned in Buffer, and the number of\r
c0b162a2 1447 handles in Buffer was returned in NoHandles.\r
878ddf1f 1448 @retval EFI_NOT_FOUND No handles match the search.\r
1449 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the matching results.\r
1450 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
c0b162a2 1451\r
878ddf1f 1452**/\r
1453typedef\r
1454EFI_STATUS\r
1455(EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (\r
30a60d29
LG
1456 IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
1457 IN EFI_GUID *Protocol, OPTIONAL\r
1458 IN VOID *SearchKey, OPTIONAL\r
1459 IN OUT UINTN *NoHandles,\r
1460 OUT EFI_HANDLE **Buffer\r
878ddf1f 1461 );\r
1462\r
c0b162a2 1463/**\r
878ddf1f 1464 Returns the first protocol instance that matches the given protocol.\r
c0b162a2 1465\r
878ddf1f 1466 @param Protocol Provides the protocol to search for.\r
1467 @param Registration Optional registration key returned from\r
c0b162a2 1468 RegisterProtocolNotify().\r
878ddf1f 1469 @param Interface On return, a pointer to the first interface that matches Protocol and\r
c0b162a2 1470 Registration.\r
1471\r
878ddf1f 1472 @retval EFI_SUCCESS A protocol instance matching Protocol was found and returned in\r
c0b162a2 1473 Interface.\r
878ddf1f 1474 @retval EFI_NOT_FOUND No protocol instances were found that match Protocol and\r
c0b162a2 1475 Registration.\r
878ddf1f 1476 @retval EFI_INVALID_PARAMETER Interface is NULL.\r
c0b162a2 1477\r
878ddf1f 1478**/\r
1479typedef\r
1480EFI_STATUS\r
1481(EFIAPI *EFI_LOCATE_PROTOCOL) (\r
30a60d29
LG
1482 IN EFI_GUID *Protocol,\r
1483 IN VOID *Registration, OPTIONAL\r
878ddf1f 1484 OUT VOID **Interface\r
1485 );\r
1486\r
878ddf1f 1487typedef struct {\r
1488 UINT64 Length;\r
1489 union {\r
1490 EFI_PHYSICAL_ADDRESS DataBlock;\r
1491 EFI_PHYSICAL_ADDRESS ContinuationPointer;\r
1492 } Union;\r
1493} UEFI_CAPSULE_BLOCK_DESCRIPTOR;\r
1494\r
1495typedef struct {\r
30a60d29 1496 EFI_GUID CapsuleGuid;\r
878ddf1f 1497 UINT32 HeaderSize;\r
1498 UINT32 Flags;\r
1499 UINT32 CapsuleImageSize;\r
1500} UEFI_CAPSULE_HEADER;\r
1501\r
30a60d29 1502#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000\r
878ddf1f 1503#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000\r
1504\r
c0b162a2 1505/**\r
878ddf1f 1506 Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended\r
c0b162a2 1507 consumption, the firmware may process the capsule immediately. If the payload should persist\r
1508 across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must\r
1509 be passed into ResetSystem() and will cause the capsule to be processed by the firmware as\r
1510 part of the reset process.\r
1511\r
878ddf1f 1512 @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules\r
c0b162a2 1513 being passed into update capsule.\r
878ddf1f 1514 @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r
c0b162a2 1515 CaspuleHeaderArray.\r
1516 @param ScatterGatherList Physical pointer to a set of\r
878ddf1f 1517 EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the\r
1518 location in physical memory of a set of capsules.\r
c0b162a2 1519\r
1520 @retval EFI_SUCCESS Valid capsule was passed. If\r
878ddf1f 1521 CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the\r
1522 capsule has been successfully processed by the firmware.\r
c0b162a2 1523 @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error.\r
878ddf1f 1524 @retval EFI_INVALID_PARAMETER CapsuleSize is NULL.\r
c0b162a2 1525\r
878ddf1f 1526**/\r
1527typedef\r
1528EFI_STATUS\r
1529(EFIAPI *EFI_UPDATE_CAPSULE) (\r
1530 IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,\r
1531 IN UINTN CapsuleCount,\r
1532 IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL\r
1533 );\r
1534\r
c0b162a2 1535/**\r
878ddf1f 1536 Returns if the capsule can be supported via UpdateCapsule().\r
c0b162a2 1537\r
878ddf1f 1538 @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules\r
c0b162a2 1539 being passed into update capsule.\r
878ddf1f 1540 @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r
c0b162a2 1541 CaspuleHeaderArray.\r
878ddf1f 1542 @param MaxiumCapsuleSize On output the maximum size that UpdateCapsule() can\r
c0b162a2 1543 support as an argument to UpdateCapsule() via\r
1544 CapsuleHeaderArray and ScatterGatherList.\r
1545 @param ResetType Returns the type of reset required for the capsule update.\r
1546\r
1547 @retval EFI_SUCCESS Valid answer returned.\r
878ddf1f 1548 @retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and\r
c0b162a2 1549 MaximumCapsuleSize and ResetType are undefined.\r
878ddf1f 1550 @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.\r
c0b162a2 1551\r
878ddf1f 1552**/\r
1553typedef\r
1554EFI_STATUS\r
1555(EFIAPI *EFI_QUERY_CAPSULE_CAPABILITIES) (\r
30a60d29
LG
1556 IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,\r
1557 IN UINTN CapsuleCount,\r
1558 OUT UINT64 *MaximumCapsuleSize,\r
1559 OUT EFI_RESET_TYPE *ResetType\r
878ddf1f 1560 );\r
1561\r
c0b162a2 1562/**\r
878ddf1f 1563 Returns information about the EFI variables.\r
c0b162a2 1564\r
878ddf1f 1565 @param Attributes Attributes bitmask to specify the type of variables on\r
c0b162a2 1566 which to return information.\r
1567 @param MaximumVariableStorageSize On output the maximum size of the storage space\r
878ddf1f 1568 available for the EFI variables associated with the\r
c0b162a2 1569 attributes specified.\r
1570 @param RemainingVariableStorageSize Returns the remaining size of the storage space\r
878ddf1f 1571 available for the EFI variables associated with the\r
c0b162a2 1572 attributes specified.\r
1573 @param MaximumVariableSize Returns the maximum size of the individual EFI\r
1574 variables associated with the attributes specified.\r
1575\r
1576 @retval EFI_SUCCESS Valid answer returned.\r
1577 @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied\r
878ddf1f 1578 @retval EFI_UNSUPPORTED The attribute is not supported on this platform, and the\r
c0b162a2 1579 MaximumVariableStorageSize,\r
1580 RemainingVariableStorageSize, MaximumVariableSize\r
1581 are undefined.\r
1582\r
1583**/\r
1584typedef\r
878ddf1f 1585EFI_STATUS\r
1586(EFIAPI *EFI_QUERY_VARIABLE_INFO) (\r
30a60d29 1587 IN UINT32 Attributes,\r
878ddf1f 1588 OUT UINT64 *MaximumVariableStorageSize,\r
30a60d29 1589 OUT UINT64 *RemainingVariableStorageSize,\r
878ddf1f 1590 OUT UINT64 *MaximumVariableSize\r
1591 );\r
1592\r
1593\r
1594//\r
1595// EFI Runtime Services Table\r
1596//\r
1597#define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | 02)\r
1598#define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | 10)\r
1599#define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | 0)\r
1600\r
1601#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552ULL\r
1602#define EFI_RUNTIME_SERVICES_REVISION (EFI_2_00_SYSTEM_TABLE_REVISION)\r
1603\r
1604#if (EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)\r
1605//\r
1606// Include the definition for TIANO_REPORT_STATUS_CODE if this is the version\r
1607// of Tiano that extended the EFI specification. If Tiano mode is diabled\r
1608// don't include it.\r
1609//\r
1610#include <Dxe/ArchProtocol/StatusCode.h>\r
1611#endif\r
1612\r
1613\r
1614typedef struct {\r
1615 EFI_TABLE_HEADER Hdr;\r
1616\r
1617 //\r
1618 // Time services\r
1619 //\r
1620 EFI_GET_TIME GetTime;\r
1621 EFI_SET_TIME SetTime;\r
1622 EFI_GET_WAKEUP_TIME GetWakeupTime;\r
1623 EFI_SET_WAKEUP_TIME SetWakeupTime;\r
1624\r
1625 //\r
1626 // Virtual memory services\r
1627 //\r
1628 EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap;\r
1629 EFI_CONVERT_POINTER ConvertPointer;\r
1630\r
1631 //\r
1632 // Variable services\r
1633 //\r
1634 EFI_GET_VARIABLE GetVariable;\r
1635 EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName;\r
1636 EFI_SET_VARIABLE SetVariable;\r
1637\r
1638 //\r
1639 // Misc\r
1640 //\r
1641 EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount;\r
1642 EFI_RESET_SYSTEM ResetSystem;\r
1643\r
1644#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
1645 //\r
1646 // New Boot Services added by UEFI 2.0\r
1647 //\r
1648 EFI_UPDATE_CAPSULE UpdateCapsule;\r
1649 EFI_QUERY_CAPSULE_CAPABILITIES QueryCapsuleCapabilities;\r
1650 EFI_QUERY_VARIABLE_INFO QueryVariableInfo;\r
1651#elif (EDK_RELEASE_VERSION != 0)\r
1652 //\r
1653 // Tiano extension to EFI 1.10 runtime table\r
1654 // It was moved to a protocol to not conflict with UEFI 2.0\r
1655 // If Tiano is disabled this item is not enabled for EFI 1.10\r
1656 //\r
36122070 1657 EFI_REPORT_STATUS_CODE ReportStatusCode;\r
878ddf1f 1658#endif\r
1659} EFI_RUNTIME_SERVICES;\r
1660\r
1661//\r
1662// EFI Boot Services Table\r
1663//\r
1664#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42ULL\r
1665#define EFI_BOOT_SERVICES_REVISION (EFI_2_00_SYSTEM_TABLE_REVISION)\r
1666\r
1667typedef struct {\r
1668 EFI_TABLE_HEADER Hdr;\r
1669\r
1670 //\r
1671 // Task priority functions\r
1672 //\r
1673 EFI_RAISE_TPL RaiseTPL;\r
1674 EFI_RESTORE_TPL RestoreTPL;\r
1675\r
1676 //\r
1677 // Memory functions\r
1678 //\r
1679 EFI_ALLOCATE_PAGES AllocatePages;\r
1680 EFI_FREE_PAGES FreePages;\r
1681 EFI_GET_MEMORY_MAP GetMemoryMap;\r
1682 EFI_ALLOCATE_POOL AllocatePool;\r
1683 EFI_FREE_POOL FreePool;\r
1684\r
1685 //\r
1686 // Event & timer functions\r
1687 //\r
1688 EFI_CREATE_EVENT CreateEvent;\r
1689 EFI_SET_TIMER SetTimer;\r
1690 EFI_WAIT_FOR_EVENT WaitForEvent;\r
1691 EFI_SIGNAL_EVENT SignalEvent;\r
1692 EFI_CLOSE_EVENT CloseEvent;\r
1693 EFI_CHECK_EVENT CheckEvent;\r
1694\r
1695 //\r
1696 // Protocol handler functions\r
1697 //\r
1698 EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;\r
1699 EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;\r
1700 EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;\r
1701 EFI_HANDLE_PROTOCOL HandleProtocol;\r
1702 VOID *Reserved;\r
1703 EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;\r
1704 EFI_LOCATE_HANDLE LocateHandle;\r
1705 EFI_LOCATE_DEVICE_PATH LocateDevicePath;\r
1706 EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;\r
1707\r
1708 //\r
1709 // Image functions\r
1710 //\r
1711 EFI_IMAGE_LOAD LoadImage;\r
1712 EFI_IMAGE_START StartImage;\r
1713 EFI_EXIT Exit;\r
1714 EFI_IMAGE_UNLOAD UnloadImage;\r
1715 EFI_EXIT_BOOT_SERVICES ExitBootServices;\r
1716\r
1717 //\r
1718 // Misc functions\r
1719 //\r
1720 EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;\r
1721 EFI_STALL Stall;\r
1722 EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;\r
1723\r
1724 //\r
1725 // ////////////////////////////////////////////////////\r
1726 // EFI 1.1 Services\r
1727 //////////////////////////////////////////////////////\r
1728 //\r
1729 // DriverSupport Services\r
1730 //\r
1731 EFI_CONNECT_CONTROLLER ConnectController;\r
1732 EFI_DISCONNECT_CONTROLLER DisconnectController;\r
1733\r
1734 //\r
1735 // Added Open and Close protocol for the new driver model\r
1736 //\r
1737 EFI_OPEN_PROTOCOL OpenProtocol;\r
1738 EFI_CLOSE_PROTOCOL CloseProtocol;\r
1739 EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation;\r
1740\r
1741 //\r
1742 // Added new services to EFI 1.1 as Lib to reduce code size.\r
1743 //\r
1744 EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle;\r
1745 EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer;\r
1746 EFI_LOCATE_PROTOCOL LocateProtocol;\r
1747\r
1748 EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;\r
1749 EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;\r
1750\r
1751 //\r
1752 // CRC32 services\r
1753 //\r
1754 EFI_CALCULATE_CRC32 CalculateCrc32;\r
1755\r
1756 //\r
1757 // Memory Utility Services\r
1758 //\r
1759 EFI_COPY_MEM CopyMem;\r
1760 EFI_SET_MEM SetMem;\r
1761\r
1762#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
1763 //\r
1764 // UEFI 2.0 Extension to the table\r
1765 //\r
1766 EFI_CREATE_EVENT_EX CreateEventEx;\r
1767#endif\r
1768} EFI_BOOT_SERVICES;\r
1769\r
1770//\r
1771// EFI Configuration Table\r
1772//\r
1773typedef struct {\r
1774 EFI_GUID VendorGuid;\r
1775 VOID *VendorTable;\r
1776} EFI_CONFIGURATION_TABLE;\r
1777\r
1778//\r
1779// EFI System Table\r
1780//\r
1781#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249ULL\r
1782#define EFI_SYSTEM_TABLE_REVISION (EFI_2_00_SYSTEM_TABLE_REVISION)\r
1783\r
1784struct _EFI_SYSTEM_TABLE {\r
1785 EFI_TABLE_HEADER Hdr;\r
1786\r
1787 CHAR16 *FirmwareVendor;\r
1788 UINT32 FirmwareRevision;\r
1789\r
1790 EFI_HANDLE ConsoleInHandle;\r
1791 EFI_SIMPLE_TEXT_IN_PROTOCOL *ConIn;\r
1792\r
1793 EFI_HANDLE ConsoleOutHandle;\r
1794 EFI_SIMPLE_TEXT_OUT_PROTOCOL *ConOut;\r
1795\r
1796 EFI_HANDLE StandardErrorHandle;\r
1797 EFI_SIMPLE_TEXT_OUT_PROTOCOL *StdErr;\r
1798\r
1799 EFI_RUNTIME_SERVICES *RuntimeServices;\r
1800 EFI_BOOT_SERVICES *BootServices;\r
1801\r
1802 UINTN NumberOfTableEntries;\r
1803 EFI_CONFIGURATION_TABLE *ConfigurationTable;\r
1804\r
1805};\r
1806\r
1807//\r
1808// Device Path information\r
1809//\r
1810\r
1811#pragma pack(1)\r
1812\r
1813//\r
1814// Hardware Device Paths\r
1815//\r
1816#define HARDWARE_DEVICE_PATH 0x01\r
1817\r
1818#define HW_PCI_DP 0x01\r
1819typedef struct {\r
1820 EFI_DEVICE_PATH_PROTOCOL Header;\r
1821 UINT8 Function;\r
1822 UINT8 Device;\r
1823} PCI_DEVICE_PATH;\r
1824\r
1825#define HW_PCCARD_DP 0x02\r
1826typedef struct {\r
1827 EFI_DEVICE_PATH_PROTOCOL Header;\r
1828 UINT8 FunctionNumber;\r
1829} PCCARD_DEVICE_PATH;\r
1830\r
1831#define HW_MEMMAP_DP 0x03\r
1832typedef struct {\r
1833 EFI_DEVICE_PATH_PROTOCOL Header;\r
1834 UINT32 MemoryType;\r
1835 EFI_PHYSICAL_ADDRESS StartingAddress;\r
1836 EFI_PHYSICAL_ADDRESS EndingAddress;\r
1837} MEMMAP_DEVICE_PATH;\r
1838\r
1839#define HW_VENDOR_DP 0x04\r
1840typedef struct {\r
1841 EFI_DEVICE_PATH_PROTOCOL Header;\r
1842 EFI_GUID Guid;\r
1843} VENDOR_DEVICE_PATH;\r
1844\r
1845#define HW_CONTROLLER_DP 0x05\r
1846typedef struct {\r
1847 EFI_DEVICE_PATH_PROTOCOL Header;\r
878ddf1f 1848 UINT32 ControllerNumber;\r
878ddf1f 1849} CONTROLLER_DEVICE_PATH;\r
1850\r
1851//\r
1852// ACPI Device Paths\r
1853//\r
1854#define ACPI_DEVICE_PATH 0x02\r
1855\r
1856#define ACPI_DP 0x01\r
1857typedef struct {\r
1858 EFI_DEVICE_PATH_PROTOCOL Header;\r
1859 UINT32 HID;\r
1860 UINT32 UID;\r
1861} ACPI_HID_DEVICE_PATH;\r
1862\r
1863#define ACPI_EXTENDED_DP 0x02\r
1864typedef struct {\r
1865 EFI_DEVICE_PATH_PROTOCOL Header;\r
1866 UINT32 HID;\r
1867 UINT32 UID;\r
1868 UINT32 CID;\r
1869 //\r
1870 // Optional variable length _HIDSTR\r
1871 // Optional variable length _UIDSTR\r
1872 //\r
1873} ACPI_EXTENDED_HID_DEVICE_PATH;\r
1874\r
1875//\r
1876// EISA ID Macro\r
1877// EISA ID Definition 32-bits\r
1878// bits[15:0] - three character compressed ASCII EISA ID.\r
1879// bits[31:16] - binary number\r
1880// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'\r
1881//\r
1882#define PNP_EISA_ID_CONST 0x41d0\r
1883#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16))\r
1884#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
1885#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
1886\r
1887#define PNP_EISA_ID_MASK 0xffff\r
1888#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)\r
1889\r
1890\r
1891#define ACPI_ADR_DP 0x03\r
1892typedef struct {\r
1893 EFI_DEVICE_PATH_PROTOCOL Header;\r
1894 UINT32 ADR;\r
1895} ACPI_ADR_DEVICE_PATH;\r
1896\r
1897\r
1898//\r
1899// Messaging Device Paths\r
1900//\r
1901#define MESSAGING_DEVICE_PATH 0x03\r
1902\r
1903#define MSG_ATAPI_DP 0x01\r
1904typedef struct {\r
1905 EFI_DEVICE_PATH_PROTOCOL Header;\r
1906 UINT8 PrimarySecondary;\r
1907 UINT8 SlaveMaster;\r
1908 UINT16 Lun;\r
1909} ATAPI_DEVICE_PATH;\r
1910\r
1911#define MSG_SCSI_DP 0x02\r
1912typedef struct {\r
1913 EFI_DEVICE_PATH_PROTOCOL Header;\r
1914 UINT16 Pun;\r
1915 UINT16 Lun;\r
1916} SCSI_DEVICE_PATH;\r
1917\r
1918#define MSG_FIBRECHANNEL_DP 0x03\r
1919typedef struct {\r
1920 EFI_DEVICE_PATH_PROTOCOL Header;\r
1921 UINT32 Reserved;\r
1922 UINT64 WWN;\r
1923 UINT64 Lun;\r
1924} FIBRECHANNEL_DEVICE_PATH;\r
1925\r
1926#define MSG_1394_DP 0x04\r
1927typedef struct {\r
1928 EFI_DEVICE_PATH_PROTOCOL Header;\r
1929 UINT32 Reserved;\r
1930 UINT64 Guid;\r
1931} F1394_DEVICE_PATH;\r
1932\r
1933#define MSG_USB_DP 0x05\r
1934typedef struct {\r
1935 EFI_DEVICE_PATH_PROTOCOL Header;\r
1936 UINT8 ParentPortNumber;\r
1937 UINT8 InterfaceNumber;\r
1938} USB_DEVICE_PATH;\r
1939\r
1940#define MSG_USB_CLASS_DP 0x0f\r
1941typedef struct {\r
1942 EFI_DEVICE_PATH_PROTOCOL Header;\r
1943 UINT16 VendorId;\r
1944 UINT16 ProductId;\r
1945 UINT8 DeviceClass;\r
1946 UINT8 DeviceSubClass;\r
1947 UINT8 DeviceProtocol;\r
1948} USB_CLASS_DEVICE_PATH;\r
1949\r
562d2849 1950#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
30a60d29 1951#define MSG_USB_WWID_DP 0x10\r
878ddf1f 1952typedef struct {\r
1953 EFI_DEVICE_PATH_PROTOCOL Header;\r
1954 UINT16 InterfaceNumber;\r
1955 UINT16 VendorId;\r
1956 UINT16 ProductId;\r
1957 // CHAR16 SerialNumber[];\r
1958} USB_WWID_DEVICE_PATH;\r
1959\r
1960#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11\r
1961typedef struct {\r
1962 EFI_DEVICE_PATH_PROTOCOL Header;\r
562d2849 1963 UINT8 Lun;\r
878ddf1f 1964} DEVICE_LOGICAL_UNIT_DEVICE_PATH;\r
562d2849 1965#endif\r
878ddf1f 1966\r
1967#define MSG_I2O_DP 0x06\r
1968typedef struct {\r
1969 EFI_DEVICE_PATH_PROTOCOL Header;\r
1970 UINT32 Tid;\r
1971} I2O_DEVICE_PATH;\r
1972\r
1973#define MSG_MAC_ADDR_DP 0x0b\r
1974typedef struct {\r
1975 EFI_DEVICE_PATH_PROTOCOL Header;\r
1976 EFI_MAC_ADDRESS MacAddress;\r
1977 UINT8 IfType;\r
1978} MAC_ADDR_DEVICE_PATH;\r
1979\r
1980#define MSG_IPv4_DP 0x0c\r
1981typedef struct {\r
1982 EFI_DEVICE_PATH_PROTOCOL Header;\r
1983 EFI_IPv4_ADDRESS LocalIpAddress;\r
1984 EFI_IPv4_ADDRESS RemoteIpAddress;\r
1985 UINT16 LocalPort;\r
1986 UINT16 RemotePort;\r
1987 UINT16 Protocol;\r
1988 BOOLEAN StaticIpAddress;\r
1989} IPv4_DEVICE_PATH;\r
1990\r
1991#define MSG_IPv6_DP 0x0d\r
1992typedef struct {\r
1993 EFI_DEVICE_PATH_PROTOCOL Header;\r
1994 EFI_IPv6_ADDRESS LocalIpAddress;\r
1995 EFI_IPv6_ADDRESS RemoteIpAddress;\r
1996 UINT16 LocalPort;\r
1997 UINT16 RemotePort;\r
1998 UINT16 Protocol;\r
1999 BOOLEAN StaticIpAddress;\r
2000} IPv6_DEVICE_PATH;\r
2001\r
2002#define MSG_INFINIBAND_DP 0x09\r
2003typedef struct {\r
2004 EFI_DEVICE_PATH_PROTOCOL Header;\r
2005 UINT32 ResourceFlags;\r
2006 UINT8 PortGid[16];\r
2007 UINT64 ServiceId;\r
2008 UINT64 TargetPortId;\r
2009 UINT64 DeviceId;\r
2010} INFINIBAND_DEVICE_PATH;\r
2011\r
2012#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01\r
2013#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02\r
2014#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04\r
2015#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08\r
2016#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10\r
2017\r
2018#define MSG_UART_DP 0x0e\r
2019typedef struct {\r
2020 EFI_DEVICE_PATH_PROTOCOL Header;\r
2021 UINT32 Reserved;\r
2022 UINT64 BaudRate;\r
2023 UINT8 DataBits;\r
2024 UINT8 Parity;\r
2025 UINT8 StopBits;\r
2026} UART_DEVICE_PATH;\r
2027\r
2028//\r
2029// Use VENDOR_DEVICE_PATH struct\r
2030//\r
2031#define MSG_VENDOR_DP 0x0a\r
2032\r
2033#define DEVICE_PATH_MESSAGING_PC_ANSI EFI_PC_ANSI_GUID\r
2034#define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID\r
2035#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID\r
2036#define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID\r
878ddf1f 2037\r
562d2849 2038#define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL EFI_UART_DEVICE_PATH_GUID\r
562d2849 2039\r
2040typedef struct {\r
2041 EFI_DEVICE_PATH_PROTOCOL Header;\r
2042 EFI_GUID Guid;\r
2043 UINT32 FlowControlMap;\r
2044} UART_FLOW_CONTROL_DEVICE_PATH;\r
2045\r
2da41b57 2046#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
2047\r
2048#define DEVICE_PATH_MESSAGING_SAS EFI_SAS_DEVICE_PATH_GUID\r
2049\r
562d2849 2050typedef struct {\r
2051 EFI_DEVICE_PATH_PROTOCOL Header;\r
2052 EFI_GUID Guid;\r
2053 UINT32 Reserved;\r
2054 UINT64 SasAddress;\r
2055 UINT64 Lun;\r
2056 UINT16 DeviceTopology;\r
2057 UINT16 RelativeTargetPort;\r
2058} SAS_DEVICE_PATH;\r
878ddf1f 2059\r
2060#define MSG_ISCSI_DP 0x13\r
2061typedef struct {\r
2062 EFI_DEVICE_PATH_PROTOCOL Header;\r
2063 UINT16 NetworkProtocol;\r
2064 UINT16 LoginOption;\r
2065 UINT16 Reserved;\r
2066 UINT16 TargetPortalGroupTag;\r
2067 UINT64 LUN;\r
2068 // CHAR8 iSCSI Target Name\r
2069} ISCSI_DEVICE_PATH;\r
2070\r
2071#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000\r
2072#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002\r
2073#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000\r
2074#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008\r
2075#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000\r
2076#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000\r
2077#define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000\r
2078#define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000\r
2079\r
562d2849 2080#endif\r
878ddf1f 2081\r
2082//\r
2083// Media Device Path\r
2084//\r
2085#define MEDIA_DEVICE_PATH 0x04\r
2086\r
2087#define MEDIA_HARDDRIVE_DP 0x01\r
2088typedef struct {\r
2089 EFI_DEVICE_PATH_PROTOCOL Header;\r
2090 UINT32 PartitionNumber;\r
2091 UINT64 PartitionStart;\r
2092 UINT64 PartitionSize;\r
2093 UINT8 Signature[16];\r
2094 UINT8 MBRType;\r
2095 UINT8 SignatureType;\r
2096} HARDDRIVE_DEVICE_PATH;\r
2097\r
2098#define MBR_TYPE_PCAT 0x01\r
2099#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02\r
2100\r
2101#define SIGNATURE_TYPE_MBR 0x01\r
2102#define SIGNATURE_TYPE_GUID 0x02\r
2103\r
2104#define MEDIA_CDROM_DP 0x02\r
2105typedef struct {\r
2106 EFI_DEVICE_PATH_PROTOCOL Header;\r
2107 UINT32 BootEntry;\r
2108 UINT64 PartitionStart;\r
2109 UINT64 PartitionSize;\r
2110} CDROM_DEVICE_PATH;\r
2111\r
2112//\r
2113// Use VENDOR_DEVICE_PATH struct\r
2114//\r
2115#define MEDIA_VENDOR_DP 0x03\r
2116\r
2117#define MEDIA_FILEPATH_DP 0x04\r
2118typedef struct {\r
2119 EFI_DEVICE_PATH_PROTOCOL Header;\r
2120 CHAR16 PathName[1];\r
2121} FILEPATH_DEVICE_PATH;\r
2122\r
2123#define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)\r
2124\r
2125#define MEDIA_PROTOCOL_DP 0x05\r
2126typedef struct {\r
2127 EFI_DEVICE_PATH_PROTOCOL Header;\r
2128 EFI_GUID Protocol;\r
2129} MEDIA_PROTOCOL_DEVICE_PATH;\r
2130\r
878ddf1f 2131\r
2132typedef struct {\r
2133 EFI_DEVICE_PATH_PROTOCOL Header;\r
a537f148 2134 EFI_GUID TianoSpecificDevicePath;\r
878ddf1f 2135 UINT32 Type;\r
a537f148 2136} TIANO_DEVICE_PATH;\r
878ddf1f 2137\r
a537f148 2138#define TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE 0x01\r
878ddf1f 2139typedef struct {\r
a537f148 2140 TIANO_DEVICE_PATH Tiano;\r
878ddf1f 2141 EFI_GUID NameGuid;\r
2142} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;\r
2143\r
2144//\r
2145// Place holder for a future extension\r
2146//\r
a537f148 2147#define TIANO_MEDIAFW_VOL_DEVICE_PATH_TYPE 0x02\r
878ddf1f 2148typedef struct {\r
a537f148 2149 TIANO_DEVICE_PATH Tiano;\r
878ddf1f 2150 EFI_GUID VolumeGuid;\r
2151} MEDIA_FW_VOL_DEVICE_PATH;\r
2152\r
878ddf1f 2153\r
2154//\r
2155// BBS Device Path\r
2156//\r
2157#define BBS_DEVICE_PATH 0x05\r
2158#define BBS_BBS_DP 0x01\r
2159typedef struct {\r
2160 EFI_DEVICE_PATH_PROTOCOL Header;\r
2161 UINT16 DeviceType;\r
2162 UINT16 StatusFlag;\r
2163 CHAR8 String[1];\r
2164} BBS_BBS_DEVICE_PATH;\r
2165\r
2166//\r
2167// DeviceType definitions - from BBS specification\r
2168//\r
2169#define BBS_TYPE_FLOPPY 0x01\r
2170#define BBS_TYPE_HARDDRIVE 0x02\r
2171#define BBS_TYPE_CDROM 0x03\r
2172#define BBS_TYPE_PCMCIA 0x04\r
2173#define BBS_TYPE_USB 0x05\r
2174#define BBS_TYPE_EMBEDDED_NETWORK 0x06\r
2175#define BBS_TYPE_BEV 0x80\r
2176#define BBS_TYPE_UNKNOWN 0xFF\r
2177\r
2178\r
2179//\r
2180// Union of all possible Device Paths and pointers to Device Paths\r
2181//\r
2182\r
2183typedef union {\r
2184 EFI_DEVICE_PATH_PROTOCOL DevPath;\r
2185 PCI_DEVICE_PATH Pci;\r
2186 PCCARD_DEVICE_PATH PcCard;\r
2187 MEMMAP_DEVICE_PATH MemMap;\r
2188 VENDOR_DEVICE_PATH Vendor;\r
2189\r
2190 CONTROLLER_DEVICE_PATH Controller;\r
2191 ACPI_HID_DEVICE_PATH Acpi;\r
2192\r
2193 ATAPI_DEVICE_PATH Atapi;\r
2194 SCSI_DEVICE_PATH Scsi;\r
2195 FIBRECHANNEL_DEVICE_PATH FibreChannel;\r
2196\r
2197 F1394_DEVICE_PATH F1394;\r
2198 USB_DEVICE_PATH Usb;\r
2199 USB_CLASS_DEVICE_PATH UsbClass;\r
2200 I2O_DEVICE_PATH I2O;\r
2201 MAC_ADDR_DEVICE_PATH MacAddr;\r
2202 IPv4_DEVICE_PATH Ipv4;\r
2203 IPv6_DEVICE_PATH Ipv6;\r
2204 INFINIBAND_DEVICE_PATH InfiniBand;\r
2205 UART_DEVICE_PATH Uart;\r
2206\r
2207 HARDDRIVE_DEVICE_PATH HardDrive;\r
2208 CDROM_DEVICE_PATH CD;\r
2209\r
2210 FILEPATH_DEVICE_PATH FilePath;\r
2211 MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;\r
2212\r
2213 BBS_BBS_DEVICE_PATH Bbs;\r
2214} EFI_DEV_PATH;\r
2215\r
2216\r
2217\r
2218typedef union {\r
2219 EFI_DEVICE_PATH_PROTOCOL *DevPath;\r
2220 PCI_DEVICE_PATH *Pci;\r
2221 PCCARD_DEVICE_PATH *PcCard;\r
2222 MEMMAP_DEVICE_PATH *MemMap;\r
2223 VENDOR_DEVICE_PATH *Vendor;\r
2224\r
2225 CONTROLLER_DEVICE_PATH *Controller;\r
2226 ACPI_HID_DEVICE_PATH *Acpi;\r
2227 ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;\r
2228\r
2229 ATAPI_DEVICE_PATH *Atapi;\r
2230 SCSI_DEVICE_PATH *Scsi;\r
2231 FIBRECHANNEL_DEVICE_PATH *FibreChannel;\r
2232\r
2233 F1394_DEVICE_PATH *F1394;\r
2234 USB_DEVICE_PATH *Usb;\r
2235 USB_CLASS_DEVICE_PATH *UsbClass;\r
2236 I2O_DEVICE_PATH *I2O;\r
2237 MAC_ADDR_DEVICE_PATH *MacAddr;\r
2238 IPv4_DEVICE_PATH *Ipv4;\r
2239 IPv6_DEVICE_PATH *Ipv6;\r
2240 INFINIBAND_DEVICE_PATH *InfiniBand;\r
2241 UART_DEVICE_PATH *Uart;\r
2242\r
2243 HARDDRIVE_DEVICE_PATH *HardDrive;\r
2244 CDROM_DEVICE_PATH *CD;\r
2245\r
2246 FILEPATH_DEVICE_PATH *FilePath;\r
2247 MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;\r
2248\r
2249 BBS_BBS_DEVICE_PATH *Bbs;\r
2250 UINT8 *Raw;\r
2251} EFI_DEV_PATH_PTR;\r
2252\r
2253#pragma pack()\r
2254\r
2255\r
2256//\r
2257// PXE Informations\r
2258//\r
2259\r
2260//\r
2261// Packet definitions\r
2262//\r
2263typedef struct {\r
2264 UINT8 BootpOpcode;\r
2265 UINT8 BootpHwType;\r
2266 UINT8 BootpHwAddrLen;\r
2267 UINT8 BootpGateHops;\r
2268 UINT32 BootpIdent;\r
2269 UINT16 BootpSeconds;\r
2270 UINT16 BootpFlags;\r
2271 UINT8 BootpCiAddr[4];\r
2272 UINT8 BootpYiAddr[4];\r
2273 UINT8 BootpSiAddr[4];\r
2274 UINT8 BootpGiAddr[4];\r
2275 UINT8 BootpHwAddr[16];\r
2276 UINT8 BootpSrvName[64];\r
2277 UINT8 BootpBootFile[128];\r
2278 UINT32 DhcpMagik;\r
2279 UINT8 DhcpOptions[56];\r
2280} EFI_PXE_BASE_CODE_DHCPV4_PACKET;\r
2281\r
2282typedef union {\r
2283 UINT8 Raw[1472];\r
2284 EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4;\r
2285\r
2286 //\r
2287 // EFI_PXE_BASE_CODE_DHCPV6_PACKET Dhcpv6;\r
2288 //\r
2289} EFI_PXE_BASE_CODE_PACKET;\r
2290\r
2291#include <Uefi/EfiPxe.h>\r
2292\r
2293//\r
2294// EFI Revision information\r
2295//\r
2296#define EFI_FIRMWARE_REVISION (EFI_2_00_SYSTEM_TABLE_REVISION)\r
2297\r
2298#include <Common/EfiImage.h>\r
2299#include <IndustryStandard/Usb.h>\r
2300\r
2301\r
2302#define EFI_USB_HC_RESET_GLOBAL 0x0001\r
2303#define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002\r
2304#define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004\r
2305#define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008\r
2306\r
2307//\r
2308// USB Host Controller state\r
2309//\r
2310typedef enum {\r
2311 EfiUsbHcStateHalt,\r
2312 EfiUsbHcStateOperational,\r
2313 EfiUsbHcStateSuspend,\r
2314 EfiUsbHcStateMaximum\r
2315} EFI_USB_HC_STATE;\r
2316\r
2317\r
2318//\r
2319// EFI File location to boot from on removable media devices\r
2320//\r
2321#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI"\r
2322#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI"\r
2323#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI"\r
2324#define EFI_REMOVABLE_MEDIA_FILE_NAME_EBC L"\\EFI\\BOOT\\BOOTEBC.EFI"\r
2325\r
2326#if defined (MDE_CPU_IA32)\r
2327 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA32\r
2328#elif defined (MDE_CPU_IPF)\r
2329 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA64\r
2330#elif defined (MDE_CPU_X64)\r
2331 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64\r
2332#elif defined (MDE_CPU_EBC)\r
2333 #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_EBC\r
2334#else\r
2335 #error Unknown Processor Type\r
2336#endif\r
2337\r
2338\r
2339//\r
06fb8ffd 2340// Protocols from EFI 1.10 that got their names fixed in UEFI 2.0\r
878ddf1f 2341//\r
2342#include <Protocol/LoadedImage.h>\r
2343#include <Protocol/SimpleTextIn.h>\r
2344#include <Protocol/SimpleTextOut.h>\r
2345#include <Protocol/SerialIo.h>\r
2346#include <Protocol/LoadFile.h>\r
2347#include <Protocol/SimpleFileSystem.h>\r
2348#include <Protocol/DiskIo.h>\r
2349#include <Protocol/BlockIo.h>\r
2350#include <Protocol/UnicodeCollation.h>\r
2351#include <Protocol/SimpleNetwork.h>\r
2352#include <Protocol/EfiNetworkInterfaceIdentifier.h>\r
2353#include <Protocol/PxeBaseCode.h>\r
2354#include <Protocol/PxeBaseCodeCallBack.h>\r
2355\r
2356//\r
2357// EFI 1.10 Protocols\r
2358//\r
2359#include <Protocol/Bis.h>\r
2360#include <Protocol/BusSpecificDriverOverride.h>\r
2361#include <Protocol/ComponentName.h>\r
2362#include <Protocol/DebugPort.h>\r
2363#include <Protocol/DebugSupport.h>\r
2364#include <Protocol/Decompress.h>\r
2365#include <Protocol/DriverBinding.h>\r
2366#include <Protocol/DriverConfiguration.h>\r
2367#include <Protocol/DriverDiagnostics.h>\r
2368#include <Protocol/Ebc.h>\r
2369#include <Protocol/EfiNetworkInterfaceIdentifier.h>\r
878ddf1f 2370#include <Protocol/PciIo.h>\r
2371#include <Protocol/PciRootBridgeIo.h>\r
2372#include <Protocol/PlatformDriverOverride.h>\r
2373#include <Protocol/SimplePointer.h>\r
2374#include <Protocol/ScsiPassThru.h>\r
2375#include <Protocol/UsbIo.h>\r
2376#include <Protocol/UsbHostController.h>\r
2377#include <Protocol/UgaDraw.h>\r
2378\r
2379//\r
2380// EFI 1.10 GUIDs\r
2381//\r
2382#include <Guid/Acpi.h>\r
2383#include <Guid/DebugImageInfoTable.h>\r
2384#include <Guid/GlobalVariable.h>\r
2385#include <Guid/Gpt.h>\r
2386#include <Guid/PcAnsi.h>\r
2387#include <Guid/SmBios.h>\r
2388#include <Guid/SalSystemTable.h>\r
fbea738a
LG
2389#include <Guid/FileInfo.h>\r
2390#include <Guid/FileSystemInfo.h>\r
2391#include <Guid/FileSystemVolumeLabelInfo.h>\r
878ddf1f 2392\r
2393#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
2394//\r
2395// Turn on UEFI 2.0 Protocols and GUIDs\r
2396//\r
2397#include <Protocol/AuthenticationInfo.h>\r
2398#include <Protocol/DevicePathUtilities.h>\r
2399#include <Protocol/DevicePathToText.h>\r
2400#include <Protocol/DevicePathFromText.h>\r
2401#include <Protocol/GraphicsOutput.h>\r
2402#include <Protocol/EdidDiscovered.h>\r
2403#include <Protocol/EdidActive.h>\r
2404#include <Protocol/EdidOverride.h>\r
36122070 2405#include <Protocol/ScsiIoExt.h>\r
878ddf1f 2406#include <Protocol/ScsiPassThruExt.h>\r
2407#include <Protocol/IScsiInitatorName.h>\r
2408#include <Protocol/Usb2HostController.h>\r
2409#include <Protocol/TapeIo.h>\r
2410#include <Protocol/ManagedNetwork.h>\r
2411#include <Protocol/Arp.h>\r
2412#include <Protocol/Dhcp4.h>\r
2413#include <Protocol/IP4.h>\r
2414#include <Protocol/IP4Config.h>\r
2415#include <Protocol/Tcp4.h>\r
2416#include <Protocol/Udp4.h>\r
2417#include <Protocol/Mtftp4.h>\r
2418#include <Protocol/ServiceBinding.h>\r
2419#include <Protocol/Hash.h>\r
06fb8ffd 2420#include <Protocol/AcpiTable.h>\r
2421#include <Protocol/ComponentName2.h>\r
878ddf1f 2422\r
2423#include <Guid/EventGroup.h>\r
06fb8ffd 2424#include <Guid/HardwareErrorVariable.h>\r
878ddf1f 2425#endif\r
2426\r
2427\r
2428#endif\r