]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/ftrace.c
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / ftrace.c
index f449e6df6c4a492c62df58e68e8ab71201dc5c6d..4298d0aee7137caf896c6e20605620b1b58b0124 100644 (file)
@@ -5,14 +5,9 @@
 #include <linux/init.h>
 #include <linux/list.h>
 
-static const u32 ftrace_nop = 0x01000000;
-
-notrace int ftrace_ip_converted(unsigned long ip)
-{
-       u32 insn = *(u32 *) ip;
+#include <asm/ftrace.h>
 
-       return (insn == ftrace_nop);
-}
+static const u32 ftrace_nop = 0x01000000;
 
 notrace unsigned char *ftrace_nop_replace(void)
 {
@@ -67,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);
 }
@@ -78,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);