From: David Howells <dhowells@redhat.com>
To: linux-arch@vger.kernel.org
Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH 22/22] Fix Sparc irqflags
Date: Fri, 27 Aug 2010 03:00:58 +0100 [thread overview]
Message-ID: <20100827020058.27277.4560.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20100827015905.27277.39167.stgit@warthog.procyon.org.uk>
---
arch/sparc/include/asm/irqflags_32.h | 35 ++++++++++++++++++++--------------
arch/sparc/include/asm/irqflags_64.h | 29 +++++++++-------------------
arch/sparc/kernel/irq_32.c | 12 ++++++------
3 files changed, 36 insertions(+), 40 deletions(-)
diff --git a/arch/sparc/include/asm/irqflags_32.h b/arch/sparc/include/asm/irqflags_32.h
index 0fca9d9..081d130 100644
--- a/arch/sparc/include/asm/irqflags_32.h
+++ b/arch/sparc/include/asm/irqflags_32.h
@@ -5,33 +5,40 @@
*
* This file gets included from lowlevel asm headers too, to provide
* wrapped versions of the local_irq_*() APIs, based on the
- * raw_local_irq_*() functions from the lowlevel headers.
+ * arch_local_irq_*() functions from the lowlevel headers.
*/
#ifndef _ASM_IRQFLAGS_H
#define _ASM_IRQFLAGS_H
#ifndef __ASSEMBLY__
-extern void raw_local_irq_restore(unsigned long);
-extern unsigned long __raw_local_irq_save(void);
-extern void raw_local_irq_enable(void);
+#include <linux/types.h>
-static inline unsigned long getipl(void)
+extern void arch_local_irq_restore(unsigned long);
+extern unsigned long arch_local_irq_save(void);
+extern void arch_local_irq_enable(void);
+
+static inline unsigned long arch_local_save_flags(void)
{
- unsigned long retval;
+ unsigned long flags;
+
+ asm volatile("rd %%psr, %0" : "=r" (flags));
+ return flags;
+}
- __asm__ __volatile__("rd %%psr, %0" : "=r" (retval));
- return retval;
+static inline void arch_local_irq_disable(void)
+{
+ arch_local_irq_save();
}
-#define raw_local_save_flags(flags) ((flags) = getipl())
-#define raw_local_irq_save(flags) ((flags) = __raw_local_irq_save())
-#define raw_local_irq_disable() ((void) __raw_local_irq_save())
-#define raw_irqs_disabled() ((getipl() & PSR_PIL) != 0)
+static inline bool arch_irqs_disabled_flags(unsigned long flags)
+{
+ return (flags & PSR_PIL) != 0;
+}
-static inline int raw_irqs_disabled_flags(unsigned long flags)
+static inline bool arch_irqs_disabled(void)
{
- return ((flags & PSR_PIL) != 0);
+ return arch_irqs_disabled_flags(arch_local_save_flags());
}
#endif /* (__ASSEMBLY__) */
diff --git a/arch/sparc/include/asm/irqflags_64.h b/arch/sparc/include/asm/irqflags_64.h
index bfa1ea4..aab969c 100644
--- a/arch/sparc/include/asm/irqflags_64.h
+++ b/arch/sparc/include/asm/irqflags_64.h
@@ -5,7 +5,7 @@
*
* This file gets included from lowlevel asm headers too, to provide
* wrapped versions of the local_irq_*() APIs, based on the
- * raw_local_irq_*() functions from the lowlevel headers.
+ * arch_local_irq_*() functions from the lowlevel headers.
*/
#ifndef _ASM_IRQFLAGS_H
#define _ASM_IRQFLAGS_H
@@ -14,7 +14,7 @@
#ifndef __ASSEMBLY__
-static inline unsigned long __raw_local_save_flags(void)
+static inline unsigned long arch_local_save_flags(void)
{
unsigned long flags;
@@ -26,10 +26,7 @@ static inline unsigned long __raw_local_save_flags(void)
return flags;
}
-#define raw_local_save_flags(flags) \
- do { (flags) = __raw_local_save_flags(); } while (0)
-
-static inline void raw_local_irq_restore(unsigned long flags)
+static inline void arch_local_irq_restore(unsigned long flags)
{
__asm__ __volatile__(
"wrpr %0, %%pil"
@@ -39,7 +36,7 @@ static inline void raw_local_irq_restore(unsigned long flags)
);
}
-static inline void raw_local_irq_disable(void)
+static inline void arch_local_irq_disable(void)
{
__asm__ __volatile__(
"wrpr %0, %%pil"
@@ -49,7 +46,7 @@ static inline void raw_local_irq_disable(void)
);
}
-static inline void raw_local_irq_enable(void)
+static inline void arch_local_irq_enable(void)
{
__asm__ __volatile__(
"wrpr 0, %%pil"
@@ -59,22 +56,17 @@ static inline void raw_local_irq_enable(void)
);
}
-static inline int raw_irqs_disabled_flags(unsigned long flags)
+static inline int arch_irqs_disabled_flags(unsigned long flags)
{
return (flags > 0);
}
-static inline int raw_irqs_disabled(void)
+static inline int arch_irqs_disabled(void)
{
- unsigned long flags = __raw_local_save_flags();
-
- return raw_irqs_disabled_flags(flags);
+ return arch_irqs_disabled_flags(arch_local_save_flags());
}
-/*
- * For spinlocks, etc:
- */
-static inline unsigned long __raw_local_irq_save(void)
+static inline unsigned long arch_local_irq_save(void)
{
unsigned long flags, tmp;
@@ -100,9 +92,6 @@ static inline unsigned long __raw_local_irq_save(void)
return flags;
}
-#define raw_local_irq_save(flags) \
- do { (flags) = __raw_local_irq_save(); } while (0)
-
#endif /* (__ASSEMBLY__) */
#endif /* !(_ASM_IRQFLAGS_H) */
diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c
index e1af437..51bea83 100644
--- a/arch/sparc/kernel/irq_32.c
+++ b/arch/sparc/kernel/irq_32.c
@@ -57,7 +57,7 @@
#define SMP_NOP2
#define SMP_NOP3
#endif /* SMP */
-unsigned long __raw_local_irq_save(void)
+unsigned long arch_local_irq_save(void)
{
unsigned long retval;
unsigned long tmp;
@@ -75,7 +75,7 @@ unsigned long __raw_local_irq_save(void)
return retval;
}
-void raw_local_irq_enable(void)
+void arch_local_irq_enable(void)
{
unsigned long tmp;
@@ -90,7 +90,7 @@ void raw_local_irq_enable(void)
: "memory");
}
-void raw_local_irq_restore(unsigned long old_psr)
+void arch_local_irq_restore(unsigned long old_psr)
{
unsigned long tmp;
@@ -106,9 +106,9 @@ void raw_local_irq_restore(unsigned long old_psr)
: "memory");
}
-EXPORT_SYMBOL(__raw_local_irq_save);
-EXPORT_SYMBOL(raw_local_irq_enable);
-EXPORT_SYMBOL(raw_local_irq_restore);
+EXPORT_SYMBOL(arch_local_irq_save);
+EXPORT_SYMBOL(arch_local_irq_enable);
+EXPORT_SYMBOL(arch_local_irq_restore);
/*
* Dave Redman (djhr@tadpole.co.uk)
next prev parent reply other threads:[~2010-08-27 2:00 UTC|newest]
Thread overview: 94+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-27 1:59 [PATCH 00/22] Name the irq flag handling functions sanely David Howells
2010-08-27 1:59 ` [PATCH 01/22] Alpha: Fix a missing comma in sys_osf_statfs() David Howells
2010-08-27 1:59 ` David Howells
2010-08-27 1:59 ` [PATCH 02/22] Blackfin: Split PLL code from mach-specific cdef headers David Howells
2010-08-27 1:59 ` [PATCH 03/22] Blackfin: Don't redefine blackfin serial port symbols David Howells
2010-08-27 1:59 ` [PATCH 04/22] Blackfin: Split the BF532 BFIN_*_FIO_FLAG() functions to their own header David Howells
2010-08-27 1:59 ` David Howells
2010-08-27 1:59 ` [PATCH 05/22] Blackfin: Rename DES PC2() symbol to avoid collision David Howells
2010-08-27 1:59 ` David Howells
2010-08-27 1:59 ` [PATCH 06/22] Blackfin: Add missing dep to asm/irqflags.h David Howells
2010-08-27 1:59 ` David Howells
2010-08-27 1:59 ` [PATCH 07/22] Blackfin: Rename IRQ flags handling functions David Howells
2010-08-27 1:59 ` [PATCH 08/22] h8300: IRQ flags should be stored in an unsigned long David Howells
2010-08-27 1:59 ` [PATCH 09/22] h8300: Fix die() David Howells
2010-08-27 1:59 ` [PATCH 10/22] h8300: Fix missing consts in kernel_execve() David Howells
2010-08-27 1:59 ` David Howells
2010-08-27 2:00 ` [PATCH 11/22] SH: Add missing consts to sys_execve() declaration David Howells
2010-08-27 2:00 ` [PATCH 12/22] Fix IRQ flag handling naming David Howells
2010-08-27 2:00 ` David Howells
2010-08-27 2:00 ` [PATCH 13/22] MIPS: Fix IRQ flags handling David Howells
2010-08-27 2:00 ` David Howells
2010-08-27 2:00 ` [PATCH 14/22] Fix Alpha irqflags David Howells
2010-08-27 2:00 ` David Howells
2010-08-27 2:00 ` [PATCH 15/22] Fix H8300 arch David Howells
2010-08-27 2:00 ` David Howells
2010-08-27 2:00 ` [PATCH 16/22] Fix IA64 irqflags David Howells
2010-08-27 2:00 ` David Howells
2010-08-27 2:00 ` [PATCH 17/22] Fix m32r irqflags David Howells
2010-08-27 2:00 ` David Howells
2010-08-27 2:00 ` [PATCH 18/22] Fix M68K irqflags David Howells
2010-08-27 2:00 ` David Howells
2010-08-30 7:12 ` Greg Ungerer
2010-08-30 7:12 ` Greg Ungerer
2010-08-30 20:50 ` David Howells
2010-08-31 7:36 ` Geert Uytterhoeven
2010-08-31 16:00 ` David Howells
2010-09-01 6:38 ` Greg Ungerer
2010-09-01 6:33 ` Greg Ungerer
2010-09-01 10:43 ` David Howells
2010-09-01 10:43 ` David Howells
2010-09-01 11:21 ` Greg Ungerer
2010-09-01 10:46 ` David Howells
2010-09-01 11:22 ` Greg Ungerer
2010-09-01 11:31 ` David Howells
2010-09-01 11:30 ` David Howells
2010-09-01 11:36 ` Greg Ungerer
2010-09-01 12:03 ` David Howells
2010-09-02 1:46 ` Greg Ungerer
2010-09-02 10:20 ` David Howells
2010-09-02 10:21 ` [PATCH 1/3] Drop a couple of unnecessary asm/include.h inclusions David Howells
2010-09-03 1:29 ` Greg Ungerer
2010-09-02 10:21 ` [PATCH 2/3] M68K: Use CONFIG_MMU not __uClinux__ to select m68knommu contributions David Howells
2010-09-02 10:21 ` David Howells
2010-09-02 13:54 ` Sam Ravnborg
2010-09-02 14:15 ` Andreas Schwab
2010-09-03 3:29 ` Greg Ungerer
2010-09-02 14:21 ` Andreas Schwab
2010-09-02 19:53 ` Geert Uytterhoeven
2010-09-03 3:30 ` Greg Ungerer
2010-09-03 3:30 ` Greg Ungerer
2010-09-03 8:41 ` Andreas Schwab
2010-09-03 9:18 ` David Howells
2010-09-03 9:31 ` Greg Ungerer
2010-09-03 9:33 ` Geert Uytterhoeven
2010-09-03 9:52 ` David Howells
2010-09-03 10:02 ` Geert Uytterhoeven
2010-09-03 10:41 ` Greg Ungerer
2010-09-03 10:41 ` Greg Ungerer
2010-09-02 15:11 ` David Howells
2010-09-02 15:12 ` David Howells
2010-09-02 15:12 ` David Howells
2010-09-02 16:50 ` Sam Ravnborg
2010-09-02 10:22 ` [PATCH 3/3] Fix M68K irqflags David Howells
2010-09-02 10:22 ` David Howells
2010-09-03 1:28 ` Greg Ungerer
2010-09-03 6:44 ` David Howells
2010-09-03 6:53 ` Greg Ungerer
2010-09-03 7:28 ` David Howells
2010-09-03 8:05 ` David Howells
2010-09-03 8:05 ` David Howells
2010-09-03 9:28 ` Greg Ungerer
2010-09-03 10:05 ` David Howells
2010-09-03 10:38 ` Greg Ungerer
2010-09-02 10:48 ` [PATCH 1/3] Drop a couple of unnecessary asm/include.h inclusions David Howells
2010-08-27 2:00 ` [PATCH 19/22] Fix PA-RISC irqflags David Howells
2010-09-03 1:40 ` Kyle McMartin
2010-09-03 6:48 ` David Howells
2010-09-03 13:31 ` Kyle McMartin
2010-08-27 2:00 ` [PATCH 20/22] Fix powerpc irqflags David Howells
2010-08-27 2:00 ` David Howells
2010-08-27 2:00 ` [PATCH 21/22] Fix SH irqflags David Howells
2010-08-27 2:00 ` David Howells
2010-08-27 2:00 ` David Howells [this message]
2010-08-27 2:00 ` [PATCH 22/22] Fix Sparc irqflags David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100827020058.27277.4560.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).