aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2010-09-10 21:02:38 -0700
committerAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2010-09-10 21:02:38 -0700
commit5973faacb969f4a1b268abb960618f2e35495c1a (patch)
treef7b90da5a2a849e997a45077ec1e9aa52a30d495
parent03e016c3d7909ffd2c162ec21dff61076442fa05 (diff)
downloadpk-5973faacb969f4a1b268abb960618f2e35495c1a.zip
pk-5973faacb969f4a1b268abb960618f2e35495c1a.tar.gz
pk-5973faacb969f4a1b268abb960618f2e35495c1a.tar.bz2
[sim, pk] cleaned up exception vectors and FP exc flags
-rw-r--r--pk/entry.S10
-rw-r--r--pk/handlers.c10
-rw-r--r--pk/riscv-pk.c3
3 files changed, 16 insertions, 7 deletions
diff --git a/pk/entry.S b/pk/entry.S
index 8046ffb..86e7888 100644
--- a/pk/entry.S
+++ b/pk/entry.S
@@ -144,16 +144,16 @@ pop_tf: # write the trap frame onto the stack
.global trap_table
.ent trap_table
trap_table:
+ TRAP_TABLE_ENTRY(handle_misaligned_fetch)
+ TRAP_TABLE_ENTRY(handle_fault_fetch)
TRAP_TABLE_ENTRY(handle_illegal_instruction)
TRAP_TABLE_ENTRY(handle_privileged_instruction)
TRAP_TABLE_ENTRY(handle_fp_disabled)
- TRAP_TABLE_ENTRY(handle_badtrap)
- TRAP_TABLE_ENTRY(handle_misaligned_fetch)
- TRAP_TABLE_ENTRY(handle_misaligned_ldst)
- TRAP_TABLE_ENTRY(handle_fault_fetch)
- TRAP_TABLE_ENTRY(handle_fault_ldst)
TRAP_TABLE_ENTRY(handle_syscall)
TRAP_TABLE_ENTRY(handle_breakpoint)
+ TRAP_TABLE_ENTRY(handle_misaligned_ldst)
+ TRAP_TABLE_ENTRY(handle_fault_load)
+ TRAP_TABLE_ENTRY(handle_fault_store)
TRAP_TABLE_ENTRY(handle_badtrap)
TRAP_TABLE_ENTRY(handle_badtrap)
TRAP_TABLE_ENTRY(handle_badtrap)
diff --git a/pk/handlers.c b/pk/handlers.c
index 6cc5958..59338e5 100644
--- a/pk/handlers.c
+++ b/pk/handlers.c
@@ -51,8 +51,14 @@ void handle_fault_fetch(trapframe_t* tf)
panic("Faulting instruction access!");
}
-void handle_fault_ldst(trapframe_t* tf)
+void handle_fault_load(trapframe_t* tf)
{
dump_tf(tf);
- panic("Faulting data access!");
+ panic("Faulting load!");
+}
+
+void handle_fault_store(trapframe_t* tf)
+{
+ dump_tf(tf);
+ panic("Faulting store!");
}
diff --git a/pk/riscv-pk.c b/pk/riscv-pk.c
index 2c955e4..efe4239 100644
--- a/pk/riscv-pk.c
+++ b/pk/riscv-pk.c
@@ -9,6 +9,9 @@ void __attribute__((section(".boottext"))) __start()
register void* tt = &trap_table;
mtpcr(tt,PCR_TBR);
+ mtpcr(0,PCR_COUNT);
+ mtpcr(0,PCR_COMPARE);
+
register long sr0 = SR_S | SR_PS | SR_ET | SR_IM;
#ifdef PK_ENABLE_KERNEL_64BIT
sr0 |= SR_SX;