aboutsummaryrefslogtreecommitdiff
path: root/pcr.h
diff options
context:
space:
mode:
Diffstat (limited to 'pcr.h')
-rw-r--r--pcr.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/pcr.h b/pcr.h
index 22650a3..23e6185 100644
--- a/pcr.h
+++ b/pcr.h
@@ -1,6 +1,16 @@
#ifndef _RISCV_COP0_H
#define _RISCV_COP0_H
+#define SR_ET 0x0000000000000001
+#define SR_PS 0x0000000000000004
+#define SR_S 0x0000000000000008
+#define SR_EF 0x0000000000000010
+#define SR_UX 0x0000000000000020
+#define SR_KX 0x0000000000000040
+#define SR_IM 0x000000000000FF00
+
+#ifndef __ASSEMBLER__
+
#define mtpcr(val,reg) ({ long __tmp = (long)(val); \
asm volatile ("mtpcr %0,$%1"::"r"(__tmp),"i"(reg)); })
@@ -9,3 +19,5 @@
__tmp; })
#endif
+
+#endif