From 5973faacb969f4a1b268abb960618f2e35495c1a Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Fri, 10 Sep 2010 21:02:38 -0700 Subject: [sim, pk] cleaned up exception vectors and FP exc flags --- pk/entry.S | 10 +++++----- pk/handlers.c | 10 ++++++++-- pk/riscv-pk.c | 3 +++ 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; -- cgit v1.1