summaryrefslogtreecommitdiffstats
path: root/ArmPkg
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-11-18 15:58:46 +0000
committerabiesheuvel <abiesheuvel@Edk2>2015-11-18 15:58:46 +0000
commit2ea66ed9f9ea18cbe2681baaad29ce47ea9918a1 (patch)
tree98cf8d66c3bf5f796bbbaebb23866fce7187f0de /ArmPkg
parent63dbd629649a4c5ccf83243e9482a4e0d092b422 (diff)
downloadedk2-2ea66ed9f9ea18cbe2681baaad29ce47ea9918a1.tar.gz
edk2-2ea66ed9f9ea18cbe2681baaad29ce47ea9918a1.tar.bz2
edk2-2ea66ed9f9ea18cbe2681baaad29ce47ea9918a1.zip
ArmPkg/ArmV7Lib: add function to test for presence of MP extensions
Some MMU manipulation is dependent on the presence of the multiprocessing extensions. So add a function that returns this information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18895 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Library/ArmLib/ArmV7/ArmLibSupportV7.S7
-rw-r--r--ArmPkg/Library/ArmLib/ArmV7/ArmLibSupportV7.asm7
-rw-r--r--ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.h6
3 files changed, 20 insertions, 0 deletions
diff --git a/ArmPkg/Library/ArmLib/ArmV7/ArmLibSupportV7.S b/ArmPkg/Library/ArmLib/ArmV7/ArmLibSupportV7.S
index b94239f785..d9e3c86b69 100644
--- a/ArmPkg/Library/ArmLib/ArmV7/ArmLibSupportV7.S
+++ b/ArmPkg/Library/ArmLib/ArmV7/ArmLibSupportV7.S
@@ -19,6 +19,7 @@
.align 2
GCC_ASM_EXPORT(ArmIsMpCore)
+GCC_ASM_EXPORT(ArmHasMpExtensions)
GCC_ASM_EXPORT(ArmEnableAsynchronousAbort)
GCC_ASM_EXPORT(ArmDisableAsynchronousAbort)
GCC_ASM_EXPORT(ArmEnableIrq)
@@ -44,6 +45,12 @@ ASM_PFX(ArmIsMpCore):
movne R0, #0
bx LR
+ASM_PFX(ArmHasMpExtensions):
+ mrc p15,0,R0,c0,c0,5
+ // Get Multiprocessing extension (bit31)
+ lsr R0, R0, #31
+ bx LR
+
ASM_PFX(ArmEnableAsynchronousAbort):
cpsie a
isb
diff --git a/ArmPkg/Library/ArmLib/ArmV7/ArmLibSupportV7.asm b/ArmPkg/Library/ArmLib/ArmV7/ArmLibSupportV7.asm
index 82daa3ce16..8179232253 100644
--- a/ArmPkg/Library/ArmLib/ArmV7/ArmLibSupportV7.asm
+++ b/ArmPkg/Library/ArmLib/ArmV7/ArmLibSupportV7.asm
@@ -15,6 +15,7 @@
EXPORT ArmIsMpCore
+ EXPORT ArmHasMpExtensions
EXPORT ArmEnableAsynchronousAbort
EXPORT ArmDisableAsynchronousAbort
EXPORT ArmEnableIrq
@@ -43,6 +44,12 @@ ArmIsMpCore
movne R0, #0
bx LR
+ArmHasMpExtensions
+ mrc p15,0,R0,c0,c0,5
+ // Get Multiprocessing extension (bit31)
+ lsr R0, R0, #31
+ bx LR
+
ArmEnableAsynchronousAbort
cpsie a
isb
diff --git a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.h b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.h
index df770cf7d7..e138613ca5 100644
--- a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.h
+++ b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.h
@@ -28,5 +28,11 @@ ArmReadIdMmfr0 (
VOID
);
+BOOLEAN
+EFIAPI
+ArmHasMpExtensions (
+ VOID
+ );
+
#endif // __ARM_V7_LIB_H__