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