summaryrefslogtreecommitdiff
path: root/kernel/riscv.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/riscv.h')
-rw-r--r--kernel/riscv.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/riscv.h b/kernel/riscv.h
index 1691faf..1f8a503 100644
--- a/kernel/riscv.h
+++ b/kernel/riscv.h
@@ -1,3 +1,5 @@
+#ifndef __ASSEMBLER__
+
// which hart (core) is this?
static inline uint64
r_mhartid()
@@ -331,6 +333,10 @@ sfence_vma()
asm volatile("sfence.vma zero, zero");
}
+typedef uint64 pte_t;
+typedef uint64 *pagetable_t; // 512 PTEs
+
+#endif // __ASSEMBLER__
#define PGSIZE 4096 // bytes per page
#define PGSHIFT 12 // bits of offset within a page
@@ -361,6 +367,3 @@ sfence_vma()
// Sv39, to avoid having to sign-extend virtual addresses
// that have the high bit set.
#define MAXVA (1L << (9 + 9 + 9 + 12 - 1))
-
-typedef uint64 pte_t;
-typedef uint64 *pagetable_t; // 512 PTEs