2 * arch/xtensa/kernel/mcount.S
4 * Xtensa specific mcount support
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
10 * Copyright (C) 2013 Tensilica Inc.
13 #include <linux/linkage.h>
14 #include <asm/asmmacro.h>
15 #include <asm/ftrace.h>
20 * a2: a0 of the caller in windowed ABI
21 * a10: a0 of the caller in call0 ABI
23 * In call0 ABI the function _mcount is called with the special ABI:
24 * its argument is in a10 and all the usual argument registers (a2 - a7)
25 * must be preserved in addition to callee-saved a12 - a15.
29 #if defined(__XTENSA_WINDOWED_ABI__)
32 movi a4, ftrace_trace_function
46 addi a6, a6, -MCOUNT_INSN_SIZE
50 #elif defined(__XTENSA_CALL0_ABI__)
53 movi a9, ftrace_trace_function
67 addi a2, a10, -MCOUNT_INSN_SIZE
78 #error Unsupported Xtensa ABI
81 EXPORT_SYMBOL(_mcount)