aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYangyu Chen <cyy@cyyself.name>2024-09-04 23:53:35 +0800
committerYangyu Chen <cyy@cyyself.name>2024-09-04 23:53:35 +0800
commit21db322aeff7d6a34a6ff20d1169c30485be50dd (patch)
tree9d0e63e1b6084426bd9a4d435242427cc9647109
parent2d55f75fe1f30aa4396524ac6ab84a4a3d98aadd (diff)
downloadriscv-opcodes-21db322aeff7d6a34a6ff20d1169c30485be50dd.zip
riscv-opcodes-21db322aeff7d6a34a6ff20d1169c30485be50dd.tar.gz
riscv-opcodes-21db322aeff7d6a34a6ff20d1169c30485be50dd.tar.bz2
Add fields definition of mcounteren and mcountinhibit
-rw-r--r--encoding.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/encoding.h b/encoding.h
index 63d5901..955459b 100644
--- a/encoding.h
+++ b/encoding.h
@@ -214,6 +214,17 @@
#define MHPMEVENTH_MINH 0x40000000
#define MHPMEVENTH_OF 0x80000000
+#define MCOUNTEREN_CY_SHIFT 0
+#define MCOUNTEREN_TIME_SHIFT 1
+#define MCOUNTEREN_IR_SHIFT 2
+
+#define MCOUNTEREN_CY (1U << MCOUNTEREN_CY_SHIFT)
+#define MCOUNTEREN_TIME (1U << MCOUNTEREN_TIME_SHIFT)
+#define MCOUNTEREN_IR (1U << MCOUNTEREN_IR_SHIFT)
+
+#define MCOUNTINHIBIT_CY MCOUNTEREN_CY
+#define MCOUNTINHIBIT_IR MCOUNTEREN_IR
+
#define HENVCFG_FIOM 0x00000001
#define HENVCFG_LPE 0x00000004
#define HENVCFG_SSE 0x00000008