From: Pierre Gondois <pierre.gond...@arm.com>

Add a ArmReadIdIsar0() helper function to access the AArch64
ID_ISAR0_EL1 register.

Signed-off-by: Pierre Gondois <pierre.gond...@arm.com>
---
 ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h     | 12 +++++++++++-
 ArmPkg/Library/ArmLib/AArch64/AArch64Support.S |  7 ++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h 
b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
index 330481fc50db..105a52ee16fe 100644
--- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
+++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
@@ -1,7 +1,7 @@
 /** @file
 
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-  Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
+  Portions Copyright (c) 2011 - 2022, Arm Ltd. All rights reserved.<BR>
   Copyright (c) 2020, NUVIA Inc. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -54,4 +54,14 @@ ArmReadIdAA64Mmfr2 (
   VOID
   );
 
+/** Reads the ID_ISAR0_EL1 register.
+
+   @return The contents of the ID_ISAR0_EL1 register.
+**/
+UINTN
+EFIAPI
+ArmReadIdIsar0 (
+  VOID
+  );
+
 #endif // AARCH64_LIB_H_
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S 
b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
index d3cc1e86716b..baba283d01b9 100644
--- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
+++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
@@ -1,7 +1,7 @@
 #------------------------------------------------------------------------------
 #
 # Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-# Copyright (c) 2011 - 2017, ARM Limited. All rights reserved.
+# Copyright (c) 2011 - 2022, Arm Limited. All rights reserved.
 # Copyright (c) 2016, Linaro Limited. All rights reserved.
 # Copyright (c) 2020, NUVIA Inc. All rights reserved.
 #
@@ -482,4 +482,9 @@ ASM_FUNC(ArmWriteCntHctl)
   msr   cnthctl_el2, x0
   ret
 
+// UINTN ArmReadIdIsar0(VOID)
+ASM_FUNC(ArmReadIdIsar0)
+  mrs   x0, id_aa64isar0_el1
+  ret
+
 ASM_FUNCTION_REMOVE_IF_UNREFERENCED
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93953): https://edk2.groups.io/g/devel/message/93953
Mute This Topic: https://groups.io/mt/93788881/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to