lib: Emulate HTIMEDELTA CSR for platforms not having TIME CSR

For platforms not having TIME CSR, we trap-n-emulate TIME CSR
read/write in OpenSBI. Same rationale applies to HTIMEDELTA CSR
as well so we trap-n-emulate HTIMEDELTA CSR for platforms not
having TIME CSR.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
Anup Patel
2019-08-18 13:14:44 +05:30
committed by Anup Patel
parent 7d4420bd69
commit 1e9f88889f
6 changed files with 124 additions and 19 deletions

View File

@@ -16,6 +16,14 @@ struct sbi_scratch;
u64 sbi_timer_value(struct sbi_scratch *scratch);
u64 sbi_timer_virt_value(struct sbi_scratch *scratch);
u64 sbi_timer_get_delta(struct sbi_scratch *scratch);
void sbi_timer_set_delta(struct sbi_scratch *scratch, ulong delta);
void sbi_timer_set_delta_upper(struct sbi_scratch *scratch, ulong delta_upper);
void sbi_timer_event_stop(struct sbi_scratch *scratch);
void sbi_timer_event_start(struct sbi_scratch *scratch, u64 next_event);