]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
PI 1.1 SMM Feature Check-in
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Dispatcher / Dispatcher.c
index 0936fad997793ea15a221bf82bc0df3ad4080abd..6a18fe909e6d3e81ea322fad12754c017dd3ee67 100644 (file)
@@ -442,6 +442,7 @@ CoreDispatcher (
       // skip the LoadImage\r
       //\r
       if (DriverEntry->ImageHandle == NULL) {\r
+        DEBUG ((DEBUG_INFO, "Loading driver %g\n", &DriverEntry->FileName));\r
         Status = CoreLoadImage (\r
                         FALSE,\r
                         gDxeCoreImageHandle,\r
@@ -691,9 +692,7 @@ CoreFvToDevicePath (
     // Build a device path to the file in the FV to pass into gBS->LoadImage\r
     //\r
     EfiInitializeFwVolDevicepathNode (&mFvDevicePath.File, DriverName);\r
-    mFvDevicePath.End.Type = EFI_END_ENTIRE_DEVICE_PATH;\r
-    mFvDevicePath.End.SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;\r
-    SetDevicePathNodeLength (&mFvDevicePath.End, sizeof (EFI_DEVICE_PATH_PROTOCOL));\r
+    SetDevicePathEndNode (&mFvDevicePath.End);\r
 \r
     FileNameDevicePath = AppendDevicePath (\r
                             FvDevicePath,\r
@@ -846,9 +845,12 @@ CoreProcessFvImageFile (
     // FvImage should be at its required alignment.\r
     //\r
     FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) Buffer;\r
+    //\r
+    // Get FvHeader alignment\r
+    //\r
     FvAlignment = 1 << ((FvHeader->Attributes & EFI_FVB2_ALIGNMENT) >> 16);\r
     //\r
-    // FvAlignment must be more than 8 bytes required by FvHeader structure.\r
+    // FvAlignment must be greater than or equal to 8 bytes of the minimum FFS alignment value. \r
     //\r
     if (FvAlignment < 8) {\r
       FvAlignment = 8;\r
@@ -963,15 +965,6 @@ CoreFwVolEventProtocolNotify (
       continue;\r
     }\r
 \r
-    Status = CoreHandleProtocol (FvHandle, &gEfiFirmwareVolumeDispatchProtocolGuid, (VOID **)&Fv);\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // If no dispatch protocol then skip, but do not marked as being processed as it\r
-      // may show up later.\r
-      //\r
-      continue;\r
-    }\r
-\r
     //\r
     // Since we are about to process this Fv mark it as processed.\r
     //\r
@@ -1046,9 +1039,7 @@ CoreFwVolEventProtocolNotify (
                 // be initialized completely.\r
                 //\r
                 EfiInitializeFwVolDevicepathNode (&mFvDevicePath.File, &NameGuid);\r
-                mFvDevicePath.End.Type = EFI_END_ENTIRE_DEVICE_PATH;\r
-                mFvDevicePath.End.SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;\r
-                SetDevicePathNodeLength (&mFvDevicePath.End, sizeof (EFI_DEVICE_PATH_PROTOCOL));\r
+                SetDevicePathEndNode (&mFvDevicePath.End);\r
 \r
                 gDxeCoreLoadedImage->FilePath = DuplicateDevicePath (\r
                                                   (EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath\r
@@ -1140,13 +1131,12 @@ CoreInitializeDispatcher (
   VOID\r
   )\r
 {\r
-  mFwVolEvent = CoreCreateProtocolNotifyEvent (\r
+  mFwVolEvent = EfiCreateProtocolNotifyEvent (\r
                   &gEfiFirmwareVolume2ProtocolGuid,\r
                   TPL_CALLBACK,\r
                   CoreFwVolEventProtocolNotify,\r
                   NULL,\r
-                  &mFwVolEventRegistration,\r
-                  TRUE\r
+                  &mFwVolEventRegistration\r
                   );\r
 }\r
 \r