Replace uses of sbadaddr with stval.
The sbadaddr register was renamed in version 1.10 of the privileged architecture specification. No functional change intended. Submitted by: Mitchell Horne <mhorne063@gmail.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18594
This commit is contained in:
parent
97884673fe
commit
eee0fc9834
@ -55,7 +55,7 @@ struct trapframe {
|
||||
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;
|
||||
};
|
||||
|
||||
|
@ -98,7 +98,7 @@ struct db_variable db_regs[] = {
|
||||
{ "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 },
|
||||
};
|
||||
|
||||
|
@ -107,8 +107,8 @@ __FBSDID("$FreeBSD$");
|
||||
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
|
||||
|
@ -96,6 +96,6 @@ ASSYM(TF_T, offsetof(struct trapframe, tf_t));
|
||||
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));
|
||||
|
@ -170,7 +170,7 @@ static void
|
||||
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 @@ data_abort(struct trapframe *frame, int usermode)
|
||||
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 @@ data_abort(struct trapframe *frame, int usermode)
|
||||
|
||||
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 @@ data_abort(struct trapframe *frame, int usermode)
|
||||
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 @@ data_abort(struct trapframe *frame, int usermode)
|
||||
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 @@ done:
|
||||
|
||||
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 @@ do_trap_supervisor(struct trapframe *frame)
|
||||
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 @@ do_trap_user(struct trapframe *frame)
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user