From 03fdb708926d5df2d9b9e62222c1666e20caa9e3 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Sat, 17 Oct 2009 21:06:39 +0900 Subject: sh: Convert to asm-generic/irqflags.h. This simplifies the irqflags support by switching over to the asm-generic version. The necessary support functions are brought out-of-line for both SHcompact and SHmedia instruction sets. Signed-off-by: Paul Mundt --- arch/sh/kernel/irq_32.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 arch/sh/kernel/irq_32.c (limited to 'arch/sh/kernel/irq_32.c') diff --git a/arch/sh/kernel/irq_32.c b/arch/sh/kernel/irq_32.c new file mode 100644 index 00000000000..b98a694ead3 --- /dev/null +++ b/arch/sh/kernel/irq_32.c @@ -0,0 +1,57 @@ +/* + * SHcompact irqflags support + * + * Copyright (C) 2006 - 2009 Paul Mundt + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ +#include +#include + +void raw_local_irq_restore(unsigned long flags) +{ + unsigned long __dummy0, __dummy1; + + if (flags == RAW_IRQ_DISABLED) { + __asm__ __volatile__ ( + "stc sr, %0\n\t" + "or #0xf0, %0\n\t" + "ldc %0, sr\n\t" + : "=&z" (__dummy0) + : /* no inputs */ + : "memory" + ); + } else { + __asm__ __volatile__ ( + "stc sr, %0\n\t" + "and %1, %0\n\t" +#ifdef CONFIG_CPU_HAS_SR_RB + "stc r6_bank, %1\n\t" + "or %1, %0\n\t" +#endif + "ldc %0, sr\n\t" + : "=&r" (__dummy0), "=r" (__dummy1) + : "1" (~RAW_IRQ_DISABLED) + : "memory" + ); + } +} +EXPORT_SYMBOL(raw_local_irq_restore); + +unsigned long __raw_local_save_flags(void) +{ + unsigned long flags; + + __asm__ __volatile__ ( + "stc sr, %0\n\t" + "and #0xf0, %0\n\t" + : "=&z" (flags) + : /* no inputs */ + : "memory" + ); + + return flags; +} +EXPORT_SYMBOL(__raw_local_save_flags); -- cgit v1.2.3-70-g09d2 From 3f375f12ecb9c691dda70bb64b313e55fe6ee4ee Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Mon, 26 Oct 2009 22:19:49 +0000 Subject: sh: Annotate irq functions with "notrace" Now that SH's irqflags functions are out of line it becomes necessary to mark them as "notrace" so that we don't try to trace them. [ Do the same for irq_64.c -- PFM. ] Signed-off-by: Matt Fleming Signed-off-by: Paul Mundt --- arch/sh/kernel/irq_32.c | 4 ++-- arch/sh/kernel/irq_64.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/sh/kernel/irq_32.c') diff --git a/arch/sh/kernel/irq_32.c b/arch/sh/kernel/irq_32.c index b98a694ead3..e33ab15831f 100644 --- a/arch/sh/kernel/irq_32.c +++ b/arch/sh/kernel/irq_32.c @@ -10,7 +10,7 @@ #include #include -void raw_local_irq_restore(unsigned long flags) +void notrace raw_local_irq_restore(unsigned long flags) { unsigned long __dummy0, __dummy1; @@ -40,7 +40,7 @@ void raw_local_irq_restore(unsigned long flags) } EXPORT_SYMBOL(raw_local_irq_restore); -unsigned long __raw_local_save_flags(void) +unsigned long notrace __raw_local_save_flags(void) { unsigned long flags; diff --git a/arch/sh/kernel/irq_64.c b/arch/sh/kernel/irq_64.c index 09d92718c99..32365ba0e03 100644 --- a/arch/sh/kernel/irq_64.c +++ b/arch/sh/kernel/irq_64.c @@ -11,7 +11,7 @@ #include #include -void raw_local_irq_restore(unsigned long flags) +void notrace raw_local_irq_restore(unsigned long flags) { unsigned long long __dummy; @@ -35,7 +35,7 @@ void raw_local_irq_restore(unsigned long flags) } EXPORT_SYMBOL(raw_local_irq_restore); -unsigned long __raw_local_save_flags(void) +unsigned long notrace __raw_local_save_flags(void) { unsigned long flags; -- cgit v1.2.3-70-g09d2