From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4F34721A16EDA for ; Tue, 16 May 2017 03:11:00 -0700 (PDT) Received: from E111747.Emea.Arm.com (e111747.emea.arm.com [10.1.29.116]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id v4GAAovx015526; Tue, 16 May 2017 11:10:53 +0100 From: evan.lloyd@arm.com To: edk2-devel@ml01.01.org Cc: Ard Biesheuvel , Leif Lindholm , Ryan Harkin , Matteo Carlini Date: Tue, 16 May 2017 11:10:44 +0100 Message-Id: <20170516101045.14288-2-evan.lloyd@arm.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170516101045.14288-1-evan.lloyd@arm.com> References: <20170516101045.14288-1-evan.lloyd@arm.com> Subject: [PATCH 1/2] ArmPkg: Add CNTHCTL_EL2 support functions X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 May 2017 10:11:00 -0000 From: Sami Mujawar Added helper functions for reading and writing the CNTHCTL_EL2 register. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sami Mujawar Signed-off-by: Evan Lloyd --- ArmPkg/Include/Chipset/AArch64.h | 12 +++++++++++- ArmPkg/Library/ArmLib/AArch64/AArch64Support.S | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ArmPkg/Include/Chipset/AArch64.h b/ArmPkg/Include/Chipset/AArch64.h index cebfc5da426a44bb97505ed9c1da3b2b2e35a0cc..76c2cc735ef3196273b28c7a804048d8e1f6d123 100644 --- a/ArmPkg/Include/Chipset/AArch64.h +++ b/ArmPkg/Include/Chipset/AArch64.h @@ -1,7 +1,7 @@ /** @file Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- Copyright (c) 2011 - 2015, ARM Ltd. All rights reserved.
+ Copyright (c) 2011 - 2017, ARM Ltd. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -235,4 +235,14 @@ ArmWriteCptr ( IN UINT64 Cptr ); +UINT32 +ArmReadCntHctl ( + VOID + ); + +VOID +ArmWriteCntHctl ( + IN UINT32 CntHctl + ); + #endif // __AARCH64_H__ diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S index 6e8074a4868979d2fa3b850e1e588862179f829a..dde6a756528f3abf1bd5a142448e42122a9bd8fa 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S @@ -480,4 +480,14 @@ ASM_FUNC(ArmReadCurrentEL) mrs x0, CurrentEL ret +// UINT32 ArmReadCntHctl(VOID) +ASM_FUNC(ArmReadCntHctl) + mrs x0, cnthctl_el2 + ret + +// VOID ArmWriteCntHctl(UINT32 CntHctl) +ASM_FUNC(ArmWriteCntHctl) + msr cnthctl_el2, x0 + ret + ASM_FUNCTION_REMOVE_IF_UNREFERENCED -- Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")