aboutsummaryrefslogtreecommitdiff
path: root/pk
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>2011-03-25 16:43:38 -0700
committerAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>2011-03-25 16:43:38 -0700
commit4baf0c99c55791ceb4ee70646e424fc5fa78ae27 (patch)
tree665ed8fe2dc07e7eccd7a9a61736fa1cdc329a07 /pk
parentd9e887bd18aedc9b7c6cad1fd253a111a33426e2 (diff)
downloadpk-4baf0c99c55791ceb4ee70646e424fc5fa78ae27.zip
pk-4baf0c99c55791ceb4ee70646e424fc5fa78ae27.tar.gz
pk-4baf0c99c55791ceb4ee70646e424fc5fa78ae27.tar.bz2
[xcc,pk,opcodes,sim] updated encoding/insn names
Diffstat (limited to 'pk')
-rw-r--r--pk/frontend.c2
-rw-r--r--pk/handlers.c9
-rw-r--r--pk/pk.h1
-rw-r--r--pk/riscv-opc.h92
4 files changed, 64 insertions, 40 deletions
diff --git a/pk/frontend.c b/pk/frontend.c
index 5c0fdc0..9641352 100644
--- a/pk/frontend.c
+++ b/pk/frontend.c
@@ -17,7 +17,7 @@ sysret_t frontend_syscall(long n, long a0, long a1, long a2, long a3)
magic_mem[3] = a2;
magic_mem[4] = a3;
- asm volatile ("sync");
+ asm volatile ("fence");
mtpcr(magic_mem,PCR_TOHOST);
while(mfpcr(PCR_FROMHOST) == 0);
diff --git a/pk/handlers.c b/pk/handlers.c
index 430210d..d4c3d7c 100644
--- a/pk/handlers.c
+++ b/pk/handlers.c
@@ -38,6 +38,12 @@ static void handle_illegal_instruction(trapframe_t* tf)
panic("An illegal instruction was executed!");
}
+static void handle_breakpoint(trapframe_t* tf)
+{
+ dump_tf(tf);
+ printk("Breakpoint!\n");
+}
+
static void handle_misaligned_fetch(trapframe_t* tf)
{
dump_tf(tf);
@@ -100,8 +106,9 @@ void handle_trap(trapframe_t* tf)
handle_illegal_instruction,
handle_privileged_instruction,
handle_fp_disabled,
- handle_syscall,
handle_interrupt,
+ handle_syscall,
+ handle_breakpoint,
handle_misaligned_ldst,
handle_fault_load,
handle_fault_store,
diff --git a/pk/pk.h b/pk/pk.h
index cf3d7fb..7ff3e85 100644
--- a/pk/pk.h
+++ b/pk/pk.h
@@ -35,7 +35,6 @@ void dump_tf(trapframe_t*);
void unhandled_trap(trapframe_t*);
void handle_syscall(trapframe_t*);
-void handle_breakpoint(trapframe_t*);
void handle_misaligned_ldst(trapframe_t*);
void handle_fault_load(trapframe_t*);
void handle_fault_store(trapframe_t*);
diff --git a/pk/riscv-opc.h b/pk/riscv-opc.h
index 8ec112d..8633ba0 100644
--- a/pk/riscv-opc.h
+++ b/pk/riscv-opc.h
@@ -1,12 +1,14 @@
/* Automatically generated by parse-opcodes */
#define MATCH_REMUW 0x7bb
#define MASK_REMUW 0x1ffff
+#define MATCH_FMIN_D 0x180d3
+#define MASK_FMIN_D 0x1ffff
#define MATCH_BLTU 0x363
#define MASK_BLTU 0x3ff
#define MATCH_FCVT_LU_S 0x9053
#define MASK_FCVT_LU_S 0x3ff1ff
-#define MATCH_MTFSR 0x1de53
-#define MASK_MTFSR 0xf83fffff
+#define MATCH_FMIN_S 0x18053
+#define MASK_FMIN_S 0x1ffff
#define MATCH_SLLIW 0x9b
#define MASK_SLLIW 0x3f83ff
#define MATCH_LB 0x3
@@ -15,7 +17,7 @@
#define MASK_FCVT_D_L 0x3ff1ff
#define MATCH_LH 0x83
#define MASK_LH 0x3ff
-#define MATCH_FCVT_D_W 0xeed3
+#define MATCH_FCVT_D_W 0xe0d3
#define MASK_FCVT_D_W 0x3fffff
#define MATCH_LW 0x103
#define MASK_LW 0x3ff
@@ -23,29 +25,31 @@
#define MASK_ADD 0x1ffff
#define MATCH_FCVT_D_S 0x100d3
#define MASK_FCVT_D_S 0x3ff1ff
-#define MATCH_MFPCR 0xff
+#define MATCH_MFPCR 0x17b
#define MASK_MFPCR 0x7c1ffff
+#define MATCH_FMAX_D 0x190d3
+#define MASK_FMAX_D 0x1ffff
#define MATCH_BNE 0xe3
#define MASK_BNE 0x3ff
-#define MATCH_MTPCR 0x4ff
+#define MATCH_MTPCR 0x1fb
#define MASK_MTPCR 0xf801ffff
#define MATCH_FCVT_S_D 0x11053
#define MASK_FCVT_S_D 0x3ff1ff
#define MATCH_BGEU 0x3e3
#define MASK_BGEU 0x3ff
-#define MATCH_DI 0x47f
+#define MATCH_DI 0xfb
#define MASK_DI 0x7ffffff
#define MATCH_SLTIU 0x193
#define MASK_SLTIU 0x3ff
-#define MATCH_FADD_S 0x53
-#define MASK_FADD_S 0x1f1ff
+#define MATCH_BREAK 0xf7
+#define MASK_BREAK 0xffffffff
#define MATCH_FCVT_S_W 0xe053
#define MASK_FCVT_S_W 0x3ff1ff
#define MATCH_MUL 0x433
#define MASK_MUL 0x1ffff
#define MATCH_AMOMINU_D 0x19c3
#define MASK_AMOMINU_D 0x1ffff
-#define MATCH_MFTX_D 0x18ed3
+#define MATCH_MFTX_D 0x1c0d3
#define MASK_MFTX_D 0x7c1ffff
#define MATCH_SRLI 0x293
#define MASK_SRLI 0x3f03ff
@@ -59,28 +63,28 @@
#define MASK_SRLW 0x1ffff
#define MATCH_DIV 0x633
#define MASK_DIV 0x1ffff
-#define MATCH_MFTX_S 0x18e53
+#define MATCH_MFTX_S 0x1c053
#define MASK_MFTX_S 0x7c1ffff
#define MATCH_J 0x67
#define MASK_J 0x7f
-#define MATCH_EI 0x7f
+#define MATCH_EI 0x7b
#define MASK_EI 0x7ffffff
+#define MATCH_FENCE 0x12f
+#define MASK_FENCE 0x3ff
#define MATCH_FNMSUB_S 0x4b
#define MASK_FNMSUB_S 0x1ff
#define MATCH_FCVT_L_S 0x8053
#define MASK_FCVT_L_S 0x3ff1ff
-#define MATCH_SYNC 0x117
-#define MASK_SYNC 0xffffffff
-#define MATCH_FLE_S 0x17e53
+#define MATCH_FLE_S 0x17053
#define MASK_FLE_S 0x1ffff
-#define MATCH_MFFSR 0x1be53
+#define MATCH_MFFSR 0x1d053
#define MASK_MFFSR 0x7ffffff
#define MATCH_FDIV_S 0x3053
#define MASK_FDIV_S 0x1f1ff
-#define MATCH_FLE_D 0x17ed3
+#define MATCH_FLE_D 0x170d3
#define MASK_FLE_D 0x1ffff
-#define MATCH_FCVT_L_D 0x80d3
-#define MASK_FCVT_L_D 0x3ff1ff
+#define MATCH_FENCE_I 0xaf
+#define MASK_FENCE_I 0x3ff
#define MATCH_FNMSUB_D 0xcb
#define MASK_FNMSUB_D 0x1ff
#define MATCH_ADDW 0x3b
@@ -91,10 +95,14 @@
#define MASK_XOR 0x1ffff
#define MATCH_SUB 0x10033
#define MASK_SUB 0x1ffff
-#define MATCH_ERET 0x17f
+#define MATCH_ERET 0x27b
#define MASK_ERET 0xffffffff
#define MATCH_BLT 0x263
#define MASK_BLT 0x3ff
+#define MATCH_MTFSR 0x1f053
+#define MASK_MTFSR 0x3fffff
+#define MATCH_FMAXMAG_D 0x1b0d3
+#define MASK_FMAXMAG_D 0x1ffff
#define MATCH_REM 0x733
#define MASK_REM 0x1ffff
#define MATCH_SRLIW 0x29b
@@ -113,7 +121,7 @@
#define MASK_SRAI 0x3f03ff
#define MATCH_AMOAND_D 0x9c3
#define MASK_AMOAND_D 0x1ffff
-#define MATCH_FLT_D 0x16ed3
+#define MATCH_FLT_D 0x160d3
#define MASK_FLT_D 0x1ffff
#define MATCH_SRAW 0x102bb
#define MASK_SRAW 0x1ffff
@@ -123,15 +131,15 @@
#define MASK_LD 0x3ff
#define MATCH_ORI 0x313
#define MASK_ORI 0x3ff
-#define MATCH_FLT_S 0x16e53
+#define MATCH_FLT_S 0x16053
#define MASK_FLT_S 0x1ffff
#define MATCH_ADDIW 0x1b
#define MASK_ADDIW 0x3ff
#define MATCH_AMOAND_W 0x943
#define MASK_AMOAND_W 0x1ffff
-#define MATCH_FEQ_S 0x15e53
+#define MATCH_FEQ_S 0x15053
#define MASK_FEQ_S 0x1ffff
-#define MATCH_FSGNJX_D 0x7ed3
+#define MATCH_FSGNJX_D 0x70d3
#define MASK_FSGNJX_D 0x1ffff
#define MATCH_SRA 0x102b3
#define MASK_SRA 0x1ffff
@@ -141,11 +149,11 @@
#define MASK_SRAIW 0x3f83ff
#define MATCH_SRL 0x2b3
#define MASK_SRL 0x1ffff
-#define MATCH_FSGNJX_S 0x7e53
+#define MATCH_FSGNJX_S 0x7053
#define MASK_FSGNJX_S 0x1ffff
-#define MATCH_FEQ_D 0x15ed3
+#define MATCH_FEQ_D 0x150d3
#define MASK_FEQ_D 0x1ffff
-#define MATCH_FCVT_D_WU 0xfed3
+#define MATCH_FCVT_D_WU 0xf0d3
#define MASK_FCVT_D_WU 0x3fffff
#define MATCH_OR 0x333
#define MASK_OR 0x1ffff
@@ -155,6 +163,8 @@
#define MASK_SUBW 0x1ffff
#define MATCH_JALR_C 0x6b
#define MASK_JALR_C 0x3ff
+#define MATCH_FMAX_S 0x19053
+#define MASK_FMAX_S 0x1ffff
#define MATCH_AMOMAXU_D 0x1dc3
#define MASK_AMOMAXU_D 0x1ffff
#define MATCH_JALR_J 0x16b
@@ -169,7 +179,7 @@
#define MASK_FCVT_WU_S 0x3ff1ff
#define MATCH_ANDI 0x393
#define MASK_ANDI 0x3ff
-#define MATCH_FSGNJN_D 0x6ed3
+#define MATCH_FSGNJN_D 0x60d3
#define MASK_FSGNJN_D 0x1ffff
#define MATCH_FNMADD_S 0x4f
#define MASK_FNMADD_S 0x1ff
@@ -197,7 +207,7 @@
#define MASK_FCVT_W_D 0x3ff1ff
#define MATCH_SLT 0x133
#define MASK_SLT 0x1ffff
-#define MATCH_MXTF_D 0x1ced3
+#define MATCH_MXTF_D 0x1e0d3
#define MASK_MXTF_D 0x3fffff
#define MATCH_SLLW 0xbb
#define MASK_SLLW 0x1ffff
@@ -221,7 +231,7 @@
#define MASK_BEQ 0x3ff
#define MATCH_FLD 0x187
#define MASK_FLD 0x3ff
-#define MATCH_MXTF_S 0x1ce53
+#define MATCH_MXTF_S 0x1e053
#define MASK_MXTF_S 0x3fffff
#define MATCH_FSUB_S 0x1053
#define MASK_FSUB_S 0x1f1ff
@@ -229,24 +239,26 @@
#define MASK_AND 0x1ffff
#define MATCH_LBU 0x203
#define MASK_LBU 0x3ff
-#define MATCH_SYSCALL 0x197
-#define MASK_SYSCALL 0xffc003ff
-#define MATCH_FSGNJ_S 0x5e53
+#define MATCH_SYSCALL 0x77
+#define MASK_SYSCALL 0xffffffff
+#define MATCH_FMINMAG_D 0x1a0d3
+#define MASK_FMINMAG_D 0x1ffff
+#define MATCH_FSGNJ_S 0x5053
#define MASK_FSGNJ_S 0x1ffff
-#define MATCH_FSGNJ_D 0x5ed3
+#define MATCH_FSGNJ_D 0x50d3
#define MASK_FSGNJ_D 0x1ffff
#define MATCH_MULHU 0x5b3
#define MASK_MULHU 0x1ffff
+#define MATCH_FCVT_L_D 0x80d3
+#define MASK_FCVT_L_D 0x3ff1ff
#define MATCH_FADD_D 0xd3
#define MASK_FADD_D 0x1f1ff
#define MATCH_FCVT_S_WU 0xf053
#define MASK_FCVT_S_WU 0x3ff1ff
-#define MATCH_RDNPC 0x17
+#define MATCH_RDNPC 0x26b
#define MASK_RDNPC 0x7ffffff
#define MATCH_FCVT_S_L 0xc053
#define MASK_FCVT_S_L 0x3ff1ff
-#define MATCH_SYNCI 0x97
-#define MASK_SYNCI 0xffffffff
#define MATCH_FCVT_LU_D 0x90d3
#define MASK_FCVT_LU_D 0x3ff1ff
#define MATCH_UNIMP 0x0
@@ -259,7 +271,7 @@
#define MASK_FSQRT_S 0x3ff1ff
#define MATCH_AMOMIN_W 0x1143
#define MASK_AMOMIN_W 0x1ffff
-#define MATCH_FSGNJN_S 0x6e53
+#define MATCH_FSGNJN_S 0x6053
#define MASK_FSGNJN_S 0x1ffff
#define MATCH_AMOSWAP_D 0x5c3
#define MASK_AMOSWAP_D 0x1ffff
@@ -277,6 +289,10 @@
#define MASK_DIVU 0x1ffff
#define MATCH_AMOSWAP_W 0x543
#define MASK_AMOSWAP_W 0x1ffff
+#define MATCH_FMAXMAG_S 0x1b053
+#define MASK_FMAXMAG_S 0x1ffff
+#define MATCH_FADD_S 0x53
+#define MASK_FADD_S 0x1f1ff
#define MATCH_FSD 0x1a7
#define MASK_FSD 0x3ff
#define MATCH_SW 0x123
@@ -293,5 +309,7 @@
#define MASK_SB 0x3ff
#define MATCH_FMSUB_D 0xc7
#define MASK_FMSUB_D 0x1ff
+#define MATCH_FMINMAG_S 0x1a053
+#define MASK_FMINMAG_S 0x1ffff
#define MATCH_SD 0x1a3
#define MASK_SD 0x3ff