summaryrefslogtreecommitdiffstats
path: root/include/asm-sh/system.h
diff options
context:
space:
mode:
authorPaul Mundt2006-09-27 09:01:12 +0200
committerPaul Mundt2006-09-27 09:01:12 +0200
commitf1517494407b1f1ca0063a756cc30d75e96d433c (patch)
treefe7827210e76750687de601e6b0695a4e4e16fa7 /include/asm-sh/system.h
parentsh: Add support for R7780RP and R7780MP boards. (diff)
downloadkernel-qcow2-linux-f1517494407b1f1ca0063a756cc30d75e96d433c.tar.gz
kernel-qcow2-linux-f1517494407b1f1ca0063a756cc30d75e96d433c.tar.xz
kernel-qcow2-linux-f1517494407b1f1ca0063a756cc30d75e96d433c.zip
sh: Cleanup and document register bank usage.
Initial register bank cleanup. Make SR.RB configurable, and add some preliminary documentation on register bank usage within the kernel. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/system.h')
-rw-r--r--include/asm-sh/system.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index 1630a5411e5f..198d17e3069a 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -136,7 +136,8 @@ extern void __xchg_called_with_bad_pointer(void);
#define set_mb(var, value) do { xchg(&var, value); } while (0)
/* Interrupt Control */
-static __inline__ void local_irq_enable(void)
+#ifdef CONFIG_CPU_HAS_SR_RB
+static inline void local_irq_enable(void)
{
unsigned long __dummy0, __dummy1;
@@ -149,6 +150,20 @@ static __inline__ void local_irq_enable(void)
: "1" (~0x000000f0)
: "memory");
}
+#else
+static inline void local_irq_enable(void)
+{
+ unsigned long __dummy0, __dummy1;
+
+ __asm__ __volatile__ (
+ "stc sr, %0\n\t"
+ "and %1, %0\n\t"
+ "ldc %0, sr\n\t"
+ : "=&r" (__dummy0), "=r" (__dummy1)
+ : "1" (~0x000000f0)
+ : "memory");
+}
+#endif
static __inline__ void local_irq_disable(void)
{