]> git.proxmox.com Git - mirror_edk2.git/commit
ArmPkg/ArmMmuLib: drop pointless LookupAddresstoRootTable() routine
authorArd Biesheuvel <ard.biesheuvel@arm.com>
Tue, 31 Mar 2020 17:25:02 +0000 (19:25 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 2 Apr 2020 12:35:52 +0000 (12:35 +0000)
commitdb0f8c2f849e9bc0c965db0d1befb19050224d66
treedccc43e12c2f91602275382a28f20c08edca2a2f
parent49188b2aa481e76190883e73147af72128c878db
ArmPkg/ArmMmuLib: drop pointless LookupAddresstoRootTable() routine

LookupAddresstoRootTable() uses a loop to go over its MaxAddress
argument, essentially to do a log2() and determine how many bits are
needed to represent it. Since the argument is the result of a shift-left
expression, there is some room for improvement here, and we can simply
use the bit count directly to calculate the value of T0SZ. At the same
time, we can omit calling GetRootTranslationTableInfo() to determine the
number of root table entries, and add a new helper that applies the
trivial calculation directly.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c