Index: head/sys/riscv/include/frame.h =================================================================== --- head/sys/riscv/include/frame.h +++ head/sys/riscv/include/frame.h @@ -55,7 +55,7 @@ uint64_t tf_a[8]; uint64_t tf_sepc; uint64_t tf_sstatus; - uint64_t tf_sbadaddr; + uint64_t tf_stval; uint64_t tf_scause; }; Index: head/sys/riscv/riscv/db_interface.c =================================================================== --- head/sys/riscv/riscv/db_interface.c +++ head/sys/riscv/riscv/db_interface.c @@ -98,7 +98,7 @@ { "a7", DB_OFFSET(tf_a[7]), db_frame }, { "sepc", DB_OFFSET(tf_sepc), db_frame }, { "sstatus", DB_OFFSET(tf_sstatus), db_frame }, - { "sbadaddr", DB_OFFSET(tf_sbadaddr), db_frame }, + { "stval", DB_OFFSET(tf_stval), db_frame }, { "scause", DB_OFFSET(tf_scause), db_frame }, }; Index: head/sys/riscv/riscv/exception.S =================================================================== --- head/sys/riscv/riscv/exception.S +++ head/sys/riscv/riscv/exception.S @@ -107,8 +107,8 @@ sd t0, (TF_SEPC)(sp) csrr t0, sstatus sd t0, (TF_SSTATUS)(sp) - csrr t0, sbadaddr - sd t0, (TF_SBADADDR)(sp) + csrr t0, stval + sd t0, (TF_STVAL)(sp) csrr t0, scause sd t0, (TF_SCAUSE)(sp) .endm Index: head/sys/riscv/riscv/genassym.c =================================================================== --- head/sys/riscv/riscv/genassym.c +++ head/sys/riscv/riscv/genassym.c @@ -96,6 +96,6 @@ ASSYM(TF_S, offsetof(struct trapframe, tf_s)); ASSYM(TF_A, offsetof(struct trapframe, tf_a)); ASSYM(TF_SEPC, offsetof(struct trapframe, tf_sepc)); -ASSYM(TF_SBADADDR, offsetof(struct trapframe, tf_sbadaddr)); +ASSYM(TF_STVAL, offsetof(struct trapframe, tf_stval)); ASSYM(TF_SCAUSE, offsetof(struct trapframe, tf_scause)); ASSYM(TF_SSTATUS, offsetof(struct trapframe, tf_sstatus)); Index: head/sys/riscv/riscv/trap.c =================================================================== --- head/sys/riscv/riscv/trap.c +++ head/sys/riscv/riscv/trap.c @@ -170,7 +170,7 @@ data_abort(struct trapframe *frame, int usermode) { struct vm_map *map; - uint64_t sbadaddr; + uint64_t stval; struct thread *td; struct pcb *pcb; vm_prot_t ftype; @@ -188,7 +188,7 @@ td = curthread; p = td->td_proc; pcb = td->td_pcb; - sbadaddr = frame->tf_sbadaddr; + stval = frame->tf_stval; if (td->td_critnest != 0 || td->td_intr_nesting_level != 0 || WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, @@ -197,7 +197,7 @@ if (usermode) map = &td->td_proc->p_vmspace->vm_map; - else if (sbadaddr >= VM_MAX_USER_ADDRESS) + else if (stval >= VM_MAX_USER_ADDRESS) map = kernel_map; else { if (pcb->pcb_onfault == 0) @@ -205,7 +205,7 @@ map = &td->td_proc->p_vmspace->vm_map; } - va = trunc_page(sbadaddr); + va = trunc_page(stval); if ((frame->tf_scause == EXCP_FAULT_STORE) || (frame->tf_scause == EXCP_STORE_PAGE_FAULT)) { @@ -249,7 +249,7 @@ ucode = SEGV_ACCERR; else ucode = SEGV_MAPERR; - call_trapsignal(td, sig, ucode, (void *)sbadaddr); + call_trapsignal(td, sig, ucode, (void *)stval); } else { if (pcb->pcb_onfault != 0) { frame->tf_a[0] = error; @@ -267,7 +267,7 @@ fatal: dump_regs(frame); - panic("Fatal page fault at %#lx: %#016lx", frame->tf_sepc, sbadaddr); + panic("Fatal page fault at %#lx: %#016lx", frame->tf_sepc, stval); } void @@ -324,8 +324,8 @@ break; default: dump_regs(frame); - panic("Unknown kernel exception %x badaddr %lx\n", - exception, frame->tf_sbadaddr); + panic("Unknown kernel exception %x trap value %lx\n", + exception, frame->tf_stval); } } @@ -392,7 +392,7 @@ break; default: dump_regs(frame); - panic("Unknown userland exception %x, badaddr %lx\n", - exception, frame->tf_sbadaddr); + panic("Unknown userland exception %x, trap value %lx\n", + exception, frame->tf_stval); } }