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