xref: /openbmc/linux/arch/arm/include/asm/perf_event.h (revision 7ae9fb1b7ecbb5d85d07857943f677fd1a559b18)
1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
27ada189fSJamie Iles /*
37ada189fSJamie Iles  *  linux/arch/arm/include/asm/perf_event.h
47ada189fSJamie Iles  *
57ada189fSJamie Iles  *  Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles
67ada189fSJamie Iles  */
77ada189fSJamie Iles 
87ada189fSJamie Iles #ifndef __ARM_PERF_EVENT_H__
97ada189fSJamie Iles #define __ARM_PERF_EVENT_H__
107ada189fSJamie Iles 
11d39976f0SMark Rutland #ifdef CONFIG_PERF_EVENTS
12e50c5418SMarc Zyngier struct pt_regs;
13e50c5418SMarc Zyngier extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
14e50c5418SMarc Zyngier extern unsigned long perf_misc_flags(struct pt_regs *regs);
15e50c5418SMarc Zyngier #define perf_misc_flags(regs)	perf_misc_flags(regs)
16c7cc504bSMarc Zyngier #endif
17e50c5418SMarc Zyngier 
18b3eac026SHou Pengyang #define perf_arch_fetch_caller_regs(regs, __ip) { \
19b3eac026SHou Pengyang 	(regs)->ARM_pc = (__ip); \
20*612695bcSTomislav Novak 	frame_pointer((regs)) = (unsigned long) __builtin_frame_address(0); \
21b3eac026SHou Pengyang 	(regs)->ARM_sp = current_stack_pointer; \
22b3eac026SHou Pengyang 	(regs)->ARM_cpsr = SVC_MODE; \
23b3eac026SHou Pengyang }
24b3eac026SHou Pengyang 
257ada189fSJamie Iles #endif /* __ARM_PERF_EVENT_H__ */
26