1 #------------------------------------------------------------------------------
3 # Copyright (c) 2011 - 2013, ARM Limited. All rights reserved.
4 # Copyright (c) 2016, Linaro Limited. All rights reserved.
6 # SPDX-License-Identifier: BSD-2-Clause-Patent
8 #------------------------------------------------------------------------------
10 #include <AsmMacroIoLibV8.h>
12 ASM_FUNC(ArmReadCntFrq)
13 mrs x0, cntfrq_el0 // Read CNTFRQ
17 # NOTE - Can only write while at highest implemented EL level (EL3 on model). Else ReadOnly (EL2, EL1, EL0)
18 ASM_FUNC(ArmWriteCntFrq)
19 msr cntfrq_el0, x0 // Write to CNTFRQ
23 ASM_FUNC(ArmReadCntPct)
24 mrs x0, cntpct_el0 // Read CNTPCT (Physical counter register)
28 ASM_FUNC(ArmReadCntkCtl)
29 mrs x0, cntkctl_el1 // Read CNTK_CTL (Timer PL1 Control Register)
33 ASM_FUNC(ArmWriteCntkCtl)
34 msr cntkctl_el1, x0 // Write to CNTK_CTL (Timer PL1 Control Register)
38 ASM_FUNC(ArmReadCntpTval)
39 mrs x0, cntp_tval_el0 // Read CNTP_TVAL (PL1 physical timer value register)
43 ASM_FUNC(ArmWriteCntpTval)
44 msr cntp_tval_el0, x0 // Write to CNTP_TVAL (PL1 physical timer value register)
48 ASM_FUNC(ArmReadCntpCtl)
49 mrs x0, cntp_ctl_el0 // Read CNTP_CTL (PL1 Physical Timer Control Register)
53 ASM_FUNC(ArmWriteCntpCtl)
54 msr cntp_ctl_el0, x0 // Write to CNTP_CTL (PL1 Physical Timer Control Register)
58 ASM_FUNC(ArmReadCntvTval)
59 mrs x0, cntv_tval_el0 // Read CNTV_TVAL (Virtual Timer Value register)
63 ASM_FUNC(ArmWriteCntvTval)
64 msr cntv_tval_el0, x0 // Write to CNTV_TVAL (Virtual Timer Value register)
68 ASM_FUNC(ArmReadCntvCtl)
69 mrs x0, cntv_ctl_el0 // Read CNTV_CTL (Virtual Timer Control Register)
73 ASM_FUNC(ArmWriteCntvCtl)
74 msr cntv_ctl_el0, x0 // Write to CNTV_CTL (Virtual Timer Control Register)
78 ASM_FUNC(ArmReadCntvCt)
79 mrs x0, cntvct_el0 // Read CNTVCT (Virtual Count Register)
83 ASM_FUNC(ArmReadCntpCval)
84 mrs x0, cntp_cval_el0 // Read CNTP_CTVAL (Physical Timer Compare Value Register)
88 ASM_FUNC(ArmWriteCntpCval)
89 msr cntp_cval_el0, x0 // Write to CNTP_CTVAL (Physical Timer Compare Value Register)
93 ASM_FUNC(ArmReadCntvCval)
94 mrs x0, cntv_cval_el0 // Read CNTV_CTVAL (Virtual Timer Compare Value Register)
98 ASM_FUNC(ArmWriteCntvCval)
99 msr cntv_cval_el0, x0 // write to CNTV_CTVAL (Virtual Timer Compare Value Register)
103 ASM_FUNC(ArmReadCntvOff)
104 mrs x0, cntvoff_el2 // Read CNTVOFF (virtual Offset register)
108 ASM_FUNC(ArmWriteCntvOff)
109 msr cntvoff_el2, x0 // Write to CNTVOFF (Virtual Offset register)
113 ASM_FUNCTION_REMOVE_IF_UNREFERENCED