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.web08.12643.1656515057760223802 for ; Wed, 29 Jun 2022 08:04:17 -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 9CFDE152B; Wed, 29 Jun 2022 08:04:17 -0700 (PDT) Received: from pierre123.arm.com (unknown [10.57.42.208]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 42CC63F792; Wed, 29 Jun 2022 08:04:15 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Rebecca Cran , Michael D Kinney , Liming Gao , Jiewen Yao , Jian J Wang Subject: [PATCH v3 10/22] ArmPkg/ArmLib: Add ArmReadIdIsar0() helper Date: Wed, 29 Jun 2022 17:02:19 +0200 Message-Id: <20220629150241.2597898-11-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220629150241.2597898-1-Pierre.Gondois@arm.com> References: <20220629150241.2597898-1-Pierre.Gondois@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pierre Gondois Add a ArmReadIdIsar0() helper function to access the AArch64 ID_ISAR0_EL1 register. Signed-off-by: Pierre Gondois --- 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 =20 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
+ Portions Copyright (c) 2011 - 2022, Arm Ltd. All rights reserved.
Copyright (c) 2020, NUVIA Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent @@ -54,4 +54,14 @@ ArmReadIdAA64Mmfr2 ( VOID ); =20 +/** 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/Libr= ary/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.
-# 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 =20 +// UINTN ArmReadIdIsar0(VOID) +ASM_FUNC(ArmReadIdIsar0) + mrs x0, id_aa64isar0_el1 + ret + ASM_FUNCTION_REMOVE_IF_UNREFERENCED --=20 2.25.1