summaryrefslogtreecommitdiff
path: root/v/riscv_test.h
diff options
context:
space:
mode:
Diffstat (limited to 'v/riscv_test.h')
-rw-r--r--v/riscv_test.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/v/riscv_test.h b/v/riscv_test.h
index e8a9015..26c44f2 100644
--- a/v/riscv_test.h
+++ b/v/riscv_test.h
@@ -79,7 +79,7 @@ userstart: \
#define PGSHIFT 13
#define PGSIZE (1 << PGSHIFT)
-#define SIZEOF_TRAPFRAME_T 20784
+#define SIZEOF_TRAPFRAME_T 20768
#ifndef __ASSEMBLER__
@@ -109,11 +109,18 @@ static inline long vgetvl()
static inline long vxcptaux()
{
- int aux;
+ long aux;
asm volatile ("vxcptaux %0" : "=r"(aux) :);
return aux;
}
+static inline long vxcptcause()
+{
+ long cause;
+ asm volatile ("vxcptcause %0" : "=r"(cause) :);
+ return cause;
+}
+
static inline void vxcptrestore(long* mem)
{
asm volatile("vxcptrestore %0" : : "r"(mem) : "memory");
@@ -138,8 +145,6 @@ typedef struct
long epc;
long badvaddr;
long cause;
- long insn;
- long hwacha_cause;
long evac[2560];
} trapframe_t;
#endif