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