]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/Dxe/DxeMain.h
Measure PEimage and ActionString data according to TPM requirement.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain.h
1 /**@file
2 Header file of DxeCore
3
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _DXE_MAIN_H_
16 #define _DXE_MAIN_H_
17
18
19
20 #include <PiDxe.h>
21
22 #include <Protocol/LoadedImage.h>
23 #include <Protocol/GuidedSectionExtraction.h>
24 #include <Guid/DebugImageInfoTable.h>
25 #include <Protocol/DevicePath.h>
26 #include <Protocol/Runtime.h>
27 #include <Protocol/LoadFile.h>
28 #include <Protocol/DriverBinding.h>
29 #include <Protocol/VariableWrite.h>
30 #include <Protocol/PlatformDriverOverride.h>
31 #include <Protocol/Variable.h>
32 #include <Guid/MemoryTypeInformation.h>
33 #include <Guid/FirmwareFileSystem2.h>
34 #include <Guid/HobList.h>
35 #include <Protocol/Timer.h>
36 #include <Protocol/SimpleFileSystem.h>
37 #include <Protocol/Bds.h>
38 #include <Guid/FileInfo.h>
39 #include <Protocol/RealTimeClock.h>
40 #include <Guid/Apriori.h>
41 #include <Protocol/WatchdogTimer.h>
42 #include <Protocol/FirmwareVolume2.h>
43 #include <Protocol/MonotonicCounter.h>
44 #include <Guid/DxeServices.h>
45 #include <Guid/MemoryAllocationHob.h>
46 #include <Protocol/StatusCode.h>
47 #include <Protocol/CustomizedDecompress.h>
48 #include <Protocol/Decompress.h>
49 #include <Protocol/LoadPe32Image.h>
50 #include <Protocol/FirmwareVolumeDispatch.h>
51 #include <Protocol/Security.h>
52 #include <Protocol/Ebc.h>
53 #include <Guid/EventLegacyBios.h>
54 #include <Protocol/Reset.h>
55 #include <Protocol/EdkDecompress.h>
56 #include <Protocol/Cpu.h>
57 #include <Guid/EventGroup.h>
58 #include <Protocol/Metronome.h>
59 #include <Protocol/FirmwareVolumeBlock.h>
60 #include <Protocol/Capsule.h>
61 #include <Protocol/BusSpecificDriverOverride.h>
62 #include <Protocol/Performance.h>
63 #include <Uefi/UefiTcgPlatform.h>
64 #include <Protocol/TcgPlatform.h>
65
66 #include <Library/DxeCoreEntryPoint.h>
67 #include <Library/DebugLib.h>
68 #include <Library/UefiLib.h>
69 #include <Library/BaseLib.h>
70 #include <Library/HobLib.h>
71 #include <Library/PerformanceLib.h>
72 #include <Library/UefiDecompressLib.h>
73 #include <Library/ExtractGuidedSectionLib.h>
74 #include <Library/CacheMaintenanceLib.h>
75 #include <Library/BaseMemoryLib.h>
76 #include <Library/PeCoffLib.h>
77 #include <Library/PcdLib.h>
78 #include <Library/MemoryAllocationLib.h>
79
80 #include "DebugImageInfo.h"
81 #include "Library.h"
82 #include "FwVolBlock.h"
83 #include "FwVolDriver.h"
84 #include "gcd.h"
85 #include "imem.h"
86 #include "Image.h"
87 #include "Exec.h"
88 #include "hand.h"
89
90
91 //
92 // Modifier for EFI DXE Services
93 //
94 #define EFI_DXESERVICE
95
96 //
97 // attributes for reserved memory before it is promoted to system memory
98 //
99 #define EFI_MEMORY_PRESENT 0x0100000000000000ULL
100 #define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL
101 #define EFI_MEMORY_TESTED 0x0400000000000000ULL
102
103 //
104 // range for memory mapped port I/O on IPF
105 //
106 #define EFI_MEMORY_PORT_IO 0x4000000000000000ULL
107
108
109 ///
110 /// EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependecy expression
111 /// to save time. A EFI_DEP_PUSH is evauated one an
112 /// replaced with EFI_DEP_REPLACE_TRUE
113 ///
114 #define EFI_DEP_REPLACE_TRUE 0xff
115
116 ///
117 /// Define the initial size of the dependency expression evaluation stack
118 ///
119 #define DEPEX_STACK_SIZE_INCREMENT 0x1000
120
121 typedef struct {
122 EFI_GUID *ProtocolGuid;
123 VOID **Protocol;
124 EFI_EVENT Event;
125 VOID *Registration;
126 BOOLEAN Present;
127 } ARCHITECTURAL_PROTOCOL_ENTRY;
128
129 typedef struct {
130 EFI_STATUS_CODE_DATA DataHeader;
131 EFI_HANDLE Handle;
132 } EFI_DXE_DEVICE_HANDLE_EXTENDED_DATA;
133
134 #define EFI_STATUS_CODE_DXE_CORE_GUID \
135 { 0x335984bd, 0xe805, 0x409a, { 0xb8, 0xf8, 0xd2, 0x7e, 0xce, 0x5f, 0xf7, 0xa6 } }
136
137 //
138 // DXE Dispatcher Data structures
139 //
140
141 #define KNOWN_HANDLE_SIGNATURE EFI_SIGNATURE_32('k','n','o','w')
142 typedef struct {
143 UINTN Signature;
144 LIST_ENTRY Link; // mFvHandleList
145 EFI_HANDLE Handle;
146 } KNOWN_HANDLE;
147
148
149 #define EFI_CORE_DRIVER_ENTRY_SIGNATURE EFI_SIGNATURE_32('d','r','v','r')
150 typedef struct {
151 UINTN Signature;
152 LIST_ENTRY Link; // mDriverList
153
154 LIST_ENTRY ScheduledLink; // mScheduledQueue
155
156 EFI_HANDLE FvHandle;
157 EFI_GUID FileName;
158 EFI_DEVICE_PATH_PROTOCOL *FvFileDevicePath;
159 EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
160
161 VOID *Depex;
162 UINTN DepexSize;
163
164 BOOLEAN Before;
165 BOOLEAN After;
166 EFI_GUID BeforeAfterGuid;
167
168 BOOLEAN Dependent;
169 BOOLEAN Unrequested;
170 BOOLEAN Scheduled;
171 BOOLEAN Untrusted;
172 BOOLEAN Initialized;
173 BOOLEAN DepexProtocolError;
174
175 EFI_HANDLE ImageHandle;
176
177 } EFI_CORE_DRIVER_ENTRY;
178
179 //
180 //The data structure of GCD memory map entry
181 //
182 #define EFI_GCD_MAP_SIGNATURE EFI_SIGNATURE_32('g','c','d','m')
183 typedef struct {
184 UINTN Signature;
185 LIST_ENTRY Link;
186 EFI_PHYSICAL_ADDRESS BaseAddress;
187 UINT64 EndAddress;
188 UINT64 Capabilities;
189 UINT64 Attributes;
190 EFI_GCD_MEMORY_TYPE GcdMemoryType;
191 EFI_GCD_IO_TYPE GcdIoType;
192 EFI_HANDLE ImageHandle;
193 EFI_HANDLE DeviceHandle;
194 } EFI_GCD_MAP_ENTRY;
195
196 //
197 // DXE Core Global Variables
198 //
199 extern EFI_SYSTEM_TABLE *gDxeCoreST;
200 extern EFI_BOOT_SERVICES *gDxeCoreBS;
201 extern EFI_RUNTIME_SERVICES *gDxeCoreRT;
202 extern EFI_DXE_SERVICES *gDxeCoreDS;
203 extern EFI_HANDLE gDxeCoreImageHandle;
204
205 extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress;
206
207 extern EFI_RUNTIME_ARCH_PROTOCOL *gRuntime;
208 extern EFI_CPU_ARCH_PROTOCOL *gCpu;
209 extern EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *gWatchdogTimer;
210 extern EFI_METRONOME_ARCH_PROTOCOL *gMetronome;
211 extern EFI_TIMER_ARCH_PROTOCOL *gTimer;
212 extern EFI_SECURITY_ARCH_PROTOCOL *gSecurity;
213 extern EFI_BDS_ARCH_PROTOCOL *gBds;
214 extern EFI_STATUS_CODE_PROTOCOL *gStatusCode;
215
216 extern EFI_TPL gEfiCurrentTpl;
217
218 extern EFI_GUID *gDxeCoreFileName;
219 extern EFI_LOADED_IMAGE_PROTOCOL *gDxeCoreLoadedImage;
220
221 extern EFI_MEMORY_TYPE_INFORMATION gMemoryTypeInformation[EfiMaxMemoryType + 1];
222
223 extern BOOLEAN gDispatcherRunning;
224 extern EFI_RUNTIME_ARCH_PROTOCOL gRuntimeTemplate;
225
226 //
227 // Service Initialization Functions
228 //
229
230
231 VOID
232 CoreInitializePool (
233 VOID
234 )
235 /*++
236
237 Routine Description:
238
239 Called to initialize the pool.
240
241 Arguments:
242
243 None
244
245 Returns:
246
247 None
248
249 --*/
250 ;
251
252 VOID
253 CoreAddMemoryDescriptor (
254 IN EFI_MEMORY_TYPE Type,
255 IN EFI_PHYSICAL_ADDRESS Start,
256 IN UINT64 NumberOfPages,
257 IN UINT64 Attribute
258 )
259 /*++
260
261 Routine Description:
262
263 Called to initialize the memory map and add descriptors to
264 the current descriptor list.
265
266 The first descriptor that is added must be general usable
267 memory as the addition allocates heap.
268
269 Arguments:
270
271 Type - The type of memory to add
272
273 Start - The starting address in the memory range
274 Must be page aligned
275
276 NumberOfPages - The number of pages in the range
277
278 Attribute - Attributes of the memory to add
279
280 Returns:
281
282 None. The range is added to the memory map
283
284 --*/
285 ;
286
287 VOID
288 CoreReleaseGcdMemoryLock (
289 VOID
290 )
291 /*++
292
293 Routine Description:
294 Release memory lock on mGcdMemorySpaceLock
295
296 Arguments:
297 None
298
299 Returns:
300 None
301
302 --*/
303 ;
304
305 VOID
306 CoreAcquireGcdMemoryLock (
307 VOID
308 )
309 /*++
310
311 Routine Description:
312 Acquire memory lock on mGcdMemorySpaceLock
313
314 Arguments:
315 None
316
317 Returns:
318 None
319
320 --*/
321 ;
322
323 EFI_STATUS
324 CoreInitializeMemoryServices (
325 IN VOID **HobStart,
326 IN EFI_PHYSICAL_ADDRESS *MemoryBaseAddress,
327 IN UINT64 *MemoryLength
328 )
329 /*++
330
331 Routine Description:
332
333 External function. Initializes the GCD and memory services based on the memory
334 descriptor HOBs. This function is responsible for priming the GCD map and the
335 memory map, so memory allocations and resource allocations can be made. The first
336 part of this function can not depend on any memory services until at least one
337 memory descriptor is provided to the memory services. Then the memory services
338 can be used to intialize the GCD map.
339
340 Arguments:
341
342 HobStart - The start address of the HOB.
343
344 MemoryBaseAddress - Start address of memory region found to init DXE core.
345
346 MemoryLength - Length of memory region found to init DXE core.
347
348 Returns:
349
350 EFI_SUCCESS - Memory services successfully initialized.
351
352 --*/
353 ;
354
355
356 EFI_STATUS
357 CoreInitializeGcdServices (
358 IN OUT VOID **HobStart,
359 IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress,
360 IN UINT64 MemoryLength
361 )
362 /*++
363
364 Routine Description:
365
366 External function. Initializes the GCD and memory services based on the memory
367 descriptor HOBs. This function is responsible for priming the GCD map and the
368 memory map, so memory allocations and resource allocations can be made. The first
369 part of this function can not depend on any memory services until at least one
370 memory descriptor is provided to the memory services. Then the memory services
371 can be used to intialize the GCD map. The HobStart will be relocated to a pool
372 buffer.
373
374 Arguments:
375
376 HobStart - The start address of the HOB
377
378 MemoryBaseAddress - Start address of memory region found to init DXE core.
379
380 MemoryLength - Length of memory region found to init DXE core.
381
382
383 Returns:
384
385 EFI_SUCCESS - GCD services successfully initialized.
386
387 --*/
388 ;
389
390 EFI_STATUS
391 CoreInitializeEventServices (
392 VOID
393 )
394 /*++
395
396 Routine Description:
397
398 Initializes "event" support and populates parts of the System and Runtime Table.
399
400 Arguments:
401
402 None
403
404 Returns:
405
406 EFI_SUCCESS - Always return success
407
408 --*/
409 ;
410
411 EFI_STATUS
412 CoreInitializeImageServices (
413 IN VOID *HobStart
414 )
415 /*++
416
417 Routine Description:
418
419 Add the Image Services to EFI Boot Services Table and install the protocol
420 interfaces for this image.
421
422 Arguments:
423
424 HobStart - The HOB to initialize
425
426 Returns:
427
428 Status code.
429
430 --*/
431 ;
432
433 VOID
434 CoreNotifyOnArchProtocolInstallation (
435 VOID
436 )
437 /*++
438
439 Routine Description:
440 Creates an event that is fired everytime a Protocol of a specific type is installed
441
442 Arguments:
443 NONE
444
445 Returns:
446 NONE
447
448 --*/
449 ;
450
451 EFI_STATUS
452 CoreAllEfiServicesAvailable (
453 VOID
454 )
455 /*++
456
457 Routine Description:
458 Return TRUE if all AP services are availible.
459
460 Arguments:
461 NONE
462
463 Returns:
464 EFI_SUCCESS - All AP services are available
465 EFI_NOT_FOUND - At least one AP service is not available
466
467 --*/
468 ;
469
470 VOID
471 CalculateEfiHdrCrc (
472 IN OUT EFI_TABLE_HEADER *Hdr
473 )
474 /*++
475
476 Routine Description:
477
478 Calcualte the 32-bit CRC in a EFI table using the service provided by the
479 gRuntime service.
480
481 Arguments:
482
483 Hdr - Pointer to an EFI standard header
484
485 Returns:
486
487 None
488
489 --*/
490 ;
491
492 VOID
493 EFIAPI
494 CoreTimerTick (
495 IN UINT64 Duration
496 )
497 /*++
498
499 Routine Description:
500
501 Called by the platform code to process a tick.
502
503 Arguments:
504
505 Duration - The number of 100ns elasped since the last call to TimerTick
506
507 Returns:
508
509 None
510
511 --*/
512 ;
513
514 VOID
515 CoreInitializeDispatcher (
516 VOID
517 )
518 /*++
519
520 Routine Description:
521
522 Initialize the dispatcher. Initialize the notification function that runs when
523 a FV protocol is added to the system.
524
525 Arguments:
526
527 NONE
528
529 Returns:
530
531 NONE
532
533 --*/
534 ;
535
536 BOOLEAN
537 CoreIsSchedulable (
538 IN EFI_CORE_DRIVER_ENTRY *DriverEntry
539 )
540 /*++
541
542 Routine Description:
543
544 This is the POSTFIX version of the dependency evaluator. This code does
545 not need to handle Before or After, as it is not valid to call this
546 routine in this case. The SOR is just ignored and is a nop in the grammer.
547
548 POSTFIX means all the math is done on top of the stack.
549
550 Arguments:
551
552 DriverEntry - DriverEntry element to update
553
554 Returns:
555
556 TRUE - If driver is ready to run.
557
558 FALSE - If driver is not ready to run or some fatal error was found.
559
560 --*/
561 ;
562
563 EFI_STATUS
564 CorePreProcessDepex (
565 IN EFI_CORE_DRIVER_ENTRY *DriverEntry
566 )
567 /*++
568
569 Routine Description:
570
571 Preprocess dependency expression and update DriverEntry to reflect the
572 state of Before, After, and SOR dependencies. If DriverEntry->Before
573 or DriverEntry->After is set it will never be cleared. If SOR is set
574 it will be cleared by CoreSchedule(), and then the driver can be
575 dispatched.
576
577 Arguments:
578
579 DriverEntry - DriverEntry element to update
580
581 Returns:
582
583 EFI_SUCCESS - It always works.
584
585 --*/
586 ;
587
588
589 EFI_STATUS
590 EFIAPI
591 CoreExitBootServices (
592 IN EFI_HANDLE ImageHandle,
593 IN UINTN MapKey
594 )
595 /*++
596
597 Routine Description:
598
599 UEFI 2.0 API to terminate Boot Services
600
601 Arguments:
602
603 ImageHandle - Handle that represents the identity of the calling image
604
605 MapKey -Key to the latest memory map.
606
607 Returns:
608
609 EFI_SUCCESS - Boot Services terminated
610 EFI_INVALID_PARAMETER - MapKey is incorrect.
611
612 --*/
613 ;
614
615 EFI_STATUS
616 CoreTerminateMemoryMap (
617 IN UINTN MapKey
618 )
619 /*++
620
621 Routine Description:
622
623 Make sure the memory map is following all the construction rules,
624 it is the last time to check memory map error before exit boot services.
625
626 Arguments:
627
628 MapKey - Memory map key
629
630 Returns:
631
632 EFI_INVALID_PARAMETER - Memory map not consistent with construction rules.
633
634 EFI_SUCCESS - Valid memory map.
635
636 --*/
637 ;
638
639 VOID
640 CoreNotifySignalList (
641 IN EFI_GUID *EventGroup
642 )
643 /*++
644
645 Routine Description:
646
647 Signals all events on the requested list
648
649 Arguments:
650
651 SignalType - The list to signal
652
653 Returns:
654
655 None
656
657 --*/
658 ;
659
660
661 EFI_STATUS
662 EFIAPI
663 CoreInstallConfigurationTable (
664 IN EFI_GUID *Guid,
665 IN VOID *Table
666 )
667 /*++
668
669 Routine Description:
670
671 Boot Service called to add, modify, or remove a system configuration table from
672 the EFI System Table.
673
674 Arguments:
675
676 Guid: Pointer to the GUID for the entry to add, update, or remove
677 Table: Pointer to the configuration table for the entry to add, update, or
678 remove, may be NULL.
679
680 Returns:
681
682 EFI_SUCCESS Guid, Table pair added, updated, or removed.
683 EFI_INVALID_PARAMETER Input GUID not valid.
684 EFI_NOT_FOUND Attempted to delete non-existant entry
685 EFI_OUT_OF_RESOURCES Not enough memory available
686
687 --*/
688 ;
689
690
691 EFI_TPL
692 EFIAPI
693 CoreRaiseTpl (
694 IN EFI_TPL NewTpl
695 )
696 /*++
697
698 Routine Description:
699
700 Raise the task priority level to the new level.
701 High level is implemented by disabling processor interrupts.
702
703 Arguments:
704
705 NewTpl - New task priority level
706
707 Returns:
708
709 The previous task priority level
710
711 --*/
712 ;
713
714
715 VOID
716 EFIAPI
717 CoreRestoreTpl (
718 IN EFI_TPL NewTpl
719 )
720 /*++
721
722 Routine Description:
723
724 Lowers the task priority to the previous value. If the new
725 priority unmasks events at a higher priority, they are dispatched.
726
727 Arguments:
728
729 NewTpl - New, lower, task priority
730
731 Returns:
732
733 None
734
735 --*/
736 ;
737
738
739 EFI_STATUS
740 EFIAPI
741 CoreStall (
742 IN UINTN Microseconds
743 )
744 /*++
745
746 Routine Description:
747
748 Introduces a fine-grained stall.
749
750 Arguments:
751
752 Microseconds The number of microseconds to stall execution
753
754 Returns:
755
756 EFI_SUCCESS - Execution was stalled for at least the requested amount
757 of microseconds.
758
759 EFI_NOT_AVAILABLE_YET - gMetronome is not available yet
760
761 --*/
762 ;
763
764
765 EFI_STATUS
766 EFIAPI
767 CoreSetWatchdogTimer (
768 IN UINTN Timeout,
769 IN UINT64 WatchdogCode,
770 IN UINTN DataSize,
771 IN CHAR16 *WatchdogData OPTIONAL
772 )
773 /*++
774
775 Routine Description:
776
777 Sets the system's watchdog timer.
778
779 Arguments:
780
781 Timeout The number of seconds. Zero disables the timer.
782
783 ///////following three parameters are left for platform specific using
784
785 WatchdogCode The numberic code to log. 0x0 to 0xffff are firmware
786 DataSize Size of the optional data
787 WatchdogData Optional Null terminated unicode string followed by binary
788 data.
789
790 Returns:
791
792 EFI_SUCCESS Timeout has been set
793 EFI_NOT_AVAILABLE_YET WatchdogTimer is not available yet
794 EFI_UNSUPPORTED System does not have a timer (currently not used)
795 EFI_DEVICE_ERROR Could not complete due to hardware error
796
797 --*/
798 ;
799
800
801 EFI_STATUS
802 EFIAPI
803 CoreInstallProtocolInterface (
804 IN OUT EFI_HANDLE *UserHandle,
805 IN EFI_GUID *Protocol,
806 IN EFI_INTERFACE_TYPE InterfaceType,
807 IN VOID *Interface
808 )
809 /*++
810
811 Routine Description:
812
813 Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which
814 Calls the private one which contains a BOOLEAN parameter for notifications
815
816 Arguments:
817
818 UserHandle - The handle to install the protocol handler on,
819 or NULL if a new handle is to be allocated
820
821 Protocol - The protocol to add to the handle
822
823 InterfaceType - Indicates whether Interface is supplied in native form.
824
825 Interface - The interface for the protocol being added
826
827 Returns:
828
829 Status code
830
831 --*/
832 ;
833
834 EFI_STATUS
835 CoreInstallProtocolInterfaceNotify (
836 IN OUT EFI_HANDLE *UserHandle,
837 IN EFI_GUID *Protocol,
838 IN EFI_INTERFACE_TYPE InterfaceType,
839 IN VOID *Interface,
840 IN BOOLEAN Notify
841 )
842 /*++
843
844 Routine Description:
845
846 Installs a protocol interface into the boot services environment.
847
848 Arguments:
849
850 UserHandle - The handle to install the protocol handler on,
851 or NULL if a new handle is to be allocated
852
853 Protocol - The protocol to add to the handle
854
855 InterfaceType - Indicates whether Interface is supplied in native form.
856
857 Interface - The interface for the protocol being added
858
859 Notify - Whether to notify the notification list for this protocol
860
861 Returns:
862
863 EFI_INVALID_PARAMETER - Invalid parameter
864
865 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
866
867 EFI_SUCCESS - Protocol interface successfully installed
868
869 --*/
870 ;
871
872
873 EFI_STATUS
874 EFIAPI
875 CoreInstallMultipleProtocolInterfaces (
876 IN OUT EFI_HANDLE *Handle,
877 ...
878 )
879 /*++
880
881 Routine Description:
882
883 Installs a list of protocol interface into the boot services environment.
884 This function calls InstallProtocolInterface() in a loop. If any error
885 occures all the protocols added by this function are removed. This is
886 basically a lib function to save space.
887
888 Arguments:
889
890 Handle - The handle to install the protocol handlers on,
891 or NULL if a new handle is to be allocated
892 ... - EFI_GUID followed by protocol instance. A NULL terminates the
893 list. The pairs are the arguments to InstallProtocolInterface().
894 All the protocols are added to Handle.
895
896 Returns:
897
898 EFI_INVALID_PARAMETER - Handle is NULL.
899
900 EFI_SUCCESS - Protocol interfaces successfully installed.
901
902 --*/
903 ;
904
905
906 EFI_STATUS
907 EFIAPI
908 CoreUninstallMultipleProtocolInterfaces (
909 IN EFI_HANDLE Handle,
910 ...
911 )
912 /*++
913
914 Routine Description:
915
916 Uninstalls a list of protocol interface in the boot services environment.
917 This function calls UnisatllProtocolInterface() in a loop. This is
918 basically a lib function to save space.
919
920 Arguments:
921
922 Handle - The handle to uninstall the protocol
923
924 ... - EFI_GUID followed by protocol instance. A NULL terminates the
925 list. The pairs are the arguments to UninstallProtocolInterface().
926 All the protocols are added to Handle.
927
928 Returns:
929
930 Status code
931
932 --*/
933 ;
934
935
936 EFI_STATUS
937 EFIAPI
938 CoreReinstallProtocolInterface (
939 IN EFI_HANDLE UserHandle,
940 IN EFI_GUID *Protocol,
941 IN VOID *OldInterface,
942 IN VOID *NewInterface
943 )
944 /*++
945
946 Routine Description:
947
948 Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.
949
950 Arguments:
951
952 UserHandle - Handle on which the interface is to be reinstalled
953 Protocol - The numeric ID of the interface
954 OldInterface - A pointer to the old interface
955 NewInterface - A pointer to the new interface
956
957
958 Returns:
959
960 Status code.
961
962 On EFI_SUCCESS The protocol interface was installed
963 On EFI_NOT_FOUND The OldInterface on the handle was not found
964 On EFI_INVALID_PARAMETER One of the parameters has an invalid value
965
966 --*/
967 ;
968
969
970 EFI_STATUS
971 EFIAPI
972 CoreUninstallProtocolInterface (
973 IN EFI_HANDLE UserHandle,
974 IN EFI_GUID *Protocol,
975 IN VOID *Interface
976 )
977 /*++
978
979 Routine Description:
980
981 Uninstalls all instances of a protocol:interfacer from a handle.
982 If the last protocol interface is remove from the handle, the
983 handle is freed.
984
985 Arguments:
986
987 UserHandle - The handle to remove the protocol handler from
988
989 Protocol - The protocol, of protocol:interface, to remove
990
991 Interface - The interface, of protocol:interface, to remove
992
993 Returns:
994
995 EFI_INVALID_PARAMETER - Protocol is NULL.
996
997 EFI_SUCCESS - Protocol interface successfully uninstalled.
998
999 --*/
1000 ;
1001
1002
1003 EFI_STATUS
1004 EFIAPI
1005 CoreHandleProtocol (
1006 IN EFI_HANDLE UserHandle,
1007 IN EFI_GUID *Protocol,
1008 OUT VOID **Interface
1009 )
1010 /*++
1011
1012 Routine Description:
1013
1014 Queries a handle to determine if it supports a specified protocol.
1015
1016 Arguments:
1017
1018 UserHandle - The handle being queried.
1019
1020 Protocol - The published unique identifier of the protocol.
1021
1022 Interface - Supplies the address where a pointer to the corresponding Protocol
1023 Interface is returned.
1024
1025 Returns:
1026
1027 The requested protocol interface for the handle
1028
1029 --*/
1030 ;
1031
1032
1033 EFI_STATUS
1034 EFIAPI
1035 CoreOpenProtocol (
1036 IN EFI_HANDLE UserHandle,
1037 IN EFI_GUID *Protocol,
1038 OUT VOID **Interface OPTIONAL,
1039 IN EFI_HANDLE ImageHandle,
1040 IN EFI_HANDLE ControllerHandle,
1041 IN UINT32 Attributes
1042 )
1043 /*++
1044
1045 Routine Description:
1046
1047 Locates the installed protocol handler for the handle, and
1048 invokes it to obtain the protocol interface. Usage information
1049 is registered in the protocol data base.
1050
1051 Arguments:
1052
1053 UserHandle - The handle to obtain the protocol interface on
1054
1055 Protocol - The ID of the protocol
1056
1057 Interface - The location to return the protocol interface
1058
1059 ImageHandle - The handle of the Image that is opening the protocol interface
1060 specified by Protocol and Interface.
1061
1062 ControllerHandle - The controller handle that is requiring this interface.
1063
1064 Attributes - The open mode of the protocol interface specified by Handle
1065 and Protocol.
1066
1067 Returns:
1068
1069 EFI_INVALID_PARAMETER - Protocol is NULL.
1070
1071 EFI_SUCCESS - Get the protocol interface.
1072
1073 --*/
1074 ;
1075
1076
1077 EFI_STATUS
1078 EFIAPI
1079 CoreOpenProtocolInformation (
1080 IN EFI_HANDLE UserHandle,
1081 IN EFI_GUID *Protocol,
1082 OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
1083 OUT UINTN *EntryCount
1084 )
1085 /*++
1086
1087 Routine Description:
1088
1089 Return information about Opened protocols in the system
1090
1091 Arguments:
1092
1093 UserHandle - The handle to close the protocol interface on
1094
1095 Protocol - The ID of the protocol
1096
1097 EntryBuffer - A pointer to a buffer of open protocol information in the form of
1098 EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
1099
1100 EntryCount - Number of EntryBuffer entries
1101
1102 Returns:
1103
1104
1105 --*/
1106 ;
1107
1108
1109 EFI_STATUS
1110 EFIAPI
1111 CoreCloseProtocol (
1112 IN EFI_HANDLE UserHandle,
1113 IN EFI_GUID *Protocol,
1114 IN EFI_HANDLE ImageHandle,
1115 IN EFI_HANDLE ControllerHandle
1116 )
1117 /*++
1118
1119 Routine Description:
1120
1121 Close Protocol
1122
1123 Arguments:
1124
1125 UserHandle - The handle to close the protocol interface on
1126
1127 Protocol - The ID of the protocol
1128
1129 ImageHandle - The user of the protocol to close
1130
1131 ControllerHandle - The user of the protocol to close
1132
1133 Returns:
1134
1135 EFI_INVALID_PARAMETER - Protocol is NULL.
1136
1137 --*/
1138 ;
1139
1140
1141 EFI_STATUS
1142 EFIAPI
1143 CoreProtocolsPerHandle (
1144 IN EFI_HANDLE UserHandle,
1145 OUT EFI_GUID ***ProtocolBuffer,
1146 OUT UINTN *ProtocolBufferCount
1147 )
1148 /*++
1149
1150 Routine Description:
1151
1152 Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated
1153 from pool.
1154
1155 Arguments:
1156
1157 UserHandle - The handle from which to retrieve the list of protocol interface
1158 GUIDs.
1159
1160 ProtocolBuffer - A pointer to the list of protocol interface GUID pointers that are
1161 installed on Handle.
1162
1163 ProtocolBufferCount - A pointer to the number of GUID pointers present in
1164 ProtocolBuffer.
1165
1166 Returns:
1167 EFI_SUCCESS - The list of protocol interface GUIDs installed on Handle was returned in
1168 ProtocolBuffer. The number of protocol interface GUIDs was
1169 returned in ProtocolBufferCount.
1170 EFI_INVALID_PARAMETER - Handle is NULL.
1171 EFI_INVALID_PARAMETER - Handle is not a valid EFI_HANDLE.
1172 EFI_INVALID_PARAMETER - ProtocolBuffer is NULL.
1173 EFI_INVALID_PARAMETER - ProtocolBufferCount is NULL.
1174 EFI_OUT_OF_RESOURCES - There is not enough pool memory to store the results.
1175
1176 --*/
1177 ;
1178
1179
1180 EFI_STATUS
1181 EFIAPI
1182 CoreRegisterProtocolNotify (
1183 IN EFI_GUID *Protocol,
1184 IN EFI_EVENT Event,
1185 OUT VOID **Registration
1186 )
1187 /*++
1188
1189 Routine Description:
1190
1191 Add a new protocol notification record for the request protocol.
1192
1193 Arguments:
1194
1195 Protocol - The requested protocol to add the notify registration
1196
1197 Event - The event to signal
1198
1199 Registration - Returns the registration record
1200
1201
1202 Returns:
1203
1204 EFI_INVALID_PARAMETER - Invalid parameter
1205
1206 EFI_SUCCESS - Successfully returned the registration record that has been added
1207
1208 --*/
1209 ;
1210
1211
1212 EFI_STATUS
1213 EFIAPI
1214 CoreLocateHandle (
1215 IN EFI_LOCATE_SEARCH_TYPE SearchType,
1216 IN EFI_GUID *Protocol OPTIONAL,
1217 IN VOID *SearchKey OPTIONAL,
1218 IN OUT UINTN *BufferSize,
1219 OUT EFI_HANDLE *Buffer
1220 )
1221 /*++
1222
1223 Routine Description:
1224
1225 Locates the requested handle(s) and returns them in Buffer.
1226
1227 Arguments:
1228
1229 SearchType - The type of search to perform to locate the handles
1230
1231 Protocol - The protocol to search for
1232
1233 SearchKey - Dependant on SearchType
1234
1235 BufferSize - On input the size of Buffer. On output the
1236 size of data returned.
1237
1238 Buffer - The buffer to return the results in
1239
1240
1241 Returns:
1242
1243 EFI_BUFFER_TOO_SMALL - Buffer too small, required buffer size is returned in BufferSize.
1244
1245 EFI_INVALID_PARAMETER - Invalid parameter
1246
1247 EFI_SUCCESS - Successfully found the requested handle(s) and returns them in Buffer.
1248
1249 --*/
1250 ;
1251
1252
1253 EFI_STATUS
1254 EFIAPI
1255 CoreLocateDevicePath (
1256 IN EFI_GUID *Protocol,
1257 IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,
1258 OUT EFI_HANDLE *Device
1259 )
1260 /*++
1261
1262 Routine Description:
1263
1264 Locates the handle to a device on the device path that supports the specified protocol.
1265
1266 Arguments:
1267
1268 Protocol - The protocol to search for.
1269 FilePath - On input, a pointer to a pointer to the device path. On output, the device
1270 path pointer is modified to point to the remaining part of the devicepath.
1271 Device - A pointer to the returned device handle.
1272
1273 Returns:
1274
1275 EFI_SUCCESS - The resulting handle was returned.
1276 EFI_NOT_FOUND - No handles matched the search.
1277 EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
1278
1279 --*/
1280 ;
1281
1282
1283 EFI_STATUS
1284 EFIAPI
1285 CoreLocateHandleBuffer (
1286 IN EFI_LOCATE_SEARCH_TYPE SearchType,
1287 IN EFI_GUID *Protocol OPTIONAL,
1288 IN VOID *SearchKey OPTIONAL,
1289 IN OUT UINTN *NumberHandles,
1290 OUT EFI_HANDLE **Buffer
1291 )
1292 /*++
1293
1294 Routine Description:
1295
1296 Function returns an array of handles that support the requested protocol
1297 in a buffer allocated from pool. This is a version of CoreLocateHandle()
1298 that allocates a buffer for the caller.
1299
1300 Arguments:
1301
1302 SearchType - Specifies which handle(s) are to be returned.
1303 Protocol - Provides the protocol to search by.
1304 This parameter is only valid for SearchType ByProtocol.
1305 SearchKey - Supplies the search key depending on the SearchType.
1306 NumberHandles - The number of handles returned in Buffer.
1307 Buffer - A pointer to the buffer to return the requested array of
1308 handles that support Protocol.
1309
1310 Returns:
1311
1312 EFI_SUCCESS - The result array of handles was returned.
1313 EFI_NOT_FOUND - No handles match the search.
1314 EFI_OUT_OF_RESOURCES - There is not enough pool memory to store the matching results.
1315 EFI_INVALID_PARAMETER - Invalid parameter
1316
1317 --*/
1318 ;
1319
1320
1321 EFI_STATUS
1322 EFIAPI
1323 CoreLocateProtocol (
1324 IN EFI_GUID *Protocol,
1325 IN VOID *Registration OPTIONAL,
1326 OUT VOID **Interface
1327 )
1328 /*++
1329
1330 Routine Description:
1331
1332 Return the first Protocol Interface that matches the Protocol GUID. If
1333 Registration is pasased in return a Protocol Instance that was just add
1334 to the system. If Retistration is NULL return the first Protocol Interface
1335 you find.
1336
1337 Arguments:
1338
1339 Protocol - The protocol to search for
1340
1341 Registration - Optional Registration Key returned from RegisterProtocolNotify()
1342
1343 Interface - Return the Protocol interface (instance).
1344
1345 Returns:
1346
1347 EFI_SUCCESS - If a valid Interface is returned
1348
1349 EFI_INVALID_PARAMETER - Invalid parameter
1350
1351 EFI_NOT_FOUND - Protocol interface not found
1352
1353 --*/
1354 ;
1355
1356 UINT64
1357 CoreGetHandleDatabaseKey (
1358 VOID
1359 )
1360 /*++
1361
1362 Routine Description:
1363
1364 return handle database key.
1365
1366 Arguments:
1367
1368 None
1369
1370 Returns:
1371
1372 Handle database key.
1373
1374 --*/
1375 ;
1376
1377 VOID
1378 CoreConnectHandlesByKey (
1379 UINT64 Key
1380 )
1381 /*++
1382
1383 Routine Description:
1384
1385 Go connect any handles that were created or modified while a image executed.
1386
1387 Arguments:
1388
1389 Key - The Key to show that the handle has been created/modified
1390
1391 Returns:
1392
1393 None
1394 --*/
1395 ;
1396
1397
1398 EFI_STATUS
1399 EFIAPI
1400 CoreConnectController (
1401 IN EFI_HANDLE ControllerHandle,
1402 IN EFI_HANDLE *DriverImageHandle OPTIONAL,
1403 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,
1404 IN BOOLEAN Recursive
1405 )
1406 /*++
1407
1408 Routine Description:
1409
1410 Connects one or more drivers to a controller.
1411
1412 Arguments:
1413
1414 ControllerHandle - Handle of the controller to be connected.
1415
1416 DriverImageHandle - DriverImageHandle A pointer to an ordered list of driver image handles.
1417
1418 RemainingDevicePath - RemainingDevicePath A pointer to the device path that specifies a child of the
1419 controller specified by ControllerHandle.
1420
1421 Recursive - - Whether the function would be called recursively or not.
1422
1423 Returns:
1424
1425 Status code.
1426
1427 --*/
1428 ;
1429
1430
1431 EFI_STATUS
1432 EFIAPI
1433 CoreDisconnectController (
1434 IN EFI_HANDLE ControllerHandle,
1435 IN EFI_HANDLE DriverImageHandle OPTIONAL,
1436 IN EFI_HANDLE ChildHandle OPTIONAL
1437 )
1438 /*++
1439
1440 Routine Description:
1441
1442 Disonnects a controller from a driver
1443
1444 Arguments:
1445
1446 ControllerHandle - ControllerHandle The handle of the controller from which driver(s)
1447 are to be disconnected.
1448 DriverImageHandle - DriverImageHandle The driver to disconnect from ControllerHandle.
1449 ChildHandle - ChildHandle The handle of the child to destroy.
1450
1451 Returns:
1452
1453 EFI_SUCCESS - One or more drivers were disconnected from the controller.
1454 EFI_SUCCESS - On entry, no drivers are managing ControllerHandle.
1455 EFI_SUCCESS - DriverImageHandle is not NULL, and on entry DriverImageHandle is not managing ControllerHandle.
1456 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
1457 EFI_INVALID_PARAMETER - DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.
1458 EFI_INVALID_PARAMETER - ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
1459 EFI_OUT_OF_RESOURCES - There are not enough resources available to disconnect any drivers from ControllerHandle.
1460 EFI_DEVICE_ERROR - The controller could not be disconnected because of a device error.
1461
1462 --*/
1463 ;
1464
1465
1466 EFI_STATUS
1467 EFIAPI
1468 CoreAllocatePages (
1469 IN EFI_ALLOCATE_TYPE Type,
1470 IN EFI_MEMORY_TYPE MemoryType,
1471 IN UINTN NumberOfPages,
1472 IN OUT EFI_PHYSICAL_ADDRESS *Memory
1473 )
1474 /*++
1475
1476 Routine Description:
1477
1478 Allocates pages from the memory map.
1479
1480 Arguments:
1481
1482 Type - The type of allocation to perform
1483
1484 MemoryType - The type of memory to turn the allocated pages into
1485
1486 NumberOfPages - The number of pages to allocate
1487
1488 Memory - A pointer to receive the base allocated memory address
1489
1490 Returns:
1491
1492 Status. On success, Memory is filled in with the base address allocated
1493
1494 EFI_INVALID_PARAMETER - Parameters violate checking rules defined in spec.
1495
1496 EFI_NOT_FOUND - Could not allocate pages match the requirement.
1497
1498 EFI_OUT_OF_RESOURCES - No enough pages to allocate.
1499
1500 EFI_SUCCESS - Pages successfully allocated.
1501
1502 --*/
1503 ;
1504
1505
1506 EFI_STATUS
1507 EFIAPI
1508 CoreFreePages (
1509 IN EFI_PHYSICAL_ADDRESS Memory,
1510 IN UINTN NumberOfPages
1511 )
1512 /*++
1513
1514 Routine Description:
1515
1516 Frees previous allocated pages.
1517
1518 Arguments:
1519
1520 Memory - Base address of memory being freed
1521
1522 NumberOfPages - The number of pages to free
1523
1524 Returns:
1525
1526 EFI_NOT_FOUND - Could not find the entry that covers the range
1527
1528 EFI_INVALID_PARAMETER - Address not aligned
1529
1530 EFI_SUCCESS -Pages successfully freed.
1531
1532 --*/
1533 ;
1534
1535
1536 EFI_STATUS
1537 EFIAPI
1538 CoreGetMemoryMap (
1539 IN OUT UINTN *MemoryMapSize,
1540 IN OUT EFI_MEMORY_DESCRIPTOR *Desc,
1541 OUT UINTN *MapKey,
1542 OUT UINTN *DescriptorSize,
1543 OUT UINT32 *DescriptorVersion
1544 )
1545 /*++
1546
1547 Routine Description:
1548
1549 Returns the current memory map.
1550
1551 Arguments:
1552
1553 MemoryMapSize - On input the buffer size of MemoryMap allocated by caller
1554 On output the required buffer size to contain the memory map
1555
1556 Desc - The buffer to return the current memory map
1557
1558 MapKey - The address to return the current map key
1559
1560 DescriptorSize - The size in bytes for an individual EFI_MEMORY_DESCRIPTOR
1561
1562 DescriptorVersion - The version number associated with the EFI_MEMORY_DESCRIPTOR
1563
1564 Returns:
1565
1566 EFI_SUCCESS The current memory map was returned successfully
1567
1568 EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small
1569
1570 EFI_INVALID_PARAMETER One of the parameters has an invalid value
1571
1572 --*/
1573 ;
1574
1575
1576 EFI_STATUS
1577 EFIAPI
1578 CoreAllocatePool (
1579 IN EFI_MEMORY_TYPE PoolType,
1580 IN UINTN Size,
1581 OUT VOID **Buffer
1582 )
1583 /*++
1584
1585 Routine Description:
1586
1587 Allocate pool of a particular type.
1588
1589 Arguments:
1590
1591 PoolType - Type of pool to allocate
1592
1593 Size - The amount of pool to allocate
1594
1595 Buffer - The address to return a pointer to the allocated pool
1596
1597 Returns:
1598
1599 EFI_INVALID_PARAMETER - PoolType not valid
1600
1601 EFI_OUT_OF_RESOURCES - Size exceeds max pool size or allocation failed.
1602
1603 EFI_SUCCESS - Pool successfully allocated.
1604
1605 --*/
1606 ;
1607
1608
1609 EFI_STATUS
1610 EFIAPI
1611 CoreFreePool (
1612 IN VOID *Buffer
1613 )
1614 /*++
1615
1616 Routine Description:
1617
1618 Frees pool.
1619
1620 Arguments:
1621
1622 Buffer - The allocated pool entry to free
1623
1624 Returns:
1625
1626 EFI_INVALID_PARAMETER - Buffer is not a valid value.
1627
1628 EFI_SUCCESS - Pool successfully freed.
1629
1630 --*/
1631 ;
1632
1633
1634 EFI_STATUS
1635 EFIAPI
1636 CoreLoadImage (
1637 IN BOOLEAN BootPolicy,
1638 IN EFI_HANDLE ParentImageHandle,
1639 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
1640 IN VOID *SourceBuffer OPTIONAL,
1641 IN UINTN SourceSize,
1642 OUT EFI_HANDLE *ImageHandle
1643 )
1644 /*++
1645
1646 Routine Description:
1647
1648 Loads an EFI image into memory and returns a handle to the image.
1649
1650 Arguments:
1651
1652 BootPolicy - If TRUE, indicates that the request originates from the boot manager,
1653 and that the boot manager is attempting to load FilePath as a boot selection.
1654 ParentImageHandle - The caller's image handle.
1655 FilePath - The specific file path from which the image is loaded.
1656 SourceBuffer - If not NULL, a pointer to the memory location containing a copy of
1657 the image to be loaded.
1658 SourceSize - The size in bytes of SourceBuffer.
1659 ImageHandle - Pointer to the returned image handle that is created when the image
1660 is successfully loaded.
1661
1662 Returns:
1663
1664 EFI_SUCCESS - The image was loaded into memory.
1665 EFI_NOT_FOUND - The FilePath was not found.
1666 EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
1667 EFI_UNSUPPORTED - The image type is not supported, or the device path cannot be
1668 parsed to locate the proper protocol for loading the file.
1669 EFI_OUT_OF_RESOURCES - Image was not loaded due to insufficient resources.
1670 --*/
1671 ;
1672
1673
1674 EFI_STATUS
1675 EFIAPI
1676 CoreUnloadImage (
1677 IN EFI_HANDLE ImageHandle
1678 )
1679 /*++
1680
1681 Routine Description:
1682
1683 Unload the specified image.
1684
1685 Arguments:
1686
1687 ImageHandle - The specified image handle.
1688
1689 Returns:
1690
1691 EFI_INVALID_PARAMETER - Image handle is NULL.
1692
1693 EFI_UNSUPPORTED - Attempt to unload an unsupported image.
1694
1695 EFI_SUCCESS - Image successfully unloaded.
1696
1697 --*/
1698 ;
1699
1700
1701 EFI_STATUS
1702 EFIAPI
1703 CoreStartImage (
1704 IN EFI_HANDLE ImageHandle,
1705 OUT UINTN *ExitDataSize,
1706 OUT CHAR16 **ExitData OPTIONAL
1707 )
1708 /*++
1709
1710 Routine Description:
1711
1712 Transfer control to a loaded image's entry point.
1713
1714 Arguments:
1715
1716 ImageHandle - Handle of image to be started.
1717
1718 ExitDataSize - Pointer of the size to ExitData
1719
1720 ExitData - Pointer to a pointer to a data buffer that includes a Null-terminated
1721 Unicode string, optionally followed by additional binary data. The string
1722 is a description that the caller may use to further indicate the reason for
1723 the image's exit.
1724
1725 Returns:
1726
1727 EFI_INVALID_PARAMETER - Invalid parameter
1728
1729 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
1730
1731 EFI_SUCCESS - Successfully transfer control to the image's entry point.
1732
1733 --*/
1734 ;
1735
1736
1737 EFI_STATUS
1738 EFIAPI
1739 CoreExit (
1740 IN EFI_HANDLE ImageHandle,
1741 IN EFI_STATUS Status,
1742 IN UINTN ExitDataSize,
1743 IN CHAR16 *ExitData OPTIONAL
1744 )
1745 /*++
1746
1747 Routine Description:
1748
1749 Terminates the currently loaded EFI image and returns control to boot services.
1750
1751 Arguments:
1752
1753 ImageHandle - Handle that identifies the image. This parameter is passed to the image
1754 on entry.
1755 Status - The image's exit code.
1756 ExitDataSize - The size, in bytes, of ExitData. Ignored if ExitStatus is
1757 EFI_SUCCESS.
1758 ExitData - Pointer to a data buffer that includes a Null-terminated Unicode string,
1759 optionally followed by additional binary data. The string is a
1760 description that the caller may use to further indicate the reason for
1761 the image's exit.
1762
1763 Returns:
1764
1765 EFI_INVALID_PARAMETER - Image handle is NULL or it is not current image.
1766
1767 EFI_SUCCESS - Successfully terminates the currently loaded EFI image.
1768
1769 EFI_ACCESS_DENIED - Should never reach there.
1770
1771 --*/
1772 ;
1773
1774
1775 EFI_STATUS
1776 EFIAPI
1777 CoreCreateEvent (
1778 IN UINT32 Type,
1779 IN EFI_TPL NotifyTpl,
1780 IN EFI_EVENT_NOTIFY NotifyFunction,
1781 IN VOID *NotifyContext,
1782 OUT EFI_EVENT *pEvent
1783 )
1784 /*++
1785
1786 Routine Description:
1787
1788 Creates a general-purpose event structure
1789
1790 Arguments:
1791
1792 Type - The type of event to create and its mode and attributes
1793 NotifyTpl - The task priority level of event notifications
1794 NotifyFunction - Pointer to the event's notification function
1795 NotifyContext - Pointer to the notification function's context; corresponds to
1796 parameter "Context" in the notification function
1797 pEvent - Pointer to the newly created event if the call succeeds; undefined otherwise
1798
1799 Returns:
1800
1801 EFI_SUCCESS - The event structure was created
1802 EFI_INVALID_PARAMETER - One of the parameters has an invalid value
1803 EFI_OUT_OF_RESOURCES - The event could not be allocated
1804
1805 --*/
1806 ;
1807
1808
1809 EFI_STATUS
1810 EFIAPI
1811 CoreCreateEventEx (
1812 IN UINT32 Type,
1813 IN EFI_TPL NotifyTpl,
1814 IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
1815 IN CONST VOID *NotifyContext, OPTIONAL
1816 IN CONST EFI_GUID *EventGroup, OPTIONAL
1817 OUT EFI_EVENT *Event
1818 )
1819 /*++
1820
1821 Routine Description:
1822 Creates a general-purpose event structure
1823
1824 Arguments:
1825 Type - The type of event to create and its mode and attributes
1826 NotifyTpl - The task priority level of event notifications
1827 NotifyFunction - Pointer to the events notification function
1828 NotifyContext - Pointer to the notification functions context; corresponds to
1829 parameter "Context" in the notification function
1830 EventGrout - GUID for EventGroup if NULL act the same as gBS->CreateEvent().
1831 Event - Pointer to the newly created event if the call succeeds; undefined otherwise
1832
1833 Returns:
1834 EFI_SUCCESS - The event structure was created
1835 EFI_INVALID_PARAMETER - One of the parameters has an invalid value
1836 EFI_OUT_OF_RESOURCES - The event could not be allocated
1837
1838 --*/
1839 ;
1840
1841
1842 EFI_STATUS
1843 EFIAPI
1844 CoreSetTimer (
1845 IN EFI_EVENT Event,
1846 IN EFI_TIMER_DELAY Type,
1847 IN UINT64 TriggerTime
1848 )
1849 /*++
1850
1851 Routine Description:
1852
1853 Sets the type of timer and the trigger time for a timer event.
1854
1855 Arguments:
1856
1857 UserEvent - The timer event that is to be signaled at the specified time
1858 Type - The type of time that is specified in TriggerTime
1859 TriggerTime - The number of 100ns units until the timer expires
1860
1861 Returns:
1862
1863 EFI_SUCCESS - The event has been set to be signaled at the requested time
1864 EFI_INVALID_PARAMETER - Event or Type is not valid
1865
1866 --*/
1867 ;
1868
1869
1870 EFI_STATUS
1871 EFIAPI
1872 CoreSignalEvent (
1873 IN EFI_EVENT Event
1874 )
1875 /*++
1876
1877 Routine Description:
1878
1879 Signals the event. Queues the event to be notified if needed
1880
1881 Arguments:
1882
1883 Event - The event to signal
1884
1885 Returns:
1886
1887 EFI_INVALID_PARAMETER - Parameters are not valid.
1888
1889 EFI_SUCCESS - The event was signaled.
1890
1891 --*/
1892 ;
1893
1894
1895 EFI_STATUS
1896 EFIAPI
1897 CoreWaitForEvent (
1898 IN UINTN NumberOfEvents,
1899 IN EFI_EVENT *UserEvents,
1900 OUT UINTN *UserIndex
1901 )
1902 /*++
1903
1904 Routine Description:
1905
1906 Stops execution until an event is signaled.
1907
1908 Arguments:
1909
1910 NumberOfEvents - The number of events in the UserEvents array
1911 UserEvents - An array of EFI_EVENT
1912 UserIndex - Pointer to the index of the event which satisfied the wait condition
1913
1914 Returns:
1915
1916 EFI_SUCCESS - The event indicated by Index was signaled.
1917 EFI_INVALID_PARAMETER - The event indicated by Index has a notification function or
1918 Event was not a valid type
1919 EFI_UNSUPPORTED - The current TPL is not TPL_APPLICATION
1920
1921 --*/
1922 ;
1923
1924
1925 EFI_STATUS
1926 EFIAPI
1927 CoreCloseEvent (
1928 IN EFI_EVENT Event
1929 )
1930 /*++
1931
1932 Routine Description:
1933
1934 Closes an event and frees the event structure.
1935
1936 Arguments:
1937
1938 UserEvent - Event to close
1939
1940 Returns:
1941
1942 EFI_INVALID_PARAMETER - Parameters are not valid.
1943
1944 EFI_SUCCESS - The event has been closed
1945
1946 --*/
1947 ;
1948
1949
1950 EFI_STATUS
1951 EFIAPI
1952 CoreCheckEvent (
1953 IN EFI_EVENT Event
1954 )
1955 /*++
1956
1957 Routine Description:
1958
1959 Check the status of an event
1960
1961 Arguments:
1962
1963 UserEvent - The event to check
1964
1965 Returns:
1966
1967 EFI_SUCCESS - The event is in the signaled state
1968 EFI_NOT_READY - The event is not in the signaled state
1969 EFI_INVALID_PARAMETER - Event is of type EVT_NOTIFY_SIGNAL
1970
1971 --*/
1972 ;
1973
1974 EFI_STATUS
1975 CoreAddMemorySpace (
1976 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
1977 IN EFI_PHYSICAL_ADDRESS BaseAddress,
1978 IN UINT64 Length,
1979 IN UINT64 Capabilities
1980 )
1981 /*++
1982
1983 Routine Description:
1984
1985 Add a segment of memory space to GCD map and add all available pages in this segment
1986 as memory descriptors.
1987
1988 Arguments:
1989
1990 GcdMemoryType - Memory type of the segment.
1991
1992 BaseAddress - Base address of the segment.
1993
1994 Length - Length of the segment.
1995
1996 Capabilities - alterable attributes of the segment.
1997
1998 Returns:
1999
2000 EFI_SUCCESS - Merged this segment into GCD map.
2001
2002 --*/
2003 ;
2004
2005 EFI_STATUS
2006 CoreAllocateMemorySpace (
2007 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
2008 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
2009 IN UINTN Alignment,
2010 IN UINT64 Length,
2011 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
2012 IN EFI_HANDLE ImageHandle,
2013 IN EFI_HANDLE DeviceHandle OPTIONAL
2014 )
2015 /*++
2016
2017 Routine Description:
2018
2019 Allocate memory space on GCD map.
2020
2021 Arguments:
2022
2023 GcdAllocateType - The type of allocate operation
2024
2025 GcdMemoryType - The desired memory type
2026
2027 Alignment - Align with 2^Alignment
2028
2029 Length - Length to allocate
2030
2031 BaseAddress - Base address to allocate
2032
2033 ImageHandle - The image handle consume the allocated space.
2034
2035 DeviceHandle - The device handle consume the allocated space.
2036
2037 Returns:
2038
2039 EFI_INVALID_PARAMETER - Invalid parameter.
2040
2041 EFI_NOT_FOUND - No descriptor contains the desired space.
2042
2043 EFI_SUCCESS - Memory space successfully allocated.
2044
2045 --*/
2046 ;
2047
2048 EFI_STATUS
2049 CoreFreeMemorySpace (
2050 IN EFI_PHYSICAL_ADDRESS BaseAddress,
2051 IN UINT64 Length
2052 )
2053 /*++
2054
2055 Routine Description:Routine Description:
2056
2057 Free a segment of memory space in GCD map.
2058
2059 Arguments:
2060
2061 BaseAddress - Base address of the segment.
2062
2063 Length - Length of the segment.
2064
2065 Returns:
2066
2067 EFI_SUCCESS - Space successfully freed.
2068
2069 --*/
2070 ;
2071
2072 EFI_STATUS
2073 CoreRemoveMemorySpace (
2074 IN EFI_PHYSICAL_ADDRESS BaseAddress,
2075 IN UINT64 Length
2076 )
2077 /*++
2078
2079 Routine Description:Routine Description:
2080
2081 Remove a segment of memory space in GCD map.
2082
2083 Arguments:
2084
2085 BaseAddress - Base address of the segment.
2086
2087 Length - Length of the segment.
2088
2089 Returns:
2090
2091 EFI_SUCCESS - Successfully a segment of memory space.
2092
2093 --*/
2094 ;
2095
2096 EFI_STATUS
2097 CoreGetMemorySpaceDescriptor (
2098 IN EFI_PHYSICAL_ADDRESS BaseAddress,
2099 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor
2100 )
2101 /*++
2102
2103 Routine Description:
2104
2105 Search all entries in GCD map which contains specified segment and build it to a descriptor.
2106
2107 Arguments:
2108
2109 BaseAddress - Specified start address
2110
2111 Descriptor - Specified length
2112
2113 Returns:
2114
2115 EFI_INVALID_PARAMETER - Invalid parameter
2116
2117 EFI_SUCCESS - Successfully get memory space descriptor.
2118
2119 --*/
2120 ;
2121
2122 EFI_STATUS
2123 CoreSetMemorySpaceAttributes (
2124 IN EFI_PHYSICAL_ADDRESS BaseAddress,
2125 IN UINT64 Length,
2126 IN UINT64 Attributes
2127 )
2128 /*++
2129
2130 Routine Description:
2131
2132 Set memory space with specified attributes.
2133
2134 Arguments:
2135
2136 BaseAddress - Specified start address
2137
2138 Length - Specified length
2139
2140 Attributes - Specified attributes
2141
2142 Returns:
2143
2144 EFI_SUCCESS - Successfully set attribute of a segment of memory space.
2145
2146 --*/
2147 ;
2148
2149 EFI_STATUS
2150 CoreGetMemorySpaceMap (
2151 OUT UINTN *NumberOfDescriptors,
2152 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap
2153 )
2154 /*++
2155
2156 Routine Description:
2157
2158 Transer all entries of GCD memory map into memory descriptors and pass to caller.
2159
2160 Arguments:
2161
2162 NumberOfDescriptors - Number of descriptors.
2163
2164 MemorySpaceMap - Descriptor array
2165
2166 Returns:
2167
2168 EFI_INVALID_PARAMETER - Invalid parameter
2169
2170 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
2171
2172 EFI_SUCCESS - Successfully get memory space map.
2173
2174 --*/
2175 ;
2176
2177 EFI_STATUS
2178 CoreAddIoSpace (
2179 IN EFI_GCD_IO_TYPE GcdIoType,
2180 IN EFI_PHYSICAL_ADDRESS BaseAddress,
2181 IN UINT64 Length
2182 )
2183 /*++
2184
2185 Routine Description:
2186
2187 Add a segment of IO space to GCD map.
2188
2189 Arguments:
2190
2191 GcdIoType - IO type of the segment.
2192
2193 BaseAddress - Base address of the segment.
2194
2195 Length - Length of the segment.
2196
2197 Returns:
2198
2199 EFI_SUCCESS - Merged this segment into GCD map.
2200
2201 --*/
2202 ;
2203
2204 EFI_STATUS
2205 CoreAllocateIoSpace (
2206 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
2207 IN EFI_GCD_IO_TYPE GcdIoType,
2208 IN UINTN Alignment,
2209 IN UINT64 Length,
2210 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
2211 IN EFI_HANDLE ImageHandle,
2212 IN EFI_HANDLE DeviceHandle OPTIONAL
2213 )
2214 /*++
2215
2216 Routine Description:
2217
2218 Allocate IO space on GCD map.
2219
2220 Arguments:
2221
2222 GcdAllocateType - The type of allocate operation
2223
2224 GcdIoType - The desired IO type
2225
2226 Alignment - Align with 2^Alignment
2227
2228 Length - Length to allocate
2229
2230 BaseAddress - Base address to allocate
2231
2232 ImageHandle - The image handle consume the allocated space.
2233
2234 DeviceHandle - The device handle consume the allocated space.
2235
2236 Returns:
2237
2238 EFI_INVALID_PARAMETER - Invalid parameter.
2239
2240 EFI_NOT_FOUND - No descriptor contains the desired space.
2241
2242 EFI_SUCCESS - IO space successfully allocated.
2243
2244 --*/
2245 ;
2246
2247 EFI_STATUS
2248 CoreFreeIoSpace (
2249 IN EFI_PHYSICAL_ADDRESS BaseAddress,
2250 IN UINT64 Length
2251 )
2252 /*++
2253
2254 Routine Description:Routine Description:
2255
2256 Free a segment of IO space in GCD map.
2257
2258 Arguments:
2259
2260 BaseAddress - Base address of the segment.
2261
2262 Length - Length of the segment.
2263
2264 Returns:
2265
2266 EFI_SUCCESS - Space successfully freed.
2267
2268 --*/
2269 ;
2270
2271 EFI_STATUS
2272 CoreRemoveIoSpace (
2273 IN EFI_PHYSICAL_ADDRESS BaseAddress,
2274 IN UINT64 Length
2275 )
2276 /*++
2277
2278 Routine Description:Routine Description:
2279
2280 Remove a segment of IO space in GCD map.
2281
2282 Arguments:
2283
2284 BaseAddress - Base address of the segment.
2285
2286 Length - Length of the segment.
2287
2288 Returns:
2289
2290 EFI_SUCCESS - Successfully removed a segment of IO space.
2291
2292 --*/
2293 ;
2294
2295 EFI_STATUS
2296 CoreGetIoSpaceDescriptor (
2297 IN EFI_PHYSICAL_ADDRESS BaseAddress,
2298 OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor
2299 )
2300 /*++
2301
2302 Routine Description:
2303
2304 Search all entries in GCD map which contains specified segment and build it to a descriptor.
2305
2306 Arguments:
2307
2308 BaseAddress - Specified start address
2309
2310 Descriptor - Specified length
2311
2312 Returns:
2313
2314 EFI_INVALID_PARAMETER - Descriptor is NULL.
2315
2316 EFI_SUCCESS - Successfully get the IO space descriptor.
2317
2318 --*/
2319 ;
2320
2321 EFI_STATUS
2322 CoreGetIoSpaceMap (
2323 OUT UINTN *NumberOfDescriptors,
2324 OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap
2325 )
2326 /*++
2327
2328 Routine Description:
2329
2330 Transer all entries of GCD IO map into IO descriptors and pass to caller.
2331
2332 Arguments:
2333
2334 NumberOfDescriptors - Number of descriptors.
2335
2336 IoSpaceMap - Descriptor array
2337
2338 Returns:
2339
2340 EFI_INVALID_PARAMETER - Invalid parameter
2341
2342 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
2343
2344 EFI_SUCCESS - Successfully get IO space map.
2345
2346 --*/
2347 ;
2348
2349 EFI_DXESERVICE
2350 EFI_STATUS
2351 EFIAPI
2352 CoreDispatcher (
2353 VOID
2354 )
2355 /*++
2356
2357 Routine Description:
2358
2359 This is the main Dispatcher for DXE and it exits when there are no more
2360 drivers to run. Drain the mScheduledQueue and load and start a PE
2361 image for each driver. Search the mDiscoveredList to see if any driver can
2362 be placed on the mScheduledQueue. If no drivers are placed on the
2363 mScheduledQueue exit the function. On exit it is assumed the Bds()
2364 will be called, and when the Bds() exits the Dispatcher will be called
2365 again.
2366
2367 Arguments:
2368
2369 NONE
2370
2371 Returns:
2372
2373 EFI_ALREADY_STARTED - The DXE Dispatcher is already running
2374
2375 EFI_NOT_FOUND - No DXE Drivers were dispatched
2376
2377 EFI_SUCCESS - One or more DXE Drivers were dispatched
2378
2379 --*/
2380 ;
2381 EFI_DXESERVICE
2382 EFI_STATUS
2383 EFIAPI
2384 CoreSchedule (
2385 IN EFI_HANDLE FirmwareVolumeHandle,
2386 IN EFI_GUID *DriverName
2387 )
2388 /*++
2389
2390 Routine Description:
2391
2392 Check every driver and locate a matching one. If the driver is found, the Unrequested
2393 state flag is cleared.
2394
2395 Arguments:
2396
2397 FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware
2398 file specified by DriverName.
2399
2400 DriverName - The Driver name to put in the Dependent state.
2401
2402 Returns:
2403
2404 EFI_SUCCESS - The DriverName was found and it's SOR bit was cleared
2405
2406 EFI_NOT_FOUND - The DriverName does not exist or it's SOR bit was not set.
2407
2408 --*/
2409 ;
2410
2411 EFI_DXESERVICE
2412 EFI_STATUS
2413 EFIAPI
2414 CoreTrust (
2415 IN EFI_HANDLE FirmwareVolumeHandle,
2416 IN EFI_GUID *DriverName
2417 )
2418 /*++
2419
2420 Routine Description:
2421
2422 Convert a driver from the Untrused back to the Scheduled state
2423
2424 Arguments:
2425
2426 FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware
2427 file specified by DriverName.
2428
2429 DriverName - The Driver name to put in the Scheduled state
2430
2431 Returns:
2432
2433 EFI_SUCCESS - The file was found in the untrusted state, and it was promoted
2434 to the trusted state.
2435
2436 EFI_NOT_FOUND - The file was not found in the untrusted state.
2437
2438 --*/
2439 ;
2440
2441 BOOLEAN
2442 CoreGrowBuffer (
2443 IN OUT EFI_STATUS *Status,
2444 IN OUT VOID **Buffer,
2445 IN UINTN BufferSize
2446 )
2447 /*++
2448
2449 Routine Description:
2450
2451 Helper function called as part of the code needed
2452 to allocate the proper sized buffer for various
2453 EFI interfaces.
2454
2455 Arguments:
2456
2457 Status - Current status
2458
2459 Buffer - Current allocated buffer, or NULL
2460
2461 BufferSize - Current buffer size needed
2462
2463 Returns:
2464
2465 TRUE - if the buffer was reallocated and the caller
2466 should try the API again.
2467
2468 FALSE - buffer could not be allocated and the caller
2469 should not try the API again.
2470
2471 --*/
2472 ;
2473
2474 EFI_STATUS
2475 EFIAPI
2476 FwVolDriverInit (
2477 IN EFI_HANDLE ImageHandle,
2478 IN EFI_SYSTEM_TABLE *SystemTable
2479 )
2480 /*++
2481
2482 Routine Description:
2483 This routine is the driver initialization entry point. It initializes the
2484 libraries, and registers two notification functions. These notification
2485 functions are responsible for building the FV stack dynamically.
2486
2487 Arguments:
2488 ImageHandle - The image handle.
2489 SystemTable - The system table.
2490
2491 Returns:
2492 EFI_SUCCESS - Function successfully returned.
2493
2494 --*/
2495 ;
2496
2497 EFI_STATUS
2498 EFIAPI
2499 InitializeSectionExtraction (
2500 IN EFI_HANDLE ImageHandle,
2501 IN EFI_SYSTEM_TABLE *SystemTable
2502 )
2503 /*++
2504
2505 Routine Description:
2506 Entry point of the section extraction code. Initializes an instance of the
2507 section extraction interface and installs it on a new handle.
2508
2509 Arguments:
2510 ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver
2511 SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table
2512
2513 Returns:
2514 EFI_SUCCESS: Driver initialized successfully
2515 EFI_OUT_OF_RESOURCES: Could not allocate needed resources
2516
2517 --*/
2518 ;
2519
2520 EFI_STATUS
2521 CoreProcessFirmwareVolume (
2522 IN VOID *FvHeader,
2523 IN UINTN Size,
2524 OUT EFI_HANDLE *FVProtocolHandle
2525 )
2526 /*++
2527
2528 Routine Description:
2529 This DXE service routine is used to process a firmware volume. In
2530 particular, it can be called by BDS to process a single firmware
2531 volume found in a capsule.
2532
2533 Arguments:
2534 FvHeader - pointer to a firmware volume header
2535 Size - the size of the buffer pointed to by FvHeader
2536 FVProtocolHandle - the handle on which a firmware volume protocol
2537 was produced for the firmware volume passed in.
2538
2539 Returns:
2540 EFI_OUT_OF_RESOURCES - if an FVB could not be produced due to lack of
2541 system resources
2542 EFI_VOLUME_CORRUPTED - if the volume was corrupted
2543 EFI_SUCCESS - a firmware volume protocol was produced for the
2544 firmware volume
2545
2546 --*/
2547 ;
2548
2549 //
2550 //Functions used during debug buils
2551 //
2552 VOID
2553 CoreDisplayMissingArchProtocols (
2554 VOID
2555 )
2556 /*++
2557
2558 Routine Description:
2559 Displays Architectural protocols that were not loaded and are required for DXE core to function
2560 Only used in Debug Builds
2561
2562 Arguments:
2563 NONE
2564
2565 Returns:
2566 NONE
2567
2568 --*/;
2569
2570 VOID
2571 CoreDisplayDiscoveredNotDispatched (
2572 VOID
2573 )
2574 /*++
2575
2576 Routine Description:
2577
2578 Traverse the discovered list for any drivers that were discovered but not loaded
2579 because the dependency experessions evaluated to false
2580
2581 Arguments:
2582
2583 NONE
2584
2585 Returns:
2586
2587 NONE
2588
2589 --*/;
2590
2591 EFI_STATUS
2592 EFIAPI
2593 CoreEfiNotAvailableYetArg0 (
2594 VOID
2595 )
2596 /*++
2597
2598 Routine Description:
2599
2600 Place holder function until all the Boot Services and Runtime Services are available
2601
2602 Arguments:
2603
2604 None
2605
2606 Returns:
2607
2608 EFI_NOT_AVAILABLE_YET
2609
2610 --*/
2611 ;
2612
2613 EFI_STATUS
2614 EFIAPI
2615 CoreEfiNotAvailableYetArg1 (
2616 UINTN Arg1
2617 )
2618 /*++
2619
2620 Routine Description:
2621
2622 Place holder function until all the Boot Services and Runtime Services are available
2623
2624 Arguments:
2625
2626 Arg1 - Undefined
2627
2628 Returns:
2629
2630 EFI_NOT_AVAILABLE_YET
2631
2632 --*/
2633 ;
2634
2635 EFI_STATUS
2636 EFIAPI
2637 CoreEfiNotAvailableYetArg2 (
2638 UINTN Arg1,
2639 UINTN Arg2
2640 )
2641 /*++
2642
2643 Routine Description:
2644
2645 Place holder function until all the Boot Services and Runtime Services are available
2646
2647 Arguments:
2648
2649 Arg1 - Undefined
2650
2651 Arg2 - Undefined
2652
2653 Returns:
2654
2655 EFI_NOT_AVAILABLE_YET
2656
2657 --*/
2658 ;
2659
2660 EFI_STATUS
2661 EFIAPI
2662 CoreEfiNotAvailableYetArg3 (
2663 UINTN Arg1,
2664 UINTN Arg2,
2665 UINTN Arg3
2666 )
2667 /*++
2668
2669 Routine Description:
2670
2671 Place holder function until all the Boot Services and Runtime Services are available
2672
2673 Arguments:
2674
2675 Arg1 - Undefined
2676
2677 Arg2 - Undefined
2678
2679 Arg3 - Undefined
2680
2681 Returns:
2682
2683 EFI_NOT_AVAILABLE_YET
2684
2685 --*/
2686 ;
2687
2688 EFI_STATUS
2689 EFIAPI
2690 CoreEfiNotAvailableYetArg4 (
2691 UINTN Arg1,
2692 UINTN Arg2,
2693 UINTN Arg3,
2694 UINTN Arg4
2695 )
2696 /*++
2697
2698 Routine Description:
2699
2700 Place holder function until all the Boot Services and Runtime Services are available
2701
2702 Arguments:
2703
2704 Arg1 - Undefined
2705
2706 Arg2 - Undefined
2707
2708 Arg3 - Undefined
2709
2710 Arg4 - Undefined
2711
2712 Returns:
2713
2714 EFI_NOT_AVAILABLE_YET
2715
2716 --*/
2717 ;
2718
2719 EFI_STATUS
2720 EFIAPI
2721 CoreEfiNotAvailableYetArg5 (
2722 UINTN Arg1,
2723 UINTN Arg2,
2724 UINTN Arg3,
2725 UINTN Arg4,
2726 UINTN Arg5
2727 )
2728 /*++
2729
2730 Routine Description:
2731
2732 Place holder function until all the Boot Services and Runtime Services are available
2733
2734 Arguments:
2735
2736 Arg1 - Undefined
2737
2738 Arg2 - Undefined
2739
2740 Arg3 - Undefined
2741
2742 Arg4 - Undefined
2743
2744 Arg5 - Undefined
2745
2746 Returns:
2747
2748 EFI_NOT_AVAILABLE_YET
2749
2750 --*/
2751 ;
2752
2753 EFI_STATUS
2754 CoreGetPeiProtocol (
2755 IN EFI_GUID *ProtocolGuid,
2756 IN VOID **Interface
2757 )
2758 /*++
2759
2760 Routine Description:
2761
2762 Searches for a Protocol Interface passed from PEI through a HOB
2763
2764 Arguments:
2765
2766 ProtocolGuid - The Protocol GUID to search for in the HOB List
2767
2768 Interface - A pointer to the interface for the Protocol GUID
2769
2770 Returns:
2771
2772 EFI_SUCCESS - The Protocol GUID was found and its interface is returned in Interface
2773
2774 EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List
2775
2776 --*/
2777 ;
2778
2779 EFI_STATUS
2780 DxeMainUefiDecompressGetInfo (
2781 IN EFI_DECOMPRESS_PROTOCOL *This,
2782 IN VOID *Source,
2783 IN UINT32 SourceSize,
2784 OUT UINT32 *DestinationSize,
2785 OUT UINT32 *ScratchSize
2786 );
2787
2788 EFI_STATUS
2789 EFIAPI
2790 DxeMainUefiDecompress (
2791 IN EFI_DECOMPRESS_PROTOCOL *This,
2792 IN VOID *Source,
2793 IN UINT32 SourceSize,
2794 IN OUT VOID *Destination,
2795 IN UINT32 DestinationSize,
2796 IN OUT VOID *Scratch,
2797 IN UINT32 ScratchSize
2798 );
2799
2800 EFI_STATUS
2801 DxeMainTianoDecompressGetInfo (
2802 IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,
2803 IN VOID *Source,
2804 IN UINT32 SourceSize,
2805 OUT UINT32 *DestinationSize,
2806 OUT UINT32 *ScratchSize
2807 );
2808
2809 EFI_STATUS
2810 EFIAPI
2811 DxeMainTianoDecompress (
2812 IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,
2813 IN VOID *Source,
2814 IN UINT32 SourceSize,
2815 IN OUT VOID *Destination,
2816 IN UINT32 DestinationSize,
2817 IN OUT VOID *Scratch,
2818 IN UINT32 ScratchSize
2819 );
2820
2821 EFI_STATUS
2822 DxeMainCustomDecompressGetInfo (
2823 IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,
2824 IN VOID *Source,
2825 IN UINT32 SourceSize,
2826 OUT UINT32 *DestinationSize,
2827 OUT UINT32 *ScratchSize
2828 );
2829
2830 EFI_STATUS
2831 EFIAPI
2832 DxeMainCustomDecompress (
2833 IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,
2834 IN VOID *Source,
2835 IN UINT32 SourceSize,
2836 IN OUT VOID *Destination,
2837 IN UINT32 DestinationSize,
2838 IN OUT VOID *Scratch,
2839 IN UINT32 ScratchSize
2840 );
2841
2842 EFI_STATUS
2843 EFIAPI
2844 OpenSectionStream (
2845 IN UINTN SectionStreamLength,
2846 IN VOID *SectionStream,
2847 OUT UINTN *SectionStreamHandle
2848 );
2849
2850 EFI_STATUS
2851 EFIAPI
2852 GetSection (
2853 IN UINTN SectionStreamHandle,
2854 IN EFI_SECTION_TYPE *SectionType,
2855 IN EFI_GUID *SectionDefinitionGuid,
2856 IN UINTN SectionInstance,
2857 IN VOID **Buffer,
2858 IN OUT UINTN *BufferSize,
2859 OUT UINT32 *AuthenticationStatus
2860 );
2861
2862 EFI_STATUS
2863 EFIAPI
2864 CloseSectionStream (
2865 IN UINTN StreamHandleToClose
2866 );
2867
2868 #endif