Merge tag 'locks-v3.16-2' of git://git.samba.org/jlayton/linux
[linux/fpc-iii.git] / arch / powerpc / include / asm / perf_event.h
blob0bb23725b1e721a0d5e89f23db233f15b8a9b3ac
1 /*
2 * Performance event support - hardware-specific disambiguation
4 * For now this is a compile-time decision, but eventually it should be
5 * runtime. This would allow multiplatform perf event support for e300 (fsl
6 * embedded perf counters) plus server/classic, and would accommodate
7 * devices other than the core which provide their own performance counters.
9 * Copyright 2010 Freescale Semiconductor, Inc.
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
17 #ifdef CONFIG_PPC_PERF_CTRS
18 #include <asm/perf_event_server.h>
19 #endif
21 #ifdef CONFIG_FSL_EMB_PERF_EVENT
22 #include <asm/perf_event_fsl_emb.h>
23 #endif
25 #ifdef CONFIG_PERF_EVENTS
26 #include <asm/ptrace.h>
27 #include <asm/reg.h>
30 * Overload regs->result to specify whether we should use the MSR (result
31 * is zero) or the SIAR (result is non zero).
33 #define perf_arch_fetch_caller_regs(regs, __ip) \
34 do { \
35 (regs)->result = 0; \
36 (regs)->nip = __ip; \
37 (regs)->gpr[1] = *(unsigned long *)__get_SP(); \
38 asm volatile("mfmsr %0" : "=r" ((regs)->msr)); \
39 } while (0)
40 #endif