//\r
EFI_FV_FILETYPE mSmmFileTypes[] = {\r
EFI_FV_FILETYPE_SMM,\r
- EFI_FV_FILETYPE_COMBINED_SMM_DXE\r
+ EFI_FV_FILETYPE_COMBINED_SMM_DXE,\r
+ EFI_FV_FILETYPE_SMM_CORE,\r
//\r
// Note: DXE core will process the FV image file, so skip it in SMM core\r
// EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE\r
//\r
// Discover Drivers in FV and add them to the Discovered Driver List.\r
// Process EFI_FV_FILETYPE_SMM type and then EFI_FV_FILETYPE_COMBINED_SMM_DXE\r
+ // EFI_FV_FILETYPE_SMM_CORE is processed to produce a Loaded Image protocol for the core\r
//\r
for (SmmTypeIndex = 0; SmmTypeIndex < sizeof (mSmmFileTypes)/sizeof (EFI_FV_FILETYPE); SmmTypeIndex++) {\r
//\r
&Size\r
);\r
if (!EFI_ERROR (GetNextFileStatus)) {\r
- SmmAddToDriverList (Fv, FvHandle, &NameGuid);\r
+ 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
+ } else {\r
+ SmmAddToDriverList (Fv, FvHandle, &NameGuid);\r
+ }\r
}\r
} while (!EFI_ERROR (GetNextFileStatus));\r
}\r