mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 16:44:10 +02:00
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>
This commit is contained in:
parent
db0f8c2f84
commit
991c5d89ba
@ -70,21 +70,13 @@ GetRootTableEntryCount (
|
|||||||
return TT_ENTRY_COUNT >> (T0SZ - MIN_T0SZ) % BITS_PER_LEVEL;
|
return TT_ENTRY_COUNT >> (T0SZ - MIN_T0SZ) % BITS_PER_LEVEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
STATIC
|
||||||
GetRootTranslationTableInfo (
|
UINTN
|
||||||
IN UINTN T0SZ,
|
GetRootTableLevel (
|
||||||
OUT UINTN *TableLevel,
|
IN UINTN T0SZ
|
||||||
OUT UINTN *TableEntryCount
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Get the level of the root table
|
return (T0SZ - MIN_T0SZ) / BITS_PER_LEVEL;
|
||||||
if (TableLevel) {
|
|
||||||
*TableLevel = (T0SZ - MIN_T0SZ) / BITS_PER_LEVEL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TableEntryCount) {
|
|
||||||
*TableEntryCount = 1UL << (BITS_PER_LEVEL - (T0SZ - MIN_T0SZ) % BITS_PER_LEVEL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC
|
STATIC
|
||||||
@ -303,7 +295,6 @@ UpdateRegionMapping (
|
|||||||
IN UINT64 AttributeClearMask
|
IN UINT64 AttributeClearMask
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINTN RootTableLevel;
|
|
||||||
UINTN T0SZ;
|
UINTN T0SZ;
|
||||||
|
|
||||||
if (((RegionStart | RegionLength) & EFI_PAGE_MASK)) {
|
if (((RegionStart | RegionLength) & EFI_PAGE_MASK)) {
|
||||||
@ -311,11 +302,10 @@ UpdateRegionMapping (
|
|||||||
}
|
}
|
||||||
|
|
||||||
T0SZ = ArmGetTCR () & TCR_T0SZ_MASK;
|
T0SZ = ArmGetTCR () & TCR_T0SZ_MASK;
|
||||||
GetRootTranslationTableInfo (T0SZ, &RootTableLevel, NULL);
|
|
||||||
|
|
||||||
return UpdateRegionMappingRecursive (RegionStart, RegionStart + RegionLength,
|
return UpdateRegionMappingRecursive (RegionStart, RegionStart + RegionLength,
|
||||||
AttributeSetMask, AttributeClearMask, ArmGetTTBR0BaseAddress (),
|
AttributeSetMask, AttributeClearMask, ArmGetTTBR0BaseAddress (),
|
||||||
RootTableLevel);
|
GetRootTableLevel (T0SZ));
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC
|
STATIC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user