summaryrefslogtreecommitdiff
path: root/arch/xtensa/kernel/mcount.S
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2013-07-25 12:30:27 +0200
committerJiri Kosina <jkosina@suse.cz>2013-07-25 12:30:49 +0200
commita3f8612700507a10ad7186fd77e9f46c7af88335 (patch)
treef00be0b726748113ffeb4e1caf7ade7ef33cfabe /arch/xtensa/kernel/mcount.S
parent8ecada16512c90ae782b00f15ebff0c32e4cd92a (diff)
parent07bc9dc1b01bad7084fed3d2659e5d83317869bc (diff)
Merge branch 'master' into for-next
Sync with Linus' master to be able to apply trivial patche to newer code. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'arch/xtensa/kernel/mcount.S')
-rw-r--r--arch/xtensa/kernel/mcount.S50
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/xtensa/kernel/mcount.S b/arch/xtensa/kernel/mcount.S
new file mode 100644
index 000000000000..0eeda2e4a25e
--- /dev/null
+++ b/arch/xtensa/kernel/mcount.S
@@ -0,0 +1,50 @@
+/*
+ * arch/xtensa/kernel/mcount.S
+ *
+ * Xtensa specific mcount support
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2013 Tensilica Inc.
+ */
+
+#include <linux/linkage.h>
+#include <asm/ftrace.h>
+
+/*
+ * Entry condition:
+ *
+ * a2: a0 of the caller
+ */
+
+ENTRY(_mcount)
+
+ entry a1, 16
+
+ movi a4, ftrace_trace_function
+ l32i a4, a4, 0
+ movi a3, ftrace_stub
+ bne a3, a4, 1f
+ retw
+
+1: xor a7, a2, a1
+ movi a3, 0x3fffffff
+ and a7, a7, a3
+ xor a7, a7, a1
+
+ xor a6, a0, a1
+ and a6, a6, a3
+ xor a6, a6, a1
+ addi a6, a6, -MCOUNT_INSN_SIZE
+ callx4 a4
+
+ retw
+
+ENDPROC(_mcount)
+
+ENTRY(ftrace_stub)
+ entry a1, 16
+ retw
+ENDPROC(ftrace_stub)