Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/dev/fbt/riscv/fbt_isa.c
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) | ||||
cpu = &solaris_cpu[curcpu]; | cpu = &solaris_cpu[curcpu]; | ||||
fbt = fbt_probetab[FBT_ADDR2NDX(addr)]; | fbt = fbt_probetab[FBT_ADDR2NDX(addr)]; | ||||
for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { | for (; fbt != NULL; fbt = fbt->fbtp_hashnext) { | ||||
if ((uintptr_t)fbt->fbtp_patchpoint == addr) { | if ((uintptr_t)fbt->fbtp_patchpoint == addr) { | ||||
cpu->cpu_dtrace_caller = addr; | cpu->cpu_dtrace_caller = addr; | ||||
if (fbt->fbtp_roffset == 0) { | |||||
dtrace_probe(fbt->fbtp_id, frame->tf_a[0], | dtrace_probe(fbt->fbtp_id, frame->tf_a[0], | ||||
frame->tf_a[1], frame->tf_a[2], | frame->tf_a[1], frame->tf_a[2], | ||||
frame->tf_a[3], frame->tf_a[4]); | frame->tf_a[3], frame->tf_a[4]); | ||||
} else { | |||||
dtrace_probe(fbt->fbtp_id, fbt->fbtp_roffset, | |||||
frame->tf_a[0], 0, 0, 0); | |||||
} | |||||
cpu->cpu_dtrace_caller = 0; | cpu->cpu_dtrace_caller = 0; | ||||
return (fbt->fbtp_savedval); | return (fbt->fbtp_savedval); | ||||
} | } | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | again: | ||||
} | } | ||||
retfbt = fbt; | retfbt = fbt; | ||||
fbt->fbtp_patchpoint = instr; | fbt->fbtp_patchpoint = instr; | ||||
fbt->fbtp_ctl = lf; | fbt->fbtp_ctl = lf; | ||||
fbt->fbtp_loadcnt = lf->loadcnt; | fbt->fbtp_loadcnt = lf->loadcnt; | ||||
fbt->fbtp_symindx = symindx; | fbt->fbtp_symindx = symindx; | ||||
fbt->fbtp_rval = rval; | fbt->fbtp_rval = rval; | ||||
fbt->fbtp_roffset = (uintptr_t)instr - (uintptr_t)symval->value; | |||||
fbt->fbtp_savedval = *instr; | fbt->fbtp_savedval = *instr; | ||||
fbt->fbtp_patchval = patchval; | fbt->fbtp_patchval = patchval; | ||||
fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; | fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; | ||||
fbt_probetab[FBT_ADDR2NDX(instr)] = fbt; | fbt_probetab[FBT_ADDR2NDX(instr)] = fbt; | ||||
lf->fbt_nentries++; | lf->fbt_nentries++; | ||||
instr++; | instr++; | ||||
goto again; | goto again; | ||||
} | } |