+ if (Type == EFI_FV_FILETYPE_SMM_CORE) {\r
+ //\r
+ // If this is the SMM core fill in it's DevicePath & DeviceHandle\r
+ //\r
+ if (mSmmCoreLoadedImage->FilePath == NULL) {\r
+ //\r
+ // Maybe one special FV contains only one SMM_CORE module, so its device path must\r
+ // be initialized completely.\r
+ //\r
+ EfiInitializeFwVolDevicepathNode (&mFvDevicePath.File, &NameGuid);\r
+ SetDevicePathEndNode (&mFvDevicePath.End);\r
+\r
+ //\r
+ // Make an EfiBootServicesData buffer copy of FilePath\r
+ //\r
+ Status = gBS->AllocatePool (\r
+ EfiBootServicesData,\r
+ GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath),\r
+ (VOID **)&mSmmCoreLoadedImage->FilePath\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+ CopyMem (mSmmCoreLoadedImage->FilePath, &mFvDevicePath, GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath));\r
+\r
+ mSmmCoreLoadedImage->DeviceHandle = FvHandle;\r
+ }\r
+ if (mSmmCoreDriverEntry->SmmLoadedImage.FilePath == NULL) {\r
+ //\r
+ // Maybe one special FV contains only one SMM_CORE module, so its device path must\r
+ // be initialized completely.\r
+ //\r
+ EfiInitializeFwVolDevicepathNode (&mFvDevicePath.File, &NameGuid);\r
+ SetDevicePathEndNode (&mFvDevicePath.End);\r
+\r
+ //\r
+ // Make a buffer copy FilePath\r
+ //\r
+ Status = SmmAllocatePool (\r
+ EfiRuntimeServicesData,\r
+ GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath),\r
+ (VOID **)&mSmmCoreDriverEntry->SmmLoadedImage.FilePath\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+ CopyMem (mSmmCoreDriverEntry->SmmLoadedImage.FilePath, &mFvDevicePath, GetDevicePathSize((EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath));\r
+\r
+ mSmmCoreDriverEntry->SmmLoadedImage.DeviceHandle = FvHandle;\r
+ }\r
+ } else {\r
+ SmmAddToDriverList (Fv, FvHandle, &NameGuid);\r
+ }\r