2 * MIPS specific _mcount support
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive for
8 * Copyright (C) 2009 Lemote Inc. & DSLab, Lanzhou University, China
9 * Author: Wu Zhangjin <wuzj@lemote.com>
12 #include <asm/regdef.h>
13 #include <asm/stackframe.h>
14 #include <asm/ftrace.h>
20 .macro MCOUNT_SAVE_REGS
36 .macro MCOUNT_RESTORE_REGS
52 PTR_ADDIU sp, (PT_SIZE + 8)
61 NESTED(_mcount, PT_SIZE, ra)
62 lw t0, function_trace_stop
65 PTR_LA t0, ftrace_stub
66 PTR_L t1, ftrace_trace_function /* Prepare t1 for (1) */
67 bne t0, t1, static_trace
75 move a0, ra /* arg1: next ip, selfaddr */
76 jalr t1 /* (1) call *ftrace_trace_function */
77 move a1, AT /* arg2: the caller's next ip, parent */