[edk2-devel] [PATCH v1 3/7] ArmPkg/ArmLib: Add ArmReadIdIsaR5() helper
PierreGondois
pierre.gondois at arm.com
Wed Jun 29 15:07:09 UTC 2022
From: Pierre Gondois <Pierre.Gondois at arm.com>
Add a ArmReadIdIsaR5() helper function to access the AArch32
ID_ISAR5 register.
Signed-off-by: Pierre Gondois <pierre.gondois at arm.com>
---
ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S | 7 ++++++-
ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h | 11 +++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S b/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S
index 0856740e3290..bc2be5331c7d 100644
--- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S
+++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S
@@ -1,7 +1,7 @@
#------------------------------------------------------------------------------
#
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-# Copyright (c) 2011 - 2016, ARM Limited. All rights reserved.
+# Copyright (c) 2011 - 2022, Arm Limited. All rights reserved.
# Copyright (c) 2016, Linaro Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -167,4 +167,9 @@ ASM_FUNC (ArmGetPhysicalAddressBits)
movge r0, #40 // 40 bits if LPAE
bx lr
+// UINTN ArmReadIdIsaR5(VOID)
+ASM_FUNC(ArmReadIdIsaR5)
+ mrc p15, 0, r0, c0, c2, 5
+ bx lr
+
ASM_FUNCTION_REMOVE_IF_UNREFERENCED
diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h
index 404ff92c4e06..1cfd6e5f65ac 100644
--- a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h
+++ b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h
@@ -1,6 +1,7 @@
/** @file
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
+ Copyright (c) 2022, Arm Ltd. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -66,4 +67,14 @@ ArmReadIdPfr1 (
VOID
);
+/** Reads the ID_ISAR5 register.
+
+ @return The contents of the ID_ISAR5 register.
+**/
+UINTN
+EFIAPI
+ArmReadIdIsaR5 (
+ VOID
+ );
+
#endif // ARM_V7_LIB_H_
--
2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90881): https://edk2.groups.io/g/devel/message/90881
Mute This Topic: https://groups.io/mt/92066829/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list