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