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