X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FCore%2FDxe%2FDxeMain.h;h=13b0ee3e3ddfe1f62184db4922b98fea0c966568;hb=1232b21473646661a4ac1ae4b7bf5113d4613e83;hp=64c0f9709fe499f399e0b11b23a94c6e75e63ca7;hpb=070f0cf7f2abafb5f04ffd2fa78abba7385531b9;p=mirror_edk2.git diff --git a/MdeModulePkg/Core/Dxe/DxeMain.h b/MdeModulePkg/Core/Dxe/DxeMain.h index 64c0f9709f..13b0ee3e3d 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.h +++ b/MdeModulePkg/Core/Dxe/DxeMain.h @@ -78,22 +78,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include - -#include "DebugImageInfo.h" -#include "Library.h" -#include "FwVolBlock.h" -#include "FwVolDriver.h" -#include "Gcd.h" -#include "Imem.h" -#include "Image.h" -#include "Exec.h" -#include "Hand.h" - - -// -// Modifier for EFI DXE Services -// -#define EFI_DXESERVICE +#include +#include // // attributes for reserved memory before it is promoted to system memory @@ -111,7 +97,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /// /// EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependecy expression /// to save time. A EFI_DEP_PUSH is evauated one an -/// replaced with EFI_DEP_REPLACE_TRUE +/// replaced with EFI_DEP_REPLACE_TRUE. If PI spec's Vol 2 +/// Driver Execution Environment Core Interface use 0xff +/// as new DEPEX opcode. EFI_DEP_REPLACE_TRUE should be +/// defined to a new value that is not conflicting with PI spec. /// #define EFI_DEP_REPLACE_TRUE 0xff @@ -128,14 +117,6 @@ typedef struct { BOOLEAN Present; } ARCHITECTURAL_PROTOCOL_ENTRY; -typedef struct { - EFI_STATUS_CODE_DATA DataHeader; - EFI_HANDLE Handle; -} EFI_DXE_DEVICE_HANDLE_EXTENDED_DATA; - -#define EFI_STATUS_CODE_DXE_CORE_GUID \ - { 0x335984bd, 0xe805, 0x409a, { 0xb8, 0xf8, 0xd2, 0x7e, 0xce, 0x5f, 0xf7, 0xa6 } } - // // DXE Dispatcher Data structures // @@ -212,7 +193,6 @@ extern EFI_METRONOME_ARCH_PROTOCOL *gMetronome; extern EFI_TIMER_ARCH_PROTOCOL *gTimer; extern EFI_SECURITY_ARCH_PROTOCOL *gSecurity; extern EFI_BDS_ARCH_PROTOCOL *gBds; -extern EFI_STATUS_CODE_PROTOCOL *gStatusCode; extern EFI_TPL gEfiCurrentTpl; @@ -285,12 +265,11 @@ CoreAcquireGcdMemoryLock ( /** - External function. Initializes the GCD and memory services based on the memory - descriptor HOBs. This function is responsible for priming the GCD map and the - memory map, so memory allocations and resource allocations can be made. The first - part of this function can not depend on any memory services until at least one - memory descriptor is provided to the memory services. Then the memory services - can be used to intialize the GCD map. + External function. Initializes memory services based on the memory + descriptor HOBs. This function is responsible for priming the memory + map, so memory allocations and resource allocations can be made. + The first part of this function can not depend on any memory services + until at least one memory descriptor is provided to the memory services. @param HobStart The start address of the HOB. @param MemoryBaseAddress Start address of memory region found to init DXE @@ -312,11 +291,8 @@ CoreInitializeMemoryServices ( /** External function. Initializes the GCD and memory services based on the memory descriptor HOBs. This function is responsible for priming the GCD map and the - memory map, so memory allocations and resource allocations can be made. The first - part of this function can not depend on any memory services until at least one - memory descriptor is provided to the memory services. Then the memory services - can be used to intialize the GCD map. The HobStart will be relocated to a pool - buffer. + memory map, so memory allocations and resource allocations can be made. The + HobStart will be relocated to a pool buffer. @param HobStart The start address of the HOB @param MemoryBaseAddress Start address of memory region found to init DXE @@ -335,7 +311,7 @@ CoreInitializeGcdServices ( /** - Initializes "event" support and populates parts of the System and Runtime Table. + Initializes "event" support. @retval EFI_SUCCESS Always return success @@ -931,6 +907,20 @@ CoreRegisterProtocolNotify ( ); +/** + Removes all the events in the protocol database that match Event. + + @param Event The event to search for in the protocol + database. + + @return EFI_SUCCESS when done searching the entire database. + +**/ +EFI_STATUS +CoreUnregisterProtocolNotify ( + IN EFI_EVENT Event + ); + /** Locates the requested handle(s) and returns them in Buffer. @@ -1573,6 +1563,7 @@ CoreCheckEvent ( **/ EFI_STATUS +EFIAPI CoreAddMemorySpace ( IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN EFI_PHYSICAL_ADDRESS BaseAddress, @@ -1599,6 +1590,7 @@ CoreAddMemorySpace ( **/ EFI_STATUS +EFIAPI CoreAllocateMemorySpace ( IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, IN EFI_GCD_MEMORY_TYPE GcdMemoryType, @@ -1621,6 +1613,7 @@ CoreAllocateMemorySpace ( **/ EFI_STATUS +EFIAPI CoreFreeMemorySpace ( IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length @@ -1638,6 +1631,7 @@ CoreFreeMemorySpace ( **/ EFI_STATUS +EFIAPI CoreRemoveMemorySpace ( IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length @@ -1655,6 +1649,7 @@ CoreRemoveMemorySpace ( **/ EFI_STATUS +EFIAPI CoreGetMemorySpaceDescriptor ( IN EFI_PHYSICAL_ADDRESS BaseAddress, OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor @@ -1674,6 +1669,7 @@ CoreGetMemorySpaceDescriptor ( **/ EFI_STATUS +EFIAPI CoreSetMemorySpaceAttributes ( IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, @@ -1694,6 +1690,7 @@ CoreSetMemorySpaceAttributes ( **/ EFI_STATUS +EFIAPI CoreGetMemorySpaceMap ( OUT UINTN *NumberOfDescriptors, OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap @@ -1712,6 +1709,7 @@ CoreGetMemorySpaceMap ( **/ EFI_STATUS +EFIAPI CoreAddIoSpace ( IN EFI_GCD_IO_TYPE GcdIoType, IN EFI_PHYSICAL_ADDRESS BaseAddress, @@ -1737,6 +1735,7 @@ CoreAddIoSpace ( **/ EFI_STATUS +EFIAPI CoreAllocateIoSpace ( IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, IN EFI_GCD_IO_TYPE GcdIoType, @@ -1759,6 +1758,7 @@ CoreAllocateIoSpace ( **/ EFI_STATUS +EFIAPI CoreFreeIoSpace ( IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length @@ -1776,6 +1776,7 @@ CoreFreeIoSpace ( **/ EFI_STATUS +EFIAPI CoreRemoveIoSpace ( IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length @@ -1793,6 +1794,7 @@ CoreRemoveIoSpace ( **/ EFI_STATUS +EFIAPI CoreGetIoSpaceDescriptor ( IN EFI_PHYSICAL_ADDRESS BaseAddress, OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor @@ -1811,6 +1813,7 @@ CoreGetIoSpaceDescriptor ( **/ EFI_STATUS +EFIAPI CoreGetIoSpaceMap ( OUT UINTN *NumberOfDescriptors, OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap @@ -1958,6 +1961,7 @@ InitializeSectionExtraction ( **/ EFI_STATUS +EFIAPI CoreProcessFirmwareVolume ( IN VOID *FvHeader, IN UINTN Size, @@ -2100,24 +2104,6 @@ CoreEfiNotAvailableYetArg5 ( ); -/** - Searches for a Protocol Interface passed from PEI through a HOB. - - @param ProtocolGuid The Protocol GUID to search for in the HOB List - @param Interface A pointer to the interface for the Protocol GUID - - @retval EFI_SUCCESS The Protocol GUID was found and its interface is - returned in Interface - @retval EFI_NOT_FOUND The Protocol GUID was not found in the HOB List - -**/ -EFI_STATUS -CoreGetPeiProtocol ( - IN EFI_GUID *ProtocolGuid, - IN VOID **Interface - ); - - /** Given a compressed source buffer, this function retrieves the size of the uncompressed buffer and the size of the scratch buffer required to decompress @@ -2326,4 +2312,157 @@ CloseSectionStream ( IN UINTN StreamHandleToClose ); +/** + Creates and initializes the DebugImageInfo Table. Also creates the configuration + table and registers it into the system table. + + Note: + This function allocates memory, frees it, and then allocates memory at an + address within the initial allocation. Since this function is called early + in DXE core initialization (before drivers are dispatched), this should not + be a problem. + +**/ +VOID +CoreInitializeDebugImageInfoTable ( + VOID + ); + + +/** + Update the CRC32 in the Debug Table. + Since the CRC32 service is made available by the Runtime driver, we have to + wait for the Runtime Driver to be installed before the CRC32 can be computed. + This function is called elsewhere by the core when the runtime architectural + protocol is produced. + +**/ +VOID +CoreUpdateDebugTableCrc32 ( + VOID + ); + + +/** + Adds a new DebugImageInfo structure to the DebugImageInfo Table. Re-Allocates + the table if it's not large enough to accomidate another entry. + + @param ImageInfoType type of debug image information + @param LoadedImage pointer to the loaded image protocol for the image being + loaded + @param ImageHandle image handle for the image being loaded + +**/ +VOID +CoreNewDebugImageInfoEntry ( + IN UINT32 ImageInfoType, + IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage, + IN EFI_HANDLE ImageHandle + ); + + +/** + Removes and frees an entry from the DebugImageInfo Table. + + @param ImageHandle image handle for the image being unloaded + +**/ +VOID +CoreRemoveDebugImageInfoEntry ( + EFI_HANDLE ImageHandle + ); + + +/** + This routine consumes FV hobs and produces instances of FW_VOL_BLOCK_PROTOCOL as appropriate. + + @param ImageHandle The image handle. + @param SystemTable The system table. + + @retval EFI_SUCCESS Successfully initialized firmware volume block + driver. + +**/ +EFI_STATUS +EFIAPI +FwVolBlockDriverInit ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ); + + +/** + This routine produces a firmware volume block protocol on a given + buffer. + + @param BaseAddress base address of the firmware volume image + @param Length length of the firmware volume image + @param ParentHandle handle of parent firmware volume, if this image + came from an FV image file in another firmware + volume (ala capsules) + @param FvProtocol Firmware volume block protocol produced. + + @retval EFI_VOLUME_CORRUPTED Volume corrupted. + @retval EFI_OUT_OF_RESOURCES No enough buffer to be allocated. + @retval EFI_SUCCESS Successfully produced a FVB protocol on given + buffer. + +**/ +EFI_STATUS +ProduceFVBProtocolOnBuffer ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN EFI_HANDLE ParentHandle, + OUT EFI_HANDLE *FvProtocol OPTIONAL + ); + + +/** + Raising to the task priority level of the mutual exclusion + lock, and then acquires ownership of the lock. + + @param Lock The lock to acquire + + @return Lock owned + +**/ +VOID +CoreAcquireLock ( + IN EFI_LOCK *Lock + ); + + +/** + Initialize a basic mutual exclusion lock. Each lock + provides mutual exclusion access at it's task priority + level. Since there is no-premption (at any TPL) or + multiprocessor support, acquiring the lock only consists + of raising to the locks TPL. + + @param Lock The EFI_LOCK structure to initialize + + @retval EFI_SUCCESS Lock Owned. + @retval EFI_ACCESS_DENIED Reentrant Lock Acquisition, Lock not Owned. + +**/ +EFI_STATUS +CoreAcquireLockOrFail ( + IN EFI_LOCK *Lock + ); + + +/** + Releases ownership of the mutual exclusion lock, and + restores the previous task priority level. + + @param Lock The lock to release + + @return Lock unowned + +**/ +VOID +CoreReleaseLock ( + IN EFI_LOCK *Lock + ); + #endif