summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@arm.com>2020-03-31 19:25:06 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-04-02 12:35:52 +0000
commit991c5d89ba245f623c61fe5568d29cb3c7f6bb11 (patch)
tree69a237f5d00cc237cc7cf5289953f09238ce8285 /ArmPkg/Library
parentdb0f8c2f849e9bc0c965db0d1befb19050224d66 (diff)
downloadedk2-991c5d89ba245f623c61fe5568d29cb3c7f6bb11.tar.gz
edk2-991c5d89ba245f623c61fe5568d29cb3c7f6bb11.tar.bz2
edk2-991c5d89ba245f623c61fe5568d29cb3c7f6bb11.zip
ArmPkg/ArmMmuLib: get rid of GetRootTranslationTableInfo()
Only a single call to GetRootTranslationTableInfo() remains, which only provides the root table level. So let's create a new static helper function that returns just this value, and use it instead. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Diffstat (limited to 'ArmPkg/Library')
-rw-r--r--ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
index b6f3ef54aa..a82596d290 100644
--- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
+++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
@@ -70,21 +70,13 @@ GetRootTableEntryCount (
return TT_ENTRY_COUNT >> (T0SZ - MIN_T0SZ) % BITS_PER_LEVEL;
}
-VOID
-GetRootTranslationTableInfo (
- IN UINTN T0SZ,
- OUT UINTN *TableLevel,
- OUT UINTN *TableEntryCount
+STATIC
+UINTN
+GetRootTableLevel (
+ IN UINTN T0SZ
)
{
- // Get the level of the root table
- if (TableLevel) {
- *TableLevel = (T0SZ - MIN_T0SZ) / BITS_PER_LEVEL;
- }
-
- if (TableEntryCount) {
- *TableEntryCount = 1UL << (BITS_PER_LEVEL - (T0SZ - MIN_T0SZ) % BITS_PER_LEVEL);
- }
+ return (T0SZ - MIN_T0SZ) / BITS_PER_LEVEL;
}
STATIC
@@ -303,7 +295,6 @@ UpdateRegionMapping (
IN UINT64 AttributeClearMask
)
{
- UINTN RootTableLevel;
UINTN T0SZ;
if (((RegionStart | RegionLength) & EFI_PAGE_MASK)) {
@@ -311,11 +302,10 @@ UpdateRegionMapping (
}
T0SZ = ArmGetTCR () & TCR_T0SZ_MASK;
- GetRootTranslationTableInfo (T0SZ, &RootTableLevel, NULL);
return UpdateRegionMappingRecursive (RegionStart, RegionStart + RegionLength,
AttributeSetMask, AttributeClearMask, ArmGetTTBR0BaseAddress (),
- RootTableLevel);
+ GetRootTableLevel (T0SZ));
}
STATIC