xref: /linux/arch/arm64/include/asm/ftrace.h (revision bd7d38dbdf356e75eb3b1699158c9b8021fd6784)
1819e50e2SAKASHI Takahiro /*
2819e50e2SAKASHI Takahiro  * arch/arm64/include/asm/ftrace.h
3819e50e2SAKASHI Takahiro  *
4819e50e2SAKASHI Takahiro  * Copyright (C) 2013 Linaro Limited
5819e50e2SAKASHI Takahiro  * Author: AKASHI Takahiro <takahiro.akashi@linaro.org>
6819e50e2SAKASHI Takahiro  *
7819e50e2SAKASHI Takahiro  * This program is free software; you can redistribute it and/or modify
8819e50e2SAKASHI Takahiro  * it under the terms of the GNU General Public License version 2 as
9819e50e2SAKASHI Takahiro  * published by the Free Software Foundation.
10819e50e2SAKASHI Takahiro  */
11819e50e2SAKASHI Takahiro #ifndef __ASM_FTRACE_H
12819e50e2SAKASHI Takahiro #define __ASM_FTRACE_H
13819e50e2SAKASHI Takahiro 
14819e50e2SAKASHI Takahiro #include <asm/insn.h>
15819e50e2SAKASHI Takahiro 
16819e50e2SAKASHI Takahiro #define MCOUNT_ADDR		((unsigned long)_mcount)
17819e50e2SAKASHI Takahiro #define MCOUNT_INSN_SIZE	AARCH64_INSN_SIZE
18819e50e2SAKASHI Takahiro 
19819e50e2SAKASHI Takahiro #ifndef __ASSEMBLY__
20819e50e2SAKASHI Takahiro extern void _mcount(unsigned long);
21*bd7d38dbSAKASHI Takahiro 
22*bd7d38dbSAKASHI Takahiro struct dyn_arch_ftrace {
23*bd7d38dbSAKASHI Takahiro 	/* No extra data needed for arm64 */
24*bd7d38dbSAKASHI Takahiro };
25*bd7d38dbSAKASHI Takahiro 
26*bd7d38dbSAKASHI Takahiro extern unsigned long ftrace_graph_call;
27*bd7d38dbSAKASHI Takahiro 
28*bd7d38dbSAKASHI Takahiro static inline unsigned long ftrace_call_adjust(unsigned long addr)
29*bd7d38dbSAKASHI Takahiro {
30*bd7d38dbSAKASHI Takahiro 	/*
31*bd7d38dbSAKASHI Takahiro 	 * addr is the address of the mcount call instruction.
32*bd7d38dbSAKASHI Takahiro 	 * recordmcount does the necessary offset calculation.
33*bd7d38dbSAKASHI Takahiro 	 */
34*bd7d38dbSAKASHI Takahiro 	return addr;
35*bd7d38dbSAKASHI Takahiro }
36819e50e2SAKASHI Takahiro #endif /* __ASSEMBLY__ */
37819e50e2SAKASHI Takahiro 
38819e50e2SAKASHI Takahiro #endif /* __ASM_FTRACE_H */
39