Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/dev/fbt/riscv/fbt_isa.c
Show First 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | fbt_provide_module_function(linker_file_t lf, int symindx, | ||||
modname = opaque; | modname = opaque; | ||||
name = symval->name; | name = symval->name; | ||||
/* Check if function is excluded from instrumentation */ | /* Check if function is excluded from instrumentation */ | ||||
if (fbt_excluded(name)) | if (fbt_excluded(name)) | ||||
return (0); | return (0); | ||||
/* | |||||
* Some assembly-language exception handlers are not suitable for | |||||
* instrumentation. | |||||
*/ | |||||
if (strcmp(name, "cpu_exception_handler") == 0) | |||||
return (0); | |||||
if (strcmp(name, "cpu_exception_handler_user") == 0) | |||||
return (0); | |||||
if (strcmp(name, "cpu_exception_handler_supervisor") == 0) | |||||
return (0); | |||||
if (strcmp(name, "do_trap_supervisor") == 0) | |||||
return (0); | |||||
instr = (uint32_t *)(symval->value); | instr = (uint32_t *)(symval->value); | ||||
limit = (uint32_t *)(symval->value + symval->size); | limit = (uint32_t *)(symval->value + symval->size); | ||||
/* Look for sd operation */ | /* Look for sd operation */ | ||||
for (; instr < limit; instr++) { | for (; instr < limit; instr++) { | ||||
/* Look for a non-compressed store of ra to sp */ | /* Look for a non-compressed store of ra to sp */ | ||||
if (match_opcode(*instr, (MATCH_SD | RS2_RA | RS1_SP), | if (match_opcode(*instr, (MATCH_SD | RS2_RA | RS1_SP), | ||||
(MASK_SD | RS2_MASK | RS1_MASK))) { | (MASK_SD | RS2_MASK | RS1_MASK))) { | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |