X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FDxe%2FDispatcher%2FDispatcher.c;h=27f18326e02047b0d1c3fa94c730c6cdd53f28eb;hp=d348c82a9e318c2fd46aa9195b0b98644dfa6c6f;hb=11c11e4ecf4c3bb41ede73fe88ac29dc67195aa9;hpb=38837959db04259d0dbfc1ab906330961d5f9d8e diff --git a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c index d348c82a9e..27f18326e0 100644 --- a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c @@ -1,4 +1,4 @@ -/**@file +/** @file DXE Dispatcher. Step #1 - When a FV protocol is added to the system every driver in the FV @@ -26,14 +26,14 @@ Depex - Dependency Expresion. SOR - Schedule On Request - Don't schedule if this bit is set. -Copyright (c) 2006 - 2007, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +Copyright (c) 2006 - 2008, Intel Corporation.
+All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ @@ -76,7 +76,7 @@ VOID *mFwVolEventRegistration; // // List of file types supported by dispatcher // -static EFI_FV_FILETYPE mDxeFileTypes[] = { +EFI_FV_FILETYPE mDxeFileTypes[] = { EFI_FV_FILETYPE_DRIVER, EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER, EFI_FV_FILETYPE_DXE_CORE, @@ -94,13 +94,39 @@ FV_FILEPATH_DEVICE_PATH mFvDevicePath; // // Function Prototypes // -STATIC +/** + Insert InsertedDriverEntry onto the mScheduledQueue. To do this you + must add any driver with a before dependency on InsertedDriverEntry first. + You do this by recursively calling this routine. After all the Befores are + processed you can add InsertedDriverEntry to the mScheduledQueue. + Then you can add any driver with an After dependency on InsertedDriverEntry + by recursively calling this routine. + + @param InsertedDriverEntry The driver to insert on the ScheduledLink Queue + +**/ VOID CoreInsertOnScheduledQueueWhileProcessingBeforeAndAfter ( IN EFI_CORE_DRIVER_ENTRY *InsertedDriverEntry ); -STATIC +/** + Event notification that is fired every time a FV dispatch protocol is added. + More than one protocol may have been added when this event is fired, so you + must loop on CoreLocateHandle () to see how many protocols were added and + do the following to each FV: + If the Fv has already been processed, skip it. If the Fv has not been + processed then mark it as being processed, as we are about to process it. + Read the Fv and add any driver in the Fv to the mDiscoveredList.The + mDiscoveredList is never free'ed and contains variables that define + the other states the DXE driver transitions to.. + While you are at it read the A Priori file into memory. + Place drivers in the A Priori list onto the mScheduledQueue. + + @param Event The Event that is being processed, not used. + @param Context Event Context, not used. + +**/ VOID EFIAPI CoreFwVolEventProtocolNotify ( @@ -108,7 +134,19 @@ CoreFwVolEventProtocolNotify ( IN VOID *Context ); -STATIC +/** + Convert FvHandle and DriverName into an EFI device path. + + @param Fv Fv protocol, needed to read Depex info out of + FLASH. + @param FvHandle Handle for Fv, needed in the + EFI_CORE_DRIVER_ENTRY so that the PE image can be + read out of the FV at a later time. + @param DriverName Name of driver to add to mDiscoveredList. + + @return Pointer to device path constructed from FvHandle and DriverName + +**/ EFI_DEVICE_PATH_PROTOCOL * CoreFvToDevicePath ( IN EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv, @@ -116,15 +154,45 @@ CoreFvToDevicePath ( IN EFI_GUID *DriverName ); -STATIC +/** + Add an entry to the mDiscoveredList. Allocate memory to store the DriverEntry, + and initilize any state variables. Read the Depex from the FV and store it + in DriverEntry. Pre-process the Depex to set the SOR, Before and After state. + The Discovered list is never free'ed and contains booleans that represent the + other possible DXE driver states. + + @param Fv Fv protocol, needed to read Depex info out of + FLASH. + @param FvHandle Handle for Fv, needed in the + EFI_CORE_DRIVER_ENTRY so that the PE image can be + read out of the FV at a later time. + @param DriverName Name of driver to add to mDiscoveredList. + + @retval EFI_SUCCESS If driver was added to the mDiscoveredList. + @retval EFI_ALREADY_STARTED The driver has already been started. Only one + DriverName may be active in the system at any one + time. + +**/ EFI_STATUS CoreAddToDriverList ( - IN EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv, - IN EFI_HANDLE FvHandle, - IN EFI_GUID *DriverName + IN EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv, + IN EFI_HANDLE FvHandle, + IN EFI_GUID *DriverName ); -STATIC +/** + Get the driver from the FV through driver name, and produce a FVB protocol on FvHandle. + + @param Fv The FIRMWARE_VOLUME protocol installed on the FV. + @param FvHandle The handle which FVB protocol installed on. + @param DriverName The driver guid specified. + + @retval EFI_OUT_OF_RESOURCES No enough memory or other resource. + @retval EFI_VOLUME_CORRUPTED Corrupted volume. + @retval EFI_SUCCESS Function successfully returned. + +**/ EFI_STATUS CoreProcessFvImageFile ( IN EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv, @@ -132,81 +200,49 @@ CoreProcessFvImageFile ( IN EFI_GUID *DriverName ); -STATIC + +/** + Enter critical section by gaining lock on mDispatcherLock. + +**/ VOID CoreAcquireDispatcherLock ( VOID ) -/*++ - -Routine Description: - - Enter critical section by gaining lock on mDispatcherLock - -Arguments: - - None - -Returns: - - None - ---*/ - { CoreAcquireLock (&mDispatcherLock); } -STATIC + +/** + Exit critical section by releasing lock on mDispatcherLock. + +**/ VOID CoreReleaseDispatcherLock ( VOID ) -/*++ - -Routine Description: - - Exit critical section by releasing lock on mDispatcherLock - -Arguments: - - None - -Returns: - - None - ---*/ { CoreReleaseLock (&mDispatcherLock); } -STATIC -EFI_STATUS -CoreGetDepexSectionAndPreProccess ( - IN EFI_CORE_DRIVER_ENTRY *DriverEntry - ) -/*++ - -Routine Description: +/** Read Depex and pre-process the Depex for Before and After. If Section Extraction protocol returns an error via ReadSection defer the reading of the Depex. -Arguments: - - DriverEntry - Driver to work on. - -Returns: - - EFI_SUCCESS - Depex read and preprossesed + @param DriverEntry Driver to work on. - EFI_PROTOCOL_ERROR - The section extraction protocol returned an error and - Depex reading needs to be retried. + @retval EFI_SUCCESS Depex read and preprossesed + @retval EFI_PROTOCOL_ERROR The section extraction protocol returned an error + and Depex reading needs to be retried. + @retval Error DEPEX not found. - Other Error - DEPEX not found. - ---*/ +**/ +EFI_STATUS +CoreGetDepexSectionAndPreProccess ( + IN EFI_CORE_DRIVER_ENTRY *DriverEntry + ) { EFI_STATUS Status; EFI_SECTION_TYPE SectionType; @@ -255,34 +291,27 @@ Returns: return Status; } -EFI_DXESERVICE -EFI_STATUS -EFIAPI -CoreSchedule ( - IN EFI_HANDLE FirmwareVolumeHandle, - IN EFI_GUID *DriverName - ) -/*++ - -Routine Description: +/** Check every driver and locate a matching one. If the driver is found, the Unrequested state flag is cleared. -Arguments: + @param FirmwareVolumeHandle The handle of the Firmware Volume that contains + the firmware file specified by DriverName. + @param DriverName The Driver name to put in the Dependent state. - FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware - file specified by DriverName. + @retval EFI_SUCCESS The DriverName was found and it's SOR bit was + cleared + @retval EFI_NOT_FOUND The DriverName does not exist or it's SOR bit was + not set. - DriverName - The Driver name to put in the Dependent state. - -Returns: - - EFI_SUCCESS - The DriverName was found and it's SOR bit was cleared - - EFI_NOT_FOUND - The DriverName does not exist or it's SOR bit was not set. - ---*/ +**/ +EFI_STATUS +EFIAPI +CoreSchedule ( + IN EFI_HANDLE FirmwareVolumeHandle, + IN EFI_GUID *DriverName + ) { LIST_ENTRY *Link; EFI_CORE_DRIVER_ENTRY *DriverEntry; @@ -310,34 +339,25 @@ Returns: } -EFI_DXESERVICE + +/** + Convert a driver from the Untrused back to the Scheduled state. + + @param FirmwareVolumeHandle The handle of the Firmware Volume that contains + the firmware file specified by DriverName. + @param DriverName The Driver name to put in the Scheduled state + + @retval EFI_SUCCESS The file was found in the untrusted state, and it + was promoted to the trusted state. + @retval EFI_NOT_FOUND The file was not found in the untrusted state. + +**/ EFI_STATUS EFIAPI CoreTrust ( IN EFI_HANDLE FirmwareVolumeHandle, IN EFI_GUID *DriverName ) -/*++ - -Routine Description: - - Convert a driver from the Untrused back to the Scheduled state - -Arguments: - - FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware - file specified by DriverName. - - DriverName - The Driver name to put in the Scheduled state - -Returns: - - EFI_SUCCESS - The file was found in the untrusted state, and it was promoted - to the trusted state. - - EFI_NOT_FOUND - The file was not found in the untrusted state. - ---*/ { LIST_ENTRY *Link; EFI_CORE_DRIVER_ENTRY *DriverEntry; @@ -366,37 +386,26 @@ Returns: } -EFI_DXESERVICE -EFI_STATUS -EFIAPI -CoreDispatcher ( - VOID - ) -/*++ - -Routine Description: - This is the main Dispatcher for DXE and it exits when there are no more +/** + This is the main Dispatcher for DXE and it exits when there are no more drivers to run. Drain the mScheduledQueue and load and start a PE - image for each driver. Search the mDiscoveredList to see if any driver can + image for each driver. Search the mDiscoveredList to see if any driver can be placed on the mScheduledQueue. If no drivers are placed on the mScheduledQueue exit the function. On exit it is assumed the Bds() - will be called, and when the Bds() exits the Dispatcher will be called + will be called, and when the Bds() exits the Dispatcher will be called again. -Arguments: - - NONE - -Returns: - - EFI_ALREADY_STARTED - The DXE Dispatcher is already running - - EFI_NOT_FOUND - No DXE Drivers were dispatched + @retval EFI_ALREADY_STARTED The DXE Dispatcher is already running + @retval EFI_NOT_FOUND No DXE Drivers were dispatched + @retval EFI_SUCCESS One or more DXE Drivers were dispatched - EFI_SUCCESS - One or more DXE Drivers were dispatched - ---*/ +**/ +EFI_STATUS +EFIAPI +CoreDispatcher ( + VOID + ) { EFI_STATUS Status; EFI_STATUS ReturnStatus; @@ -524,31 +533,22 @@ Returns: return ReturnStatus; } -STATIC -VOID -CoreInsertOnScheduledQueueWhileProcessingBeforeAndAfter ( - IN EFI_CORE_DRIVER_ENTRY *InsertedDriverEntry - ) -/*++ - -Routine Description: - Insert InsertedDriverEntry onto the mScheduledQueue. To do this you +/** + Insert InsertedDriverEntry onto the mScheduledQueue. To do this you must add any driver with a before dependency on InsertedDriverEntry first. You do this by recursively calling this routine. After all the Befores are - processed you can add InsertedDriverEntry to the mScheduledQueue. - Then you can add any driver with an After dependency on InsertedDriverEntry + processed you can add InsertedDriverEntry to the mScheduledQueue. + Then you can add any driver with an After dependency on InsertedDriverEntry by recursively calling this routine. -Arguments: - - InsertedDriverEntry - The driver to insert on the ScheduledLink Queue - -Returns: + @param InsertedDriverEntry The driver to insert on the ScheduledLink Queue - NONE - ---*/ +**/ +VOID +CoreInsertOnScheduledQueueWhileProcessingBeforeAndAfter ( + IN EFI_CORE_DRIVER_ENTRY *InsertedDriverEntry + ) { LIST_ENTRY *Link; EFI_CORE_DRIVER_ENTRY *DriverEntry; @@ -595,28 +595,20 @@ Returns: } } -STATIC -BOOLEAN -FvHasBeenProcessed ( - IN EFI_HANDLE FvHandle - ) -/*++ - -Routine Description: +/** Return TRUE if the Fv has been processed, FALSE if not. -Arguments: - - FvHandle - The handle of a FV that's being tested + @param FvHandle The handle of a FV that's being tested -Returns: + @retval TRUE Fv protocol on FvHandle has been processed + @retval FALSE Fv protocol on FvHandle has not yet been processed - TRUE - Fv protocol on FvHandle has been processed - - FALSE - Fv protocol on FvHandle has not yet been processed - ---*/ +**/ +BOOLEAN +FvHasBeenProcessed ( + IN EFI_HANDLE FvHandle + ) { LIST_ENTRY *Link; KNOWN_HANDLE *KnownHandle; @@ -630,28 +622,19 @@ Returns: return FALSE; } -STATIC -VOID -FvIsBeingProcesssed ( - IN EFI_HANDLE FvHandle - ) -/*++ - -Routine Description: +/** Remember that Fv protocol on FvHandle has had it's drivers placed on the mDiscoveredList. This fucntion adds entries on the mFvHandleList. Items are never removed/freed from the mFvHandleList. -Arguments: - - FvHandle - The handle of a FV that has been processed - -Returns: + @param FvHandle The handle of a FV that has been processed - None - ---*/ +**/ +VOID +FvIsBeingProcesssed ( + IN EFI_HANDLE FvHandle + ) { KNOWN_HANDLE *KnownHandle; @@ -665,33 +648,26 @@ Returns: -STATIC + +/** + Convert FvHandle and DriverName into an EFI device path + + @param Fv Fv protocol, needed to read Depex info out of + FLASH. + @param FvHandle Handle for Fv, needed in the + EFI_CORE_DRIVER_ENTRY so that the PE image can be + read out of the FV at a later time. + @param DriverName Name of driver to add to mDiscoveredList. + + @return Pointer to device path constructed from FvHandle and DriverName + +**/ EFI_DEVICE_PATH_PROTOCOL * CoreFvToDevicePath ( IN EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv, IN EFI_HANDLE FvHandle, IN EFI_GUID *DriverName ) -/*++ - -Routine Description: - - Convert FvHandle and DriverName into an EFI device path - -Arguments: - - Fv - Fv protocol, needed to read Depex info out of FLASH. - - FvHandle - Handle for Fv, needed in the EFI_CORE_DRIVER_ENTRY so that the - PE image can be read out of the FV at a later time. - - DriverName - Name of driver to add to mDiscoveredList. - -Returns: - - Pointer to device path constructed from FvHandle and DriverName - ---*/ { EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *FvDevicePath; @@ -723,39 +699,32 @@ Returns: -EFI_STATUS -CoreAddToDriverList ( - IN EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv, - IN EFI_HANDLE FvHandle, - IN EFI_GUID *DriverName - ) -/*++ - -Routine Description: - - Add an entry to the mDiscoveredList. Allocate memory to store the DriverEntry, +/** + Add an entry to the mDiscoveredList. Allocate memory to store the DriverEntry, and initilize any state variables. Read the Depex from the FV and store it in DriverEntry. Pre-process the Depex to set the SOR, Before and After state. The Discovered list is never free'ed and contains booleans that represent the other possible DXE driver states. -Arguments: + @param Fv Fv protocol, needed to read Depex info out of + FLASH. + @param FvHandle Handle for Fv, needed in the + EFI_CORE_DRIVER_ENTRY so that the PE image can be + read out of the FV at a later time. + @param DriverName Name of driver to add to mDiscoveredList. - Fv - Fv protocol, needed to read Depex info out of FLASH. - - FvHandle - Handle for Fv, needed in the EFI_CORE_DRIVER_ENTRY so that the - PE image can be read out of the FV at a later time. - - DriverName - Name of driver to add to mDiscoveredList. - -Returns: - - EFI_SUCCESS - If driver was added to the mDiscoveredList. - - EFI_ALREADY_STARTED - The driver has already been started. Only one DriverName - may be active in the system at any one time. + @retval EFI_SUCCESS If driver was added to the mDiscoveredList. + @retval EFI_ALREADY_STARTED The driver has already been started. Only one + DriverName may be active in the system at any one + time. ---*/ +**/ +EFI_STATUS +CoreAddToDriverList ( + IN EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv, + IN EFI_HANDLE FvHandle, + IN EFI_GUID *DriverName + ) { EFI_CORE_DRIVER_ENTRY *DriverEntry; @@ -768,7 +737,7 @@ Returns: ASSERT (DriverEntry != NULL); DriverEntry->Signature = EFI_CORE_DRIVER_ENTRY_SIGNATURE; - CopyMem (&DriverEntry->FileName, DriverName, sizeof (EFI_GUID)); + CopyGuid (&DriverEntry->FileName, DriverName); DriverEntry->FvHandle = FvHandle; DriverEntry->Fv = Fv; DriverEntry->FvFileDevicePath = CoreFvToDevicePath (Fv, FvHandle, DriverName); @@ -784,32 +753,24 @@ Returns: return EFI_SUCCESS; } -STATIC -BOOLEAN -FvFoundInHobFv2 ( - IN EFI_HANDLE FvHandle, - IN CONST EFI_GUID *DriverName - ) -/*++ - -Routine Description: +/** Check if a FV Image type file (EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) is described by a EFI_HOB_FIRMWARE_VOLUME2 Hob. -Arguments: + @param FvHandle The handle which FVB protocol installed on. + @param DriverName The driver guid specified. - FvHandle - The handle which FVB protocol installed on. - DriverName - The driver guid specified. + @retval TRUE This file is found in a EFI_HOB_FIRMWARE_VOLUME2 + Hob. + @retval FALSE Not found. -Returns: - - TRUE - This file is found in a EFI_HOB_FIRMWARE_VOLUME2 Hob. - - FALSE - Not found. - - ---*/ +**/ +BOOLEAN +FvFoundInHobFv2 ( + IN EFI_HANDLE FvHandle, + IN CONST EFI_GUID *DriverName + ) { EFI_PEI_HOB_POINTERS HobFv2; @@ -826,34 +787,25 @@ Returns: } + +/** + Get the driver from the FV through driver name, and produce a FVB protocol on FvHandle. + + @param Fv The FIRMWARE_VOLUME protocol installed on the FV. + @param FvHandle The handle which FVB protocol installed on. + @param DriverName The driver guid specified. + + @retval EFI_OUT_OF_RESOURCES No enough memory or other resource. + @retval EFI_VOLUME_CORRUPTED Corrupted volume. + @retval EFI_SUCCESS Function successfully returned. + +**/ EFI_STATUS CoreProcessFvImageFile ( IN EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv, IN EFI_HANDLE FvHandle, IN EFI_GUID *DriverName ) -/*++ - -Routine Description: - - Get the driver from the FV through driver name, and produce a FVB protocol on FvHandle. - -Arguments: - - Fv - The FIRMWARE_VOLUME protocol installed on the FV. - FvHandle - The handle which FVB protocol installed on. - DriverName - The driver guid specified. - -Returns: - - EFI_OUT_OF_RESOURCES - No enough memory or other resource. - - EFI_VOLUME_CORRUPTED - Corrupted volume. - - EFI_SUCCESS - Function successfully returned. - - ---*/ { EFI_STATUS Status; EFI_SECTION_TYPE SectionType; @@ -867,21 +819,21 @@ Returns: // // Read the first (and only the first) firmware volume section // - SectionType = EFI_SECTION_FIRMWARE_VOLUME_IMAGE; - FvHeader = NULL; - FvAlignment = 0; - Buffer = NULL; - BufferSize = 0; + SectionType = EFI_SECTION_FIRMWARE_VOLUME_IMAGE; + FvHeader = NULL; + FvAlignment = 0; + Buffer = NULL; + BufferSize = 0; AlignedBuffer = NULL; Status = Fv->ReadSection ( - Fv, - DriverName, - SectionType, - 0, - &Buffer, - &BufferSize, - &AuthenticationStatus - ); + Fv, + DriverName, + SectionType, + 0, + &Buffer, + &BufferSize, + &AuthenticationStatus + ); if (!EFI_ERROR (Status)) { // // FvImage should be at its required alignment. @@ -894,8 +846,10 @@ Returns: if (FvAlignment < 8) { FvAlignment = 8; } - - AlignedBuffer = AllocateAlignedPool ((UINTN) BufferSize, (UINTN) FvAlignment); + // + // Allocate the aligned buffer for the FvImage. + // + AlignedBuffer = AllocateAlignedPages (EFI_SIZE_TO_PAGES (BufferSize), (UINTN) FvAlignment); if (AlignedBuffer == NULL) { Status = EFI_OUT_OF_RESOURCES; } else { @@ -926,50 +880,37 @@ Returns: } if (AlignedBuffer != NULL) { - FreeAlignedPool (AlignedBuffer); + FreeAlignedPages (AlignedBuffer, EFI_SIZE_TO_PAGES (BufferSize)); } } return Status; } -STATIC -VOID -EFIAPI -CoreFwVolEventProtocolNotify ( - IN EFI_EVENT Event, - IN VOID *Context - ) -/*++ - -Routine Description: - Event notification that is fired every time a FV dispatch protocol is added. +/** + Event notification that is fired every time a FV dispatch protocol is added. More than one protocol may have been added when this event is fired, so you must loop on CoreLocateHandle () to see how many protocols were added and do the following to each FV: - - If the Fv has already been processed, skip it. If the Fv has not been + If the Fv has already been processed, skip it. If the Fv has not been processed then mark it as being processed, as we are about to process it. - - Read the Fv and add any driver in the Fv to the mDiscoveredList.The + Read the Fv and add any driver in the Fv to the mDiscoveredList.The mDiscoveredList is never free'ed and contains variables that define - the other states the DXE driver transitions to.. - + the other states the DXE driver transitions to.. While you are at it read the A Priori file into memory. Place drivers in the A Priori list onto the mScheduledQueue. -Arguments: - - Event - The Event that is being processed, not used. - - Context - Event Context, not used. - -Returns: - - None + @param Event The Event that is being processed, not used. + @param Context Event Context, not used. ---*/ +**/ +VOID +EFIAPI +CoreFwVolEventProtocolNotify ( + IN EFI_EVENT Event, + IN VOID *Context + ) { EFI_STATUS Status; EFI_STATUS GetNextFileStatus; @@ -995,12 +936,12 @@ Returns: while (TRUE) { BufferSize = sizeof (EFI_HANDLE); Status = CoreLocateHandle ( - ByRegisterNotify, - NULL, - mFwVolEventRegistration, - &BufferSize, - &FvHandle - ); + ByRegisterNotify, + NULL, + mFwVolEventRegistration, + &BufferSize, + &FvHandle + ); if (EFI_ERROR (Status)) { // // If no more notification events exit @@ -1029,7 +970,6 @@ Returns: // FvIsBeingProcesssed (FvHandle); - Status = CoreHandleProtocol (FvHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv); if (EFI_ERROR (Status)) { // @@ -1072,7 +1012,7 @@ Returns: // EFI_FV_FILETYPE_DXE_CORE is processed to produce a Loaded Image protocol for the core // EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE is processed to create a Fvb // - for (Index = 0; Index < sizeof (mDxeFileTypes)/sizeof (EFI_FV_FILETYPE); Index++) { + for (Index = 0; Index < sizeof (mDxeFileTypes) / sizeof (EFI_FV_FILETYPE); Index++) { // // Initialize the search key // @@ -1182,26 +1122,16 @@ Returns: } + +/** + Initialize the dispatcher. Initialize the notification function that runs when + an FV2 protocol is added to the system. + +**/ VOID CoreInitializeDispatcher ( VOID ) -/*++ - -Routine Description: - - Initialize the dispatcher. Initialize the notification function that runs when - a FV protocol is added to the system. - -Arguments: - - NONE - -Returns: - - NONE - ---*/ { mFwVolEvent = CoreCreateProtocolNotifyEvent ( &gEfiFirmwareVolume2ProtocolGuid, @@ -1216,26 +1146,16 @@ Returns: // // Function only used in debug builds // + +/** + Traverse the discovered list for any drivers that were discovered but not loaded + because the dependency experessions evaluated to false. + +**/ VOID CoreDisplayDiscoveredNotDispatched ( VOID ) -/*++ - -Routine Description: - - Traverse the discovered list for any drivers that were discovered but not loaded - because the dependency experessions evaluated to false - -Arguments: - - NONE - -Returns: - - NONE - ---*/ { LIST_ENTRY *Link; EFI_CORE_DRIVER_ENTRY *DriverEntry; @@ -1243,7 +1163,7 @@ Returns: for (Link = mDiscoveredList.ForwardLink;Link !=&mDiscoveredList; Link = Link->ForwardLink) { DriverEntry = CR(Link, EFI_CORE_DRIVER_ENTRY, Link, EFI_CORE_DRIVER_ENTRY_SIGNATURE); if (DriverEntry->Dependent) { - DEBUG ((EFI_D_LOAD, "Driver %g was discovered but not loaded!!\n", &DriverEntry->FileName)); + DEBUG ((DEBUG_LOAD, "Driver %g was discovered but not loaded!!\n", &DriverEntry->FileName)); } } }