aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/pcr.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/pcr.c')
-rw-r--r--arch/sparc/kernel/pcr.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c
index 1ae8cdd7e703..68ff00107073 100644
--- a/arch/sparc/kernel/pcr.c
+++ b/arch/sparc/kernel/pcr.c
@@ -7,6 +7,8 @@
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_counter.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>
@@ -34,10 +36,20 @@ unsigned int picl_shift;
34 */ 36 */
35void deferred_pcr_work_irq(int irq, struct pt_regs *regs) 37void 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_COUNTERS
46 perf_counter_do_pending();
47#endif
48 irq_exit();
49 set_irq_regs(old_regs);
38} 50}
39 51
40void schedule_deferred_pcr_work(void) 52void set_perf_counter_pending(void)
41{ 53{
42 set_softint(1 << PIL_DEFERRED_PCR_WORK); 54 set_softint(1 << PIL_DEFERRED_PCR_WORK);
43} 55}