]> xenbits.xensource.com Git - xen.git/commitdiff
xen/riscv: introduce time.h
authorOleksii Kurochko <oleksii.kurochko@gmail.com>
Mon, 5 Feb 2024 15:32:25 +0000 (16:32 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 13 Feb 2024 08:31:27 +0000 (09:31 +0100)
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/riscv/include/asm/time.h [new file with mode: 0644]

diff --git a/xen/arch/riscv/include/asm/time.h b/xen/arch/riscv/include/asm/time.h
new file mode 100644 (file)
index 0000000..affeb05
--- /dev/null
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_RISCV_TIME_H__
+#define __ASM_RISCV_TIME_H__
+
+#include <xen/bug.h>
+#include <asm/csr.h>
+
+struct vcpu;
+
+static inline void force_update_vcpu_system_time(struct vcpu *v)
+{
+    BUG_ON("unimplemented");
+}
+
+typedef unsigned long cycles_t;
+
+static inline cycles_t get_cycles(void)
+{
+    return csr_read(CSR_TIME);
+}
+
+#endif /* __ASM_RISCV_TIME_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */