Lines Matching refs:pc
15 static int ftrace_modify_code(unsigned long pc, u32 old, u32 new, bool validate) in ftrace_modify_code() argument
20 if (larch_insn_read((void *)pc, &replaced)) in ftrace_modify_code()
27 if (larch_insn_patch_text((void *)pc, new)) in ftrace_modify_code()
34 static bool reachable_by_bl(unsigned long addr, unsigned long pc) in reachable_by_bl() argument
36 long offset = (long)addr - (long)pc; in reachable_by_bl()
65 unsigned long pc = rec->ip + LOONGARCH_INSN_SIZE; in ftrace_find_callable_addr() local
73 if (*addr != FTRACE_ADDR && *addr != FTRACE_REGS_ADDR && !reachable_by_bl(*addr, pc)) in ftrace_find_callable_addr()
80 if (reachable_by_bl(*addr, pc)) in ftrace_find_callable_addr()
94 mod = __module_text_address(pc); in ftrace_find_callable_addr()
121 unsigned long pc; in ftrace_modify_call() local
123 pc = rec->ip + LOONGARCH_INSN_SIZE; in ftrace_modify_call()
131 new = larch_insn_gen_bl(pc, addr); in ftrace_modify_call()
132 old = larch_insn_gen_bl(pc, old_addr); in ftrace_modify_call()
134 return ftrace_modify_code(pc, old, new, true); in ftrace_modify_call()
141 unsigned long pc; in ftrace_update_ftrace_func() local
143 pc = (unsigned long)&ftrace_call; in ftrace_update_ftrace_func()
144 new = larch_insn_gen_bl(pc, (unsigned long)func); in ftrace_update_ftrace_func()
146 return ftrace_modify_code(pc, 0, new, false); in ftrace_update_ftrace_func()
173 unsigned long pc; in ftrace_init_nop() local
175 pc = rec->ip; in ftrace_init_nop()
179 return ftrace_modify_code(pc, old, new, true); in ftrace_init_nop()
185 unsigned long pc; in ftrace_make_call() local
187 pc = rec->ip + LOONGARCH_INSN_SIZE; in ftrace_make_call()
193 new = larch_insn_gen_bl(pc, addr); in ftrace_make_call()
195 return ftrace_modify_code(pc, old, new, true); in ftrace_make_call()
201 unsigned long pc; in ftrace_make_nop() local
203 pc = rec->ip + LOONGARCH_INSN_SIZE; in ftrace_make_nop()
209 old = larch_insn_gen_bl(pc, addr); in ftrace_make_nop()
211 return ftrace_modify_code(pc, old, new, true); in ftrace_make_nop()
253 unsigned long pc, func; in ftrace_modify_graph_caller() local
256 pc = (unsigned long)&ftrace_graph_call; in ftrace_modify_graph_caller()
260 branch = larch_insn_gen_b(pc, func); in ftrace_modify_graph_caller()
263 return ftrace_modify_code(pc, nop, branch, true); in ftrace_modify_graph_caller()
265 return ftrace_modify_code(pc, branch, nop, true); in ftrace_modify_graph_caller()