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