1 #------------------------------------------------------------------------------
3 # Copyright (c) 2011 - 2013, ARM Limited. All rights reserved.
4 # Copyright (c) 2016, Linaro Limited. All rights reserved.
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 #------------------------------------------------------------------------------
16 #include <AsmMacroIoLibV8.h>
18 ASM_FUNC(ArmReadCntFrq)
19 mrs x0, cntfrq_el0 // Read CNTFRQ
23 # NOTE - Can only write while at highest implemented EL level (EL3 on model). Else ReadOnly (EL2, EL1, EL0)
24 ASM_FUNC(ArmWriteCntFrq)
25 msr cntfrq_el0, x0 // Write to CNTFRQ
29 ASM_FUNC(ArmReadCntPct)
30 mrs x0, cntpct_el0 // Read CNTPCT (Physical counter register)
34 ASM_FUNC(ArmReadCntkCtl)
35 mrs x0, cntkctl_el1 // Read CNTK_CTL (Timer PL1 Control Register)
39 ASM_FUNC(ArmWriteCntkCtl)
40 msr cntkctl_el1, x0 // Write to CNTK_CTL (Timer PL1 Control Register)
44 ASM_FUNC(ArmReadCntpTval)
45 mrs x0, cntp_tval_el0 // Read CNTP_TVAL (PL1 physical timer value register)
49 ASM_FUNC(ArmWriteCntpTval)
50 msr cntp_tval_el0, x0 // Write to CNTP_TVAL (PL1 physical timer value register)
54 ASM_FUNC(ArmReadCntpCtl)
55 mrs x0, cntp_ctl_el0 // Read CNTP_CTL (PL1 Physical Timer Control Register)
59 ASM_FUNC(ArmWriteCntpCtl)
60 msr cntp_ctl_el0, x0 // Write to CNTP_CTL (PL1 Physical Timer Control Register)
64 ASM_FUNC(ArmReadCntvTval)
65 mrs x0, cntv_tval_el0 // Read CNTV_TVAL (Virtual Timer Value register)
69 ASM_FUNC(ArmWriteCntvTval)
70 msr cntv_tval_el0, x0 // Write to CNTV_TVAL (Virtual Timer Value register)
74 ASM_FUNC(ArmReadCntvCtl)
75 mrs x0, cntv_ctl_el0 // Read CNTV_CTL (Virtual Timer Control Register)
79 ASM_FUNC(ArmWriteCntvCtl)
80 msr cntv_ctl_el0, x0 // Write to CNTV_CTL (Virtual Timer Control Register)
84 ASM_FUNC(ArmReadCntvCt)
85 mrs x0, cntvct_el0 // Read CNTVCT (Virtual Count Register)
89 ASM_FUNC(ArmReadCntpCval)
90 mrs x0, cntp_cval_el0 // Read CNTP_CTVAL (Physical Timer Compare Value Register)
94 ASM_FUNC(ArmWriteCntpCval)
95 msr cntp_cval_el0, x0 // Write to CNTP_CTVAL (Physical Timer Compare Value Register)
99 ASM_FUNC(ArmReadCntvCval)
100 mrs x0, cntv_cval_el0 // Read CNTV_CTVAL (Virtual Timer Compare Value Register)
104 ASM_FUNC(ArmWriteCntvCval)
105 msr cntv_cval_el0, x0 // write to CNTV_CTVAL (Virtual Timer Compare Value Register)
109 ASM_FUNC(ArmReadCntvOff)
110 mrs x0, cntvoff_el2 // Read CNTVOFF (virtual Offset register)
114 ASM_FUNC(ArmWriteCntvOff)
115 msr cntvoff_el2, x0 // Write to CNTVOFF (Virtual Offset register)
119 ASM_FUNCTION_REMOVE_IF_UNREFERENCED