Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/dev/fbt/aarch64/fbt_isa.c
| Show All 38 Lines | |||||
| #include "fbt.h" | #include "fbt.h" | ||||
| #define AARCH64_BRK 0xd4200000 | #define AARCH64_BRK 0xd4200000 | ||||
| #define AARCH64_BRK_IMM16_SHIFT 5 | #define AARCH64_BRK_IMM16_SHIFT 5 | ||||
| #define AARCH64_BRK_IMM16_VAL (0x40d << AARCH64_BRK_IMM16_SHIFT) | #define AARCH64_BRK_IMM16_VAL (0x40d << AARCH64_BRK_IMM16_SHIFT) | ||||
| #define FBT_PATCHVAL (AARCH64_BRK | AARCH64_BRK_IMM16_VAL) | #define FBT_PATCHVAL (AARCH64_BRK | AARCH64_BRK_IMM16_VAL) | ||||
| #define FBT_ENTRY "entry" | #define FBT_ENTRY "entry" | ||||
| #define FBT_RETURN "return" | #define FBT_RETURN "return" | ||||
| #define FBT_AFRAMES 4 | |||||
| int | int | ||||
| fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) | fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) | ||||
| { | { | ||||
| solaris_cpu_t *cpu; | solaris_cpu_t *cpu; | ||||
| fbt_probe_t *fbt; | fbt_probe_t *fbt; | ||||
| cpu = &solaris_cpu[curcpu]; | cpu = &solaris_cpu[curcpu]; | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | fbt_provide_module_function(linker_file_t lf, int symindx, | ||||
| } | } | ||||
| if (!found) | if (!found) | ||||
| return (0); | return (0); | ||||
| fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); | fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); | ||||
| fbt->fbtp_name = name; | fbt->fbtp_name = name; | ||||
| fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, | fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, | ||||
| name, FBT_ENTRY, 3, fbt); | name, FBT_ENTRY, FBT_AFRAMES, 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_savedval = *instr; | fbt->fbtp_savedval = *instr; | ||||
| fbt->fbtp_patchval = FBT_PATCHVAL; | fbt->fbtp_patchval = FBT_PATCHVAL; | ||||
| if ((*instr & SUB_MASK) == SUB_INSTR) | if ((*instr & SUB_MASK) == SUB_INSTR) | ||||
| fbt->fbtp_rval = DTRACE_INVOP_SUB; | fbt->fbtp_rval = DTRACE_INVOP_SUB; | ||||
| else | else | ||||
| Show All 25 Lines | again: | ||||
| /* | /* | ||||
| * We have a winner! | * We have a winner! | ||||
| */ | */ | ||||
| fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); | fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); | ||||
| fbt->fbtp_name = name; | fbt->fbtp_name = name; | ||||
| if (retfbt == NULL) { | if (retfbt == NULL) { | ||||
| fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, | fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, | ||||
| name, FBT_RETURN, 3, fbt); | name, FBT_RETURN, FBT_AFRAMES, fbt); | ||||
| } else { | } else { | ||||
| retfbt->fbtp_probenext = fbt; | retfbt->fbtp_probenext = fbt; | ||||
| fbt->fbtp_id = retfbt->fbtp_id; | fbt->fbtp_id = retfbt->fbtp_id; | ||||
| } | } | ||||
| retfbt = fbt; | retfbt = fbt; | ||||
| fbt->fbtp_patchpoint = instr; | fbt->fbtp_patchpoint = instr; | ||||
| fbt->fbtp_ctl = lf; | fbt->fbtp_ctl = lf; | ||||
| Show All 16 Lines | |||||