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