1/*
2* Copyright 2019, Data61
3* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4* ABN 41 687 119 230.
5*
6* This software may be distributed and modified according to the terms of
7* the BSD 2-Clause license. Note that NO WARRANTY is provided.
8* See "LICENSE_BSD2.txt" for details.
9*
10* @TAG(DATA61_BSD)
11*/
12
13#pragma once
14
15#define COPROC_WRITE_WORD(R,W) asm volatile ("msr " R  ", %0" :: "r"(W))
16#define COPROC_READ_WORD(R,W)  asm volatile ("mrs %0, " R : "=r" (W))
17#define COPROC_WRITE_64(R,W)   COPROC_WRITE_WORD(R,W)
18#define COPROC_READ_64(R,W)    COPROC_READ_WORD(R,W)
19
20/* control reigster for the el1 physical timer */
21#define CNTP_CTL "cntp_ctl_el0"
22/* holds the compare value for the el1 physical timer */
23#define CNTP_CVAL "cntp_cval_el0"
24/* holds the 64-bit physical count value */
25#define CNTPCT "cntpct_el0"
26/* frequency of the timer */
27#define CNTFRQ "cntfrq_el0"
28