hw/riscv: Provide rdtime callback for TCG in CLINT emulation

This patch extends CLINT emulation to provide rdtime callback for
TCG. This rdtime callback will be called wheneven TIME CSRs are
read in privileged modes.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
Anup Patel 2020-02-02 19:12:17 +05:30 committed by Palmer Dabbelt
parent c695724868
commit 5f3616ccce
No known key found for this signature in database
GPG key ID: 2E1319F35FBB1889
6 changed files with 16 additions and 8 deletions

View file

@ -41,7 +41,8 @@ typedef struct SiFiveCLINTState {
} SiFiveCLINTState;
DeviceState *sifive_clint_create(hwaddr addr, hwaddr size, uint32_t num_harts,
uint32_t sip_base, uint32_t timecmp_base, uint32_t time_base);
uint32_t sip_base, uint32_t timecmp_base, uint32_t time_base,
bool provide_rdtime);
enum {
SIFIVE_SIP_BASE = 0x0,