aboutsummaryrefslogtreecommitdiff
path: root/encoding.h
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2017-02-08 14:33:12 -0800
committerAndrew Waterman <andrew@sifive.com>2017-02-08 14:33:12 -0800
commitcd10c7174835240b86a8ca72ce17aa7422d4970f (patch)
tree7ee2b5a9a74983910fa789cc35937397b84d29fc /encoding.h
parent3c1a9110b71658f6e3249186e8b44e7474a4ee90 (diff)
downloadriscv-opcodes-cd10c7174835240b86a8ca72ce17aa7422d4970f.zip
riscv-opcodes-cd10c7174835240b86a8ca72ce17aa7422d4970f.tar.gz
riscv-opcodes-cd10c7174835240b86a8ca72ce17aa7422d4970f.tar.bz2
Encode VM type in sptbr, not mstatus
https://github.com/riscv/riscv-isa-manual/issues/4
Diffstat (limited to 'encoding.h')
-rw-r--r--encoding.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/encoding.h b/encoding.h
index 85e97be..329d012 100644
--- a/encoding.h
+++ b/encoding.h
@@ -114,6 +114,20 @@
#define VM_SV39 9
#define VM_SV48 10
+#define SPTBR32_MODE 0x80000000
+#define SPTBR32_ASID 0x7FC00000
+#define SPTBR32_PPN 0x003FFFFF
+#define SPTBR64_MODE 0xE000000000000000
+#define SPTBR64_ASID 0x1FFFE00000000000
+#define SPTBR64_PPN 0x0000003FFFFFFFFF
+
+#define SPTBR_MODE_OFF 0
+#define SPTBR_MODE_SV32 1
+#define SPTBR_MODE_SV39 4
+#define SPTBR_MODE_SV48 5
+#define SPTBR_MODE_SV57 6
+#define SPTBR_MODE_SV64 7
+
#define IRQ_S_SOFT 1
#define IRQ_H_SOFT 2
#define IRQ_M_SOFT 3