linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] powerpc: Add __hard_irqs_disabled()
@ 2017-05-16  9:26 Aneesh Kumar K.V
  2017-05-16  9:26 ` [PATCH 2/3] powerpc/mm: Rename find_linux_pte_or_hugepte Aneesh Kumar K.V
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Aneesh Kumar K.V @ 2017-05-16  9:26 UTC (permalink / raw)
  To: benh, paulus, mpe, Frederic Barrat; +Cc: linuxppc-dev, Aneesh Kumar K.V

Add __hard_irqs_disabled() similar to arch_irqs_disabled to check whether irqs
are hard disabled.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/hw_irq.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index eba60416536e..541bd42f902f 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -88,6 +88,12 @@ static inline bool arch_irqs_disabled(void)
 	return arch_irqs_disabled_flags(arch_local_save_flags());
 }
 
+static inline bool __hard_irqs_disabled(void)
+{
+	unsigned long flags = mfmsr();
+	return (flags & MSR_EE) == 0;
+}
+
 #ifdef CONFIG_PPC_BOOK3E
 #define __hard_irq_enable()	asm volatile("wrteei 1" : : : "memory")
 #define __hard_irq_disable()	asm volatile("wrteei 0" : : : "memory")
@@ -197,6 +203,7 @@ static inline bool arch_irqs_disabled(void)
 }
 
 #define hard_irq_disable()		arch_local_irq_disable()
+#define __hard_irqs_disabled()		arch_irqs_disabled()
 
 static inline bool arch_irq_disabled_regs(struct pt_regs *regs)
 {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-05-30  3:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-16  9:26 [PATCH 1/3] powerpc: Add __hard_irqs_disabled() Aneesh Kumar K.V
2017-05-16  9:26 ` [PATCH 2/3] powerpc/mm: Rename find_linux_pte_or_hugepte Aneesh Kumar K.V
2017-05-16 11:22   ` Benjamin Herrenschmidt
2017-05-17  3:27     ` Aneesh Kumar K.V
2017-05-17  4:57       ` Benjamin Herrenschmidt
2017-05-17  5:30         ` Madhavan Srinivasan
2017-05-29 14:32         ` Aneesh Kumar K.V
2017-05-30  3:21           ` Benjamin Herrenschmidt
2017-05-16  9:26 ` [PATCH 3/3] powerpc/mm: Don't send IPI to all cpus on THP updates Aneesh Kumar K.V
2017-05-16 11:22 ` [PATCH 1/3] powerpc: Add __hard_irqs_disabled() Benjamin Herrenschmidt
2017-05-17 11:04 ` Balbir Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).