aboutsummaryrefslogtreecommitdiff
path: root/pk/entry.S
diff options
context:
space:
mode:
Diffstat (limited to 'pk/entry.S')
-rw-r--r--pk/entry.S10
1 files changed, 6 insertions, 4 deletions
diff --git a/pk/entry.S b/pk/entry.S
index d2fb72c..a5638dd 100644
--- a/pk/entry.S
+++ b/pk/entry.S
@@ -1,6 +1,6 @@
#include "pcr.h"
-#ifdef PK_ENABLE_KERNEL_64BIT
+#ifdef __riscv64
# define STORE sd
# define LOAD ld
# define REGBYTES 8
@@ -61,9 +61,11 @@ save_tf: # write the trap frame onto the stack
STORE $x3,35*REGBYTES($x2)
# get insn
- and $x4,$x4,~3
- lw $x3,0($x4)
- STORE $x3, 36*REGBYTES($x2)
+ and $x4,$x4,~1
+ lh $x3,0($x4)
+ lh $x4,2($x4)
+ sh $x3, 36*REGBYTES($x2)
+ sh $x4,2+36*REGBYTES($x2)
ret
.end save_tf