StandaloneMmPkg: Produce gMmStatusCodeUseSerialHobGuid HOB
Produce gMmStatusCodeUseSerialHobGuid as MM Foundation HOB to describe the status code use serial port or not. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include <Guid/MmCpuSyncConfig.h>
|
#include <Guid/MmCpuSyncConfig.h>
|
||||||
#include <Guid/MmProfileData.h>
|
#include <Guid/MmProfileData.h>
|
||||||
#include <Guid/MmUnblockRegion.h>
|
#include <Guid/MmUnblockRegion.h>
|
||||||
|
#include <Guid/MmStatusCodeUseSerial.h>
|
||||||
#include <Register/Intel/Cpuid.h>
|
#include <Register/Intel/Cpuid.h>
|
||||||
#include <Register/Intel/ArchitecturalMsr.h>
|
#include <Register/Intel/ArchitecturalMsr.h>
|
||||||
|
|
||||||
@@ -207,6 +208,43 @@ MmIplBuildMmCpuSyncConfigHob (
|
|||||||
*HobBufferSize = HobLength;
|
*HobBufferSize = HobLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
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
|
Copies a data buffer to a newly-built HOB for GUID HOB
|
||||||
|
|
||||||
@@ -957,6 +995,13 @@ CreateMmFoundationHobList (
|
|||||||
MmIplBuildMmCpuSyncConfigHob (FoundationHobList + UsedSize, &HobLength);
|
MmIplBuildMmCpuSyncConfigHob (FoundationHobList + UsedSize, &HobLength);
|
||||||
UsedSize += HobLength;
|
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
|
// Build CPU SMM base HOB in MM HOB list
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
gMmCpuSyncConfigHobGuid
|
gMmCpuSyncConfigHobGuid
|
||||||
gMmProfileDataHobGuid
|
gMmProfileDataHobGuid
|
||||||
gMmUnblockRegionHobGuid
|
gMmUnblockRegionHobGuid
|
||||||
|
gMmStatusCodeUseSerialHobGuid
|
||||||
|
|
||||||
[Ppis]
|
[Ppis]
|
||||||
gEfiPeiMmControlPpiGuid
|
gEfiPeiMmControlPpiGuid
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMmCommBufferPages
|
gEfiMdeModulePkgTokenSpaceGuid.PcdMmCommBufferPages
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable ## CONSUMES
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial ## CONSUMES
|
||||||
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode ## CONSUMES
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode ## CONSUMES
|
||||||
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout ## CONSUMES
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout ## CONSUMES
|
||||||
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout2 ## CONSUMES
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout2 ## CONSUMES
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
* Single GUIDed (gMmAcpiS3EnableHobGuid) HOB to describe the ACPI S3 enable status.
|
* Single GUIDed (gMmAcpiS3EnableHobGuid) HOB to describe the ACPI S3 enable status.
|
||||||
* Single GUIDed (gEfiAcpiVariableGuid) HOB to identify the S3 data root region in x86.
|
* Single GUIDed (gEfiAcpiVariableGuid) HOB to identify the S3 data root region in x86.
|
||||||
* Single GUIDed (gMmProfileDataHobGuid) HOB to describe the MM profile data region.
|
* Single GUIDed (gMmProfileDataHobGuid) HOB to describe the MM profile data region.
|
||||||
|
* Single GUIDed (gMmStatusCodeUseSerialHobGuid) HOB to describe the status code use serial port.
|
||||||
|
|
||||||
@param[in] Buffer The free buffer to be used for HOB creation.
|
@param[in] Buffer The free buffer to be used for HOB creation.
|
||||||
@param[in, out] BufferSize The buffer size.
|
@param[in, out] BufferSize The buffer size.
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
* Single GUIDed (gMmAcpiS3EnableHobGuid) HOB to describe the ACPI S3 enable status.
|
* Single GUIDed (gMmAcpiS3EnableHobGuid) HOB to describe the ACPI S3 enable status.
|
||||||
* Single GUIDed (gEfiAcpiVariableGuid) HOB to identify the S3 data root region in x86.
|
* Single GUIDed (gEfiAcpiVariableGuid) HOB to identify the S3 data root region in x86.
|
||||||
* Single GUIDed (gMmProfileDataHobGuid) HOB to describe the MM profile data region.
|
* Single GUIDed (gMmProfileDataHobGuid) HOB to describe the MM profile data region.
|
||||||
|
* Single GUIDed (gMmStatusCodeUseSerialHobGuid) HOB to describe the status code use serial port.
|
||||||
|
|
||||||
@param[in] Buffer The free buffer to be used for HOB creation.
|
@param[in] Buffer The free buffer to be used for HOB creation.
|
||||||
@param[in, out] BufferSize The buffer size.
|
@param[in, out] BufferSize The buffer size.
|
||||||
|
|||||||
Reference in New Issue
Block a user