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