]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/ftrace.c
Merge branch 'core/softirq' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / ftrace.c
index c17373195b1e849306eb0127953e0862c49f6df6..4298d0aee7137caf896c6e20605620b1b58b0124 100644 (file)
@@ -5,6 +5,8 @@
 #include <linux/init.h>
 #include <linux/list.h>
 
+#include <asm/ftrace.h>
+
 static const u32 ftrace_nop = 0x01000000;
 
 notrace unsigned char *ftrace_nop_replace(void)
@@ -60,9 +62,9 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
 notrace int ftrace_update_ftrace_func(ftrace_func_t func)
 {
        unsigned long ip = (unsigned long)(&ftrace_call);
-       unsigned char old[4], *new;
+       unsigned char old[MCOUNT_INSN_SIZE], *new;
 
-       memcpy(old, &ftrace_call, 4);
+       memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE);
        new = ftrace_call_replace(ip, (unsigned long)func);
        return ftrace_modify_code(ip, old, new);
 }
@@ -71,13 +73,13 @@ notrace int ftrace_mcount_set(unsigned long *data)
 {
        unsigned long ip = (long)(&mcount_call);
        unsigned long *addr = data;
-       unsigned char old[4], *new;
+       unsigned char old[MCOUNT_INSN_SIZE], *new;
 
        /*
         * Replace the mcount stub with a pointer to the
         * ip recorder function.
         */
-       memcpy(old, &mcount_call, 4);
+       memcpy(old, &mcount_call, MCOUNT_INSN_SIZE);
        new = ftrace_call_replace(ip, *addr);
        *addr = ftrace_modify_code(ip, old, new);