//\r
// List of file types supported by dispatcher\r
//\r
-STATIC EFI_FV_FILETYPE mDxeFileTypes[] = { \r
+EFI_FV_FILETYPE mDxeFileTypes[] = { \r
EFI_FV_FILETYPE_DRIVER, \r
EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER, \r
EFI_FV_FILETYPE_DXE_CORE,\r
);\r
\r
/**\r
- Convert FvHandle and DriverName into an EFI device path\r
+ Convert FvHandle and DriverName into an EFI device path.\r
\r
@param Fv Fv protocol, needed to read Depex info out of \r
FLASH. \r
\r
\r
/**\r
- Convert a driver from the Untrused back to the Scheduled state\r
+ Convert a driver from the Untrused back to the Scheduled state.\r
\r
@param FirmwareVolumeHandle The handle of the Firmware Volume that contains \r
the firmware file specified by DriverName. \r
will be called, and when the Bds() exits the Dispatcher will be called\r
again.\r
\r
- NONE\r
-\r
@retval EFI_ALREADY_STARTED The DXE Dispatcher is already running \r
@retval EFI_NOT_FOUND No DXE Drivers were dispatched \r
@retval EFI_SUCCESS One or more DXE Drivers were dispatched \r
@param FvHandle The handle of a FV that's being tested \r
\r
@retval TRUE Fv protocol on FvHandle has been processed \r
- @retval FALSE Fv protocol on FvHandle has not yet been \r
- processed\r
+ @retval FALSE Fv protocol on FvHandle has not yet been processed\r
\r
**/\r
BOOLEAN\r
\r
\r
\r
-\r
/**\r
Add an entry to the mDiscoveredList. Allocate memory to store the DriverEntry,\r
and initilize any state variables. Read the Depex from the FV and store it\r
ASSERT (DriverEntry != NULL);\r
\r
DriverEntry->Signature = EFI_CORE_DRIVER_ENTRY_SIGNATURE;\r
- CopyMem (&DriverEntry->FileName, DriverName, sizeof (EFI_GUID));\r
+ CopyGuid (&DriverEntry->FileName, DriverName);\r
DriverEntry->FvHandle = FvHandle;\r
DriverEntry->Fv = Fv;\r
DriverEntry->FvFileDevicePath = CoreFvToDevicePath (Fv, FvHandle, DriverName);\r
//\r
// Read the first (and only the first) firmware volume section\r
//\r
- SectionType = EFI_SECTION_FIRMWARE_VOLUME_IMAGE;\r
- FvHeader = NULL;\r
- FvAlignment = 0;\r
- Buffer = NULL;\r
- BufferSize = 0;\r
+ SectionType = EFI_SECTION_FIRMWARE_VOLUME_IMAGE;\r
+ FvHeader = NULL;\r
+ FvAlignment = 0;\r
+ Buffer = NULL;\r
+ BufferSize = 0;\r
AlignedBuffer = NULL;\r
Status = Fv->ReadSection (\r
- Fv, \r
- DriverName, \r
- SectionType, \r
- 0, \r
- &Buffer, \r
- &BufferSize,\r
- &AuthenticationStatus\r
- );\r
+ Fv, \r
+ DriverName, \r
+ SectionType, \r
+ 0, \r
+ &Buffer, \r
+ &BufferSize,\r
+ &AuthenticationStatus\r
+ );\r
if (!EFI_ERROR (Status)) {\r
//\r
// FvImage should be at its required alignment.\r
if (FvAlignment < 8) {\r
FvAlignment = 8;\r
}\r
+ //\r
+ // Allocate the aligned buffer for the FvImage.\r
+ //\r
AlignedBuffer = AllocateAlignedPages (EFI_SIZE_TO_PAGES (BufferSize), (UINTN) FvAlignment);\r
if (AlignedBuffer == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
while (TRUE) {\r
BufferSize = sizeof (EFI_HANDLE);\r
Status = CoreLocateHandle (\r
- ByRegisterNotify,\r
- NULL,\r
- mFwVolEventRegistration,\r
- &BufferSize,\r
- &FvHandle\r
- );\r
+ ByRegisterNotify,\r
+ NULL,\r
+ mFwVolEventRegistration,\r
+ &BufferSize,\r
+ &FvHandle\r
+ );\r
if (EFI_ERROR (Status)) {\r
//\r
// If no more notification events exit\r
//\r
FvIsBeingProcesssed (FvHandle);\r
\r
-\r
Status = CoreHandleProtocol (FvHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&Fv);\r
if (EFI_ERROR (Status)) {\r
//\r
// EFI_FV_FILETYPE_DXE_CORE is processed to produce a Loaded Image protocol for the core\r
// EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE is processed to create a Fvb\r
//\r
- for (Index = 0; Index < sizeof (mDxeFileTypes)/sizeof (EFI_FV_FILETYPE); Index++) {\r
+ for (Index = 0; Index < sizeof (mDxeFileTypes) / sizeof (EFI_FV_FILETYPE); Index++) {\r
//\r
// Initialize the search key\r
//\r
\r
/**\r
Initialize the dispatcher. Initialize the notification function that runs when\r
- a FV protocol is added to the system.\r
+ an FV2 protocol is added to the system.\r
\r
**/\r
VOID\r