diff options
Diffstat (limited to 'arch/sparc/kernel/pcr.c')
| -rw-r--r-- | arch/sparc/kernel/pcr.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c index 1ae8cdd7e703..2d94e7a03af5 100644 --- a/arch/sparc/kernel/pcr.c +++ b/arch/sparc/kernel/pcr.c | |||
| @@ -7,13 +7,15 @@ | |||
| 7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
| 8 | #include <linux/irq.h> | 8 | #include <linux/irq.h> |
| 9 | 9 | ||
| 10 | #include <linux/perf_event.h> | ||
| 11 | |||
| 10 | #include <asm/pil.h> | 12 | #include <asm/pil.h> |
| 11 | #include <asm/pcr.h> | 13 | #include <asm/pcr.h> |
| 12 | #include <asm/nmi.h> | 14 | #include <asm/nmi.h> |
| 13 | 15 | ||
| 14 | /* This code is shared between various users of the performance | 16 | /* This code is shared between various users of the performance |
| 15 | * counters. Users will be oprofile, pseudo-NMI watchdog, and the | 17 | * counters. Users will be oprofile, pseudo-NMI watchdog, and the |
| 16 | * perf_counter support layer. | 18 | * perf_event support layer. |
| 17 | */ | 19 | */ |
| 18 | 20 | ||
| 19 | #define PCR_SUN4U_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE) | 21 | #define PCR_SUN4U_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE) |
| @@ -34,10 +36,20 @@ unsigned int picl_shift; | |||
| 34 | */ | 36 | */ |
| 35 | void deferred_pcr_work_irq(int irq, struct pt_regs *regs) | 37 | void deferred_pcr_work_irq(int irq, struct pt_regs *regs) |
| 36 | { | 38 | { |
| 39 | struct pt_regs *old_regs; | ||
| 40 | |||
| 37 | clear_softint(1 << PIL_DEFERRED_PCR_WORK); | 41 | clear_softint(1 << PIL_DEFERRED_PCR_WORK); |
| 42 | |||
| 43 | old_regs = set_irq_regs(regs); | ||
| 44 | irq_enter(); | ||
| 45 | #ifdef CONFIG_PERF_EVENTS | ||
| 46 | perf_event_do_pending(); | ||
| 47 | #endif | ||
| 48 | irq_exit(); | ||
| 49 | set_irq_regs(old_regs); | ||
| 38 | } | 50 | } |
| 39 | 51 | ||
| 40 | void schedule_deferred_pcr_work(void) | 52 | void set_perf_event_pending(void) |
| 41 | { | 53 | { |
| 42 | set_softint(1 << PIL_DEFERRED_PCR_WORK); | 54 | set_softint(1 << PIL_DEFERRED_PCR_WORK); |
| 43 | } | 55 | } |
