summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm')
-rw-r--r--ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm8
1 files changed, 8 insertions, 0 deletions
diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm b/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm
index 219140c22b..3eb5287597 100644
--- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm
+++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm
@@ -169,4 +169,12 @@
isb
bx lr
+ RVCT_ASM_EXPORT ArmGetPhysicalAddressBits
+ mrc p15, 0, r0, c0, c1, 4 ; MMFR0
+ and r0, r0, #0xf ; VMSA [3:0]
+ cmp r0, #5 ; >= 5 implies LPAE support
+ movlt r0, #32 ; 32 bits if no LPAE
+ movge r0, #40 ; 40 bits if LPAE
+ bx lr
+
END