From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.15960.1656530075674516571 for ; Wed, 29 Jun 2022 12:14:35 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5398D153B; Wed, 29 Jun 2022 12:14:35 -0700 (PDT) Received: from pierre123.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 108853F792; Wed, 29 Jun 2022 12:14:32 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Rebecca Cran , Michael D Kinney , Liming Gao , Edward Pickup Subject: [PATCH RESEND v1 3/7] ArmPkg/ArmLib: Add ArmReadIdIsaR5() helper Date: Wed, 29 Jun 2022 21:13:51 +0200 Message-Id: <20220629191355.2618844-4-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220629191355.2618844-1-Pierre.Gondois@arm.com> References: <20220629191355.2618844-1-Pierre.Gondois@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pierre Gondois Add a ArmReadIdIsaR5() helper function to access the AArch32 ID_ISAR5 register. Signed-off-by: Pierre Gondois --- 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/A= rmLib/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.
-# 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 =20 +// 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 =20 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+ Copyright (c) 2022, Arm Ltd. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -66,4 +67,14 @@ ArmReadIdPfr1 ( VOID ); =20 +/** Reads the ID_ISAR5 register. + + @return The contents of the ID_ISAR5 register. +**/ +UINTN +EFIAPI +ArmReadIdIsaR5 ( + VOID + ); + #endif // ARM_V7_LIB_H_ --=20 2.25.1