diff options
Diffstat (limited to 'arch/powerpc/include/asm/hw_irq.h')
| -rw-r--r-- | arch/powerpc/include/asm/hw_irq.h | 43 | 
1 files changed, 40 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h index b7e034b0a6d..867ab8ed69b 100644 --- a/arch/powerpc/include/asm/hw_irq.h +++ b/arch/powerpc/include/asm/hw_irq.h @@ -80,7 +80,7 @@ static inline void local_irq_disable(void)  	__asm__ __volatile__("wrteei 0": : :"memory");  #else  	unsigned long msr; -	__asm__ __volatile__("": : :"memory"); +  	msr = mfmsr();  	SET_MSR_EE(msr & ~MSR_EE);  #endif @@ -92,7 +92,7 @@ static inline void local_irq_enable(void)  	__asm__ __volatile__("wrteei 1": : :"memory");  #else  	unsigned long msr; -	__asm__ __volatile__("": : :"memory"); +  	msr = mfmsr();  	SET_MSR_EE(msr | MSR_EE);  #endif @@ -108,7 +108,6 @@ static inline void local_irq_save_ptr(unsigned long *flags)  #else  	SET_MSR_EE(msr & ~MSR_EE);  #endif -	__asm__ __volatile__("": : :"memory");  }  #define local_save_flags(flags)	((flags) = mfmsr()) @@ -131,5 +130,43 @@ static inline int irqs_disabled_flags(unsigned long flags)   */  struct irq_chip; +#ifdef CONFIG_PERF_COUNTERS + +#ifdef CONFIG_PPC64 +static inline unsigned long test_perf_counter_pending(void) +{ +	unsigned long x; + +	asm volatile("lbz %0,%1(13)" +		: "=r" (x) +		: "i" (offsetof(struct paca_struct, perf_counter_pending))); +	return x; +} + +static inline void set_perf_counter_pending(void) +{ +	asm volatile("stb %0,%1(13)" : : +		"r" (1), +		"i" (offsetof(struct paca_struct, perf_counter_pending))); +} + +static inline void clear_perf_counter_pending(void) +{ +	asm volatile("stb %0,%1(13)" : : +		"r" (0), +		"i" (offsetof(struct paca_struct, perf_counter_pending))); +} +#endif /* CONFIG_PPC64 */ + +#else  /* CONFIG_PERF_COUNTERS */ + +static inline unsigned long test_perf_counter_pending(void) +{ +	return 0; +} + +static inline void clear_perf_counter_pending(void) {} +#endif /* CONFIG_PERF_COUNTERS */ +  #endif	/* __KERNEL__ */  #endif	/* _ASM_POWERPC_HW_IRQ_H */  |