sparc64: Fix perf_arch_get_caller_regs().
[linux-2.6/libata-dev.git] / arch / sparc / include / asm / perf_event.h
blob727af70646cbddff92f36e6c47ad782c9018ea11
1 #ifndef __ASM_SPARC_PERF_EVENT_H
2 #define __ASM_SPARC_PERF_EVENT_H
4 extern void set_perf_event_pending(void);
6 #define PERF_EVENT_INDEX_OFFSET 0
8 #ifdef CONFIG_PERF_EVENTS
9 #include <asm/ptrace.h>
11 extern void init_hw_perf_events(void);
13 #define perf_arch_fetch_caller_regs(regs, ip) \
14 do { \
15 unsigned long _pstate, _asi, _pil, _i7, _fp; \
16 __asm__ __volatile__("rdpr %%pstate, %0\n\t" \
17 "rd %%asi, %1\n\t" \
18 "rdpr %%pil, %2\n\t" \
19 "mov %%i7, %3\n\t" \
20 "mov %%i6, %4\n\t" \
21 : "=r" (_pstate), \
22 "=r" (_asi), \
23 "=r" (_pil), \
24 "=r" (_i7), \
25 "=r" (_fp)); \
26 (regs)->tstate = (_pstate << 8) | \
27 (_asi << 24) | (_pil << 20); \
28 (regs)->tpc = (ip); \
29 (regs)->tnpc = (regs)->tpc + 4; \
30 (regs)->u_regs[UREG_I6] = _fp; \
31 (regs)->u_regs[UREG_I7] = _i7; \
32 } while (0)
33 #else
34 static inline void init_hw_perf_events(void) { }
35 #endif
37 #endif