]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Add CNTHCTL_EL2 support functions
authorSami Mujawar <sami.mujawar@arm.com>
Tue, 16 May 2017 10:10:44 +0000 (11:10 +0100)
committerLeif Lindholm <leif.lindholm@linaro.org>
Mon, 22 May 2017 14:19:34 +0000 (15:19 +0100)
Added helper functions for reading and writing the
CNTHCTL_EL2 register.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/Include/Chipset/AArch64.h
ArmPkg/Library/ArmLib/AArch64/AArch64Support.S

index cebfc5da426a44bb97505ed9c1da3b2b2e35a0cc..76c2cc735ef3196273b28c7a804048d8e1f6d123 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 \r
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-  Copyright (c) 2011 - 2015, ARM Ltd. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2017, ARM Ltd. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -235,4 +235,14 @@ ArmWriteCptr (
   IN  UINT64 Cptr\r
   );\r
 \r
+UINT32\r
+ArmReadCntHctl (\r
+  VOID\r
+  );\r
+\r
+VOID\r
+ArmWriteCntHctl (\r
+  IN UINT32 CntHctl\r
+  );\r
+\r
 #endif // __AARCH64_H__\r
index 6e8074a4868979d2fa3b850e1e588862179f829a..dde6a756528f3abf1bd5a142448e42122a9bd8fa 100644 (file)
@@ -480,4 +480,14 @@ ASM_FUNC(ArmReadCurrentEL)
   mrs   x0, CurrentEL\r
   ret\r
 \r
+// UINT32 ArmReadCntHctl(VOID)\r
+ASM_FUNC(ArmReadCntHctl)\r
+  mrs   x0, cnthctl_el2\r
+  ret\r
+\r
+// VOID ArmWriteCntHctl(UINT32 CntHctl)\r
+ASM_FUNC(ArmWriteCntHctl)\r
+  msr   cnthctl_el2, x0\r
+  ret\r
+\r
 ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r