Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StandaloneMmPkg StandaloneMmCoreMemoryAllocationLib: Rename gMmst #10674

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @file
Support routines for memory allocation routines based on Standalone MM Core internal functions.

Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2025, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2016 - 2021, ARM Limited. All rights reserved.<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent
Expand All @@ -17,7 +17,7 @@
#include <Library/HobLib.h>
#include "StandaloneMmCoreMemoryAllocationServices.h"

EFI_MM_SYSTEM_TABLE *gMmst = NULL;
EFI_MM_SYSTEM_TABLE *mMemoryAllocationMmst = NULL;

/**
Allocates one or more 4KB pages of a certain memory type.
Expand Down Expand Up @@ -45,7 +45,7 @@ InternalAllocatePages (
return NULL;
}

Status = gMmst->MmAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory);
Status = mMemoryAllocationMmst->MmAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory);
if (EFI_ERROR (Status)) {
return NULL;
}
Expand Down Expand Up @@ -146,7 +146,7 @@ FreePages (
EFI_STATUS Status;

ASSERT (Pages != 0);
Status = gMmst->MmFreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Buffer, Pages);
Status = mMemoryAllocationMmst->MmFreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Buffer, Pages);
ASSERT_EFI_ERROR (Status);
}

Expand Down Expand Up @@ -202,7 +202,7 @@ InternalAllocateAlignedPages (
//
ASSERT (RealPages > Pages);

Status = gMmst->MmAllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory);
Status = mMemoryAllocationMmst->MmAllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory);
if (EFI_ERROR (Status)) {
return NULL;
}
Expand All @@ -213,7 +213,7 @@ InternalAllocateAlignedPages (
//
// Free first unaligned page(s).
//
Status = gMmst->MmFreePages (Memory, UnalignedPages);
Status = mMemoryAllocationMmst->MmFreePages (Memory, UnalignedPages);
ASSERT_EFI_ERROR (Status);
}

Expand All @@ -223,14 +223,14 @@ InternalAllocateAlignedPages (
//
// Free last unaligned page(s).
//
Status = gMmst->MmFreePages (Memory, UnalignedPages);
Status = mMemoryAllocationMmst->MmFreePages (Memory, UnalignedPages);
ASSERT_EFI_ERROR (Status);
}
} else {
//
// Do not over-allocate pages in this case.
//
Status = gMmst->MmAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory);
Status = mMemoryAllocationMmst->MmAllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory);
if (EFI_ERROR (Status)) {
return NULL;
}
Expand Down Expand Up @@ -352,7 +352,7 @@ FreeAlignedPages (
EFI_STATUS Status;

ASSERT (Pages != 0);
Status = gMmst->MmFreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Buffer, Pages);
Status = mMemoryAllocationMmst->MmFreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Buffer, Pages);
ASSERT_EFI_ERROR (Status);
}

Expand Down Expand Up @@ -380,7 +380,7 @@ InternalAllocatePool (

Memory = NULL;

Status = gMmst->MmAllocatePool (MemoryType, AllocationSize, &Memory);
Status = mMemoryAllocationMmst->MmAllocatePool (MemoryType, AllocationSize, &Memory);
if (EFI_ERROR (Status)) {
Memory = NULL;
}
Expand Down Expand Up @@ -824,7 +824,7 @@ FreePool (
{
EFI_STATUS Status;

Status = gMmst->MmFreePool (Buffer);
Status = mMemoryAllocationMmst->MmFreePool (Buffer);
ASSERT_EFI_ERROR (Status);
}

Expand Down Expand Up @@ -902,6 +902,6 @@ MemoryAllocationLibConstructor (
MmInitializeMemoryServices ((UINTN)MmramRangeCount, (VOID *)(UINTN)MmramRanges);

// Initialize MM Services Table
gMmst = MmSystemTable;
mMemoryAllocationMmst = MmSystemTable;
return EFI_SUCCESS;
}
Loading