Commit b5cfeac9 authored by Paul Mundt's avatar Paul Mundt

sh: Provide ftrace_make_call()/ftrace_make_nop().

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 4bc3e719
/* /*
* Copyright (C) 2008 Matt Fleming <mjf@gentoo.org> * Copyright (C) 2008 Matt Fleming <mjf@gentoo.org>
* Copyright (C) 2008 Paul Mundt <lethal@linux-sh.org>
* *
* Code for replacing ftrace calls with jumps. * Code for replacing ftrace calls with jumps.
* *
...@@ -100,6 +101,29 @@ int ftrace_update_ftrace_func(ftrace_func_t func) ...@@ -100,6 +101,29 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
return ftrace_modify_code(ip + MCOUNT_INSN_OFFSET, old, new); return ftrace_modify_code(ip + MCOUNT_INSN_OFFSET, old, new);
} }
int ftrace_make_nop(struct module *mod,
struct dyn_ftrace *rec, unsigned long addr)
{
unsigned char *new, *old;
unsigned long ip = rec->ip;
old = ftrace_call_replace(ip, addr);
new = ftrace_nop_replace();
return ftrace_modify_code(rec->ip, old, new);
}
int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
{
unsigned char *new, *old;
unsigned long ip = rec->ip;
old = ftrace_nop_replace();
new = ftrace_call_replace(ip, addr);
return ftrace_modify_code(rec->ip, old, new);
}
int __init ftrace_dyn_arch_init(void *data) int __init ftrace_dyn_arch_init(void *data)
{ {
/* The return code is retured via data */ /* The return code is retured via data */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment