diff options
Diffstat (limited to 'StandaloneMmPkg/Drivers/StandaloneMmIplPei/MmFoundationHob.c')
-rw-r--r-- | StandaloneMmPkg/Drivers/StandaloneMmIplPei/MmFoundationHob.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmIplPei/MmFoundationHob.c b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/MmFoundationHob.c index 2f02920..96e0416 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmIplPei/MmFoundationHob.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/MmFoundationHob.c @@ -13,6 +13,7 @@ #include <Guid/MmCpuSyncConfig.h>
#include <Guid/MmProfileData.h>
#include <Guid/MmUnblockRegion.h>
+#include <Guid/MmStatusCodeUseSerial.h>
#include <Register/Intel/Cpuid.h>
#include <Register/Intel/ArchitecturalMsr.h>
@@ -208,6 +209,43 @@ MmIplBuildMmCpuSyncConfigHob ( }
/**
+ Builds MM Status Code Use Serial HOB.
+
+ This function builds MM Status Code Use Serial HOB.
+ It can only be invoked during PEI phase;
+ If new HOB buffer is NULL, then ASSERT().
+
+ @param[in] Hob The pointer of new HOB buffer.
+ @param[in, out] HobBufferSize The available size of the HOB buffer when as input.
+ The used size of when as output.
+
+**/
+VOID
+MmIplBuildMmStatusCodeUseSerialHob (
+ IN UINT8 *Hob,
+ IN OUT UINTN *HobBufferSize
+ )
+{
+ EFI_HOB_GUID_TYPE *GuidHob;
+ MM_STATUS_CODE_USE_SERIAL *MmStatusCodeUseSerial;
+ UINT16 HobLength;
+
+ HobLength = ALIGN_VALUE (sizeof (EFI_HOB_GUID_TYPE) + sizeof (MM_STATUS_CODE_USE_SERIAL), 8);
+ if (*HobBufferSize >= HobLength) {
+ ASSERT (Hob != NULL);
+ MmIplCreateHob (Hob, EFI_HOB_TYPE_GUID_EXTENSION, HobLength);
+
+ GuidHob = (EFI_HOB_GUID_TYPE *)Hob;
+ CopyGuid (&GuidHob->Name, &gMmStatusCodeUseSerialHobGuid);
+
+ MmStatusCodeUseSerial = (MM_STATUS_CODE_USE_SERIAL *)(GuidHob + 1);
+ MmStatusCodeUseSerial->StatusCodeUseSerial = PcdGetBool (PcdStatusCodeUseSerial);
+ }
+
+ *HobBufferSize = HobLength;
+}
+
+/**
Copies a data buffer to a newly-built HOB for GUID HOB
This function builds a customized HOB tagged with a GUID for identification, copies the
@@ -958,6 +996,13 @@ CreateMmFoundationHobList ( UsedSize += HobLength;
//
+ // Build MM Status Code Use Serial HOB
+ //
+ HobLength = GetRemainingHobSize (*FoundationHobSize, UsedSize);
+ MmIplBuildMmStatusCodeUseSerialHob (FoundationHobList + UsedSize, &HobLength);
+ UsedSize += HobLength;
+
+ //
// Build CPU SMM base HOB in MM HOB list
//
HobLength = GetRemainingHobSize (*FoundationHobSize, UsedSize);
|