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>
/** @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
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
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