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