blob: 4d3dbe3703e9001f53f65f64d38629bda6dedb63 [file] [log] [blame]
Ingo Molnarcdd6c482009-09-21 12:02:48 +02001#ifndef __ASM_SPARC_PERF_EVENT_H
2#define __ASM_SPARC_PERF_EVENT_H
3
Ingo Molnarcdd6c482009-09-21 12:02:48 +02004#ifdef CONFIG_PERF_EVENTS
Frederic Weisbeckerb0f82b82010-05-20 07:47:21 +02005#include <asm/ptrace.h>
6
David S. Millerb11287e2010-08-08 22:03:59 -07007#define perf_arch_fetch_caller_regs(regs, ip) \
8do { \
9 unsigned long _pstate, _asi, _pil, _i7, _fp; \
10 __asm__ __volatile__("rdpr %%pstate, %0\n\t" \
11 "rd %%asi, %1\n\t" \
12 "rdpr %%pil, %2\n\t" \
13 "mov %%i7, %3\n\t" \
14 "mov %%i6, %4\n\t" \
15 : "=r" (_pstate), \
16 "=r" (_asi), \
17 "=r" (_pil), \
18 "=r" (_i7), \
19 "=r" (_fp)); \
20 (regs)->tstate = (_pstate << 8) | \
21 (_asi << 24) | (_pil << 20); \
22 (regs)->tpc = (ip); \
23 (regs)->tnpc = (regs)->tpc + 4; \
24 (regs)->u_regs[UREG_I6] = _fp; \
25 (regs)->u_regs[UREG_I7] = _i7; \
26} while (0)
Ingo Molnarcdd6c482009-09-21 12:02:48 +020027#endif
28
29#endif