ArmPkg/StandaloneMmCpu: rename gGuidedEventContext to mGuidedEventContext

gGuidedEventContext is only used in EventHandle.c.
Therefore, make it STATIC, rename to mGuidedEventContext,
and remove the extern declaration.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
This commit is contained in:
Levi Yun
2025-09-15 15:46:38 +01:00
committed by mergify[bot]
parent cc883371e7
commit 1c836a89b8
2 changed files with 15 additions and 16 deletions
+15 -15
View File
@@ -39,7 +39,7 @@ MmFoundationEntryRegister (
// maintained in single global variable because StandaloneMm is UP-migratable
// (which means it cannot run concurrently)
//
EFI_MM_COMMUNICATE_HEADER *gGuidedEventContext = NULL;
STATIC EFI_MM_COMMUNICATE_HEADER *mGuidedEventContext = NULL;
STATIC CONST ARM_MM_HANDLER_CONTEXT *mMmHandlerContext = NULL;
EFI_MM_CONFIGURATION_PROTOCOL mMmConfig = {
@@ -107,16 +107,16 @@ PiMmStandaloneMmCpuDriverEntry (
Status = mMmst->MmAllocatePool (
EfiRuntimeServicesData,
CommBufferSize,
(VOID **)&gGuidedEventContext
(VOID **)&mGuidedEventContext
);
if (EFI_ERROR (Status)) {
gGuidedEventContext = NULL;
mGuidedEventContext = NULL;
DEBUG ((DEBUG_ERROR, "%a: Mem alloc failed\n", __func__));
return Status;
}
CopyMem (gGuidedEventContext, (CONST VOID *)CommBufferAddr, CommBufferSize);
CopyMem (mGuidedEventContext, (CONST VOID *)CommBufferAddr, CommBufferSize);
mMmHandlerContext = MmHandlerContext;
ZeroMem (&MmEntryPointContext, sizeof (EFI_MM_ENTRY_CONTEXT));
@@ -135,11 +135,11 @@ PiMmStandaloneMmCpuDriverEntry (
mMmEntryPoint (&MmEntryPointContext);
// Free the memory allocation done earlier and reset the per-cpu context
CopyMem ((VOID *)CommBufferAddr, (CONST VOID *)gGuidedEventContext, CommBufferSize);
CopyMem ((VOID *)CommBufferAddr, (CONST VOID *)mGuidedEventContext, CommBufferSize);
Status = mMmst->MmFreePool ((VOID *)gGuidedEventContext);
Status = mMmst->MmFreePool ((VOID *)mGuidedEventContext);
ASSERT_EFI_ERROR (Status);
gGuidedEventContext = NULL;
mGuidedEventContext = NULL;
mMmHandlerContext = NULL;
return Status;
@@ -197,16 +197,16 @@ PiMmCpuTpFwRootMmiHandler (
ASSERT (CommBuffer == NULL);
ASSERT (CommBufferSize == NULL);
if (gGuidedEventContext == NULL) {
if (mGuidedEventContext == NULL) {
return EFI_NOT_FOUND;
}
if (CompareGuid (
&gGuidedEventContext->HeaderGuid,
&mGuidedEventContext->HeaderGuid,
&gEfiMmCommunicateHeaderV3Guid
))
{
GuidedEventContextV3 = (EFI_MM_COMMUNICATE_HEADER_V3 *)gGuidedEventContext;
GuidedEventContextV3 = (EFI_MM_COMMUNICATE_HEADER_V3 *)mGuidedEventContext;
DEBUG ((
DEBUG_INFO,
"CommBuffer - 0x%x, CommBufferSize - 0x%llx, MessageSize - 0x%llx\n",
@@ -225,14 +225,14 @@ PiMmCpuTpFwRootMmiHandler (
DEBUG ((
DEBUG_INFO,
"CommBuffer - 0x%x, CommBufferSize - 0x%x\n",
gGuidedEventContext,
gGuidedEventContext->MessageLength
mGuidedEventContext,
mGuidedEventContext->MessageLength
));
Status = mMmst->MmiManage (
&gGuidedEventContext->HeaderGuid,
&mGuidedEventContext->HeaderGuid,
mMmHandlerContext,
gGuidedEventContext->Data,
(UINTN *)(&gGuidedEventContext->MessageLength)
mGuidedEventContext->Data,
(UINTN *)(&mGuidedEventContext->MessageLength)
);
}
@@ -30,7 +30,6 @@ extern EFI_MM_CPU_PROTOCOL mMmCpuState;
//
// MM event handling specific declarations
//
extern EFI_MM_COMMUNICATE_HEADER *gGuidedEventContext;
extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig;
/**