int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
{
unsigned long pc = rec->ip;
- long offset = (long)pc - (long)addr;
u32 old, new;
- if (IS_ENABLED(CONFIG_ARM64_MODULE_PLTS) &&
- (offset < -SZ_128M || offset >= SZ_128M)) {
+#ifdef CONFIG_ARM64_MODULE_PLTS
+ long offset = (long)pc - (long)addr;
+
+ if (offset < -SZ_128M || offset >= SZ_128M) {
unsigned long *trampoline;
struct module *mod;
}
addr = (unsigned long)&trampoline[1];
}
+#endif /* CONFIG_ARM64_MODULE_PLTS */
old = aarch64_insn_gen_nop();
new = aarch64_insn_gen_branch_imm(pc, addr, AARCH64_INSN_BRANCH_LINK);
unsigned long addr)
{
unsigned long pc = rec->ip;
- long offset = (long)pc - (long)addr;
bool validate = true;
u32 old = 0, new;
- if (IS_ENABLED(CONFIG_ARM64_MODULE_PLTS) &&
- (offset < -SZ_128M || offset >= SZ_128M)) {
+#ifdef CONFIG_ARM64_MODULE_PLTS
+ long offset = (long)pc - (long)addr;
+
+ if (offset < -SZ_128M || offset >= SZ_128M) {
u32 replaced;
/*
old = aarch64_insn_gen_branch_imm(pc, addr,
AARCH64_INSN_BRANCH_LINK);
}
+#endif /* CONFIG_ARM64_MODULE_PLTS */
new = aarch64_insn_gen_nop();