summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sbi/riscv_encoding.h4
-rw-r--r--include/sbi/sbi_emulate_csr.h5
-rw-r--r--include/sbi/sbi_timer.h8
3 files changed, 14 insertions, 3 deletions
diff --git a/include/sbi/riscv_encoding.h b/include/sbi/riscv_encoding.h
index 5aab9d2..902c81a 100644
--- a/include/sbi/riscv_encoding.h
+++ b/include/sbi/riscv_encoding.h
@@ -276,7 +276,9 @@
#define CSR_HSTATUS 0x600
#define CSR_HEDELEG 0x602
#define CSR_HIDELEG 0x603
-#define CSR_HCOUNTERNEN 0x606
+#define CSR_HTIMEDELTA 0x605
+#define CSR_HTIMEDELTAH 0x615
+#define CSR_HCOUNTERNEN 0x606
#define CSR_HGATP 0x680
#define CSR_VSSTATUS 0x200
diff --git a/include/sbi/sbi_emulate_csr.h b/include/sbi/sbi_emulate_csr.h
index 5d1755f..fe357e5 100644
--- a/include/sbi/sbi_emulate_csr.h
+++ b/include/sbi/sbi_emulate_csr.h
@@ -12,12 +12,13 @@
#include <sbi/sbi_types.h>
+struct sbi_trap_regs;
struct sbi_scratch;
-int sbi_emulate_csr_read(int csr_num, u32 hartid, ulong mstatus,
+int sbi_emulate_csr_read(int csr_num, u32 hartid, struct sbi_trap_regs *regs,
struct sbi_scratch *scratch, ulong *csr_val);
-int sbi_emulate_csr_write(int csr_num, u32 hartid, ulong mstatus,
+int sbi_emulate_csr_write(int csr_num, u32 hartid, struct sbi_trap_regs *regs,
struct sbi_scratch *scratch, ulong csr_val);
#endif
diff --git a/include/sbi/sbi_timer.h b/include/sbi/sbi_timer.h
index e40cce9..c14c8d0 100644
--- a/include/sbi/sbi_timer.h
+++ b/include/sbi/sbi_timer.h
@@ -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);