From 23d6348f924d27e72acdb3b5747ca26697e677e1 Mon Sep 17 00:00:00 2001 From: Sami Mujawar Date: Tue, 16 May 2017 11:10:44 +0100 Subject: ArmPkg: Add CNTHCTL_EL2 support functions 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 Reviewed-by: Leif Lindholm --- ArmPkg/Include/Chipset/AArch64.h | 12 +++++++++++- ArmPkg/Library/ArmLib/AArch64/AArch64Support.S | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'ArmPkg') diff --git a/ArmPkg/Include/Chipset/AArch64.h b/ArmPkg/Include/Chipset/AArch64.h index cebfc5da42..76c2cc735e 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 6e8074a486..dde6a75652 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 -- cgit v1.2.3