blob: 41e8670db20f6403a9d3616a56370da1f0ec326f [file] [log] [blame]
AKASHI Takahirofc0c9392014-04-30 18:54:33 +09001/*
2 * arch/arm64/include/asm/ftrace.h
3 *
4 * Copyright (C) 2013 Linaro Limited
5 * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef __ASM_FTRACE_H
12#define __ASM_FTRACE_H
13
14#include <asm/insn.h>
15
16#define MCOUNT_ADDR ((unsigned long)_mcount)
17#define MCOUNT_INSN_SIZE AARCH64_INSN_SIZE
18
19#ifndef __ASSEMBLY__
20extern void _mcount(unsigned long);
AKASHI Takahiroea764652014-04-30 18:54:35 +090021extern void *return_address(unsigned int);
AKASHI Takahiro95d7e552014-04-30 18:54:34 +090022
23struct dyn_arch_ftrace {
24 /* No extra data needed for arm64 */
25};
26
27extern unsigned long ftrace_graph_call;
28
29static inline unsigned long ftrace_call_adjust(unsigned long addr)
30{
31 /*
32 * addr is the address of the mcount call instruction.
33 * recordmcount does the necessary offset calculation.
34 */
35 return addr;
36}
AKASHI Takahiroea764652014-04-30 18:54:35 +090037
38#define ftrace_return_address(n) return_address(n)
39#endif /* ifndef __ASSEMBLY__ */
AKASHI Takahirofc0c9392014-04-30 18:54:33 +090040
41#endif /* __ASM_FTRACE_H */