summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4deef2d)
Before getting rid of GetRootTranslationTableInfo() and the related
LookupAddresstoRootTable() in AARCH64's version of ArmMmuLib, add a
version of the former to CpuDxe, which will be its only remaining
user. While at it, simplify it a bit, since in the CpuDxe cases,
both OUT arguments are always provided.
Note that this removes the declaration of GetRootTranslationTableInfo()
as well, but this is a declaration that is private to CpuDxe, and it
really doesn't belong here in the first place. Since ArmMmuLib's version
of GetRootTranslationTableInfo() is going to be replaced shortly anyway,
don't bother moving this .h declaration elsewhere.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
\r
#define TT_ATTR_INDX_INVALID ((UINT32)~0)\r
\r
\r
#define TT_ATTR_INDX_INVALID ((UINT32)~0)\r
\r
+#define MIN_T0SZ 16\r
+#define BITS_PER_LEVEL 9\r
+\r
+STATIC\r
+VOID\r
+GetRootTranslationTableInfo (\r
+ IN UINTN T0SZ,\r
+ OUT UINTN *RootTableLevel,\r
+ OUT UINTN *RootTableEntryCount\r
+ )\r
+{\r
+ *RootTableLevel = (T0SZ - MIN_T0SZ) / BITS_PER_LEVEL;\r
+ *RootTableEntryCount = TT_ENTRY_COUNT >> (T0SZ - MIN_T0SZ) % BITS_PER_LEVEL;\r
+}\r
+\r
STATIC\r
UINT64\r
GetFirstPageAttribute (\r
STATIC\r
UINT64\r
GetFirstPageAttribute (\r
OUT UINTN *RegionAttributes\r
);\r
\r
OUT UINTN *RegionAttributes\r
);\r
\r
-VOID\r
-GetRootTranslationTableInfo (\r
- IN UINTN T0SZ,\r
- OUT UINTN *TableLevel,\r
- OUT UINTN *TableEntryCount\r
- );\r
-\r
EFI_STATUS\r
SetGcdMemorySpaceAttributes (\r
IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap,\r
EFI_STATUS\r
SetGcdMemorySpaceAttributes (\r
IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap,\r