From ddd43b063d16cdeffbc18f00b72c112f246fae78 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 23 May 2007 12:24:32 +0900 Subject: sh: section mismatch fixes for system timer. Fix up a couple of section mismatch warnings regarding sys_timer. Signed-off-by: Paul Mundt --- arch/sh/kernel/timers/timer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/sh/kernel/timers/timer.c b/arch/sh/kernel/timers/timer.c index a6bcc913d25..4e7e747d1b6 100644 --- a/arch/sh/kernel/timers/timer.c +++ b/arch/sh/kernel/timers/timer.c @@ -13,7 +13,7 @@ #include #include -static struct sys_timer *sys_timers[] __initdata = { +static struct sys_timer *sys_timers[] = { #ifdef CONFIG_SH_TMU &tmu_timer, #endif @@ -26,7 +26,7 @@ static struct sys_timer *sys_timers[] __initdata = { NULL, }; -static char timer_override[10] __initdata; +static char timer_override[10]; static int __init timer_setup(char *str) { if (str) @@ -53,4 +53,3 @@ struct sys_timer *get_sys_timer(void) return NULL; } - -- cgit v1.2.3 From 370ac91aab8403d74c2b59c3b43692eaed4ef268 Mon Sep 17 00:00:00 2001 From: Takashi YOSHII Date: Thu, 31 May 2007 13:42:21 +0900 Subject: sh: Fix pcrel too far for in_nmi label. Add lost in_nmi definition to solve pcrel too far. Signed-off-by: Takashi YOSHII Signed-off-by: Paul Mundt --- arch/sh/kernel/cpu/sh3/entry.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S index 832c0b4a1e6..659cc081e5e 100644 --- a/arch/sh/kernel/cpu/sh3/entry.S +++ b/arch/sh/kernel/cpu/sh3/entry.S @@ -320,6 +320,7 @@ skip_restore: .align 2 5: .long 0x00001000 ! DSP +6: .long in_nmi 7: .long 0x30000000 ! common exception handler -- cgit v1.2.3 From bdff33ddd906b2ab9eb70e9098f507fac6d56b70 Mon Sep 17 00:00:00 2001 From: Manuel Lauss Date: Thu, 31 May 2007 13:44:17 +0900 Subject: sh: Trivial fix for dma-api compile failure. Trivial fix for arch/sh/drivers/dma/dma-api.c compile failure: CC arch/sh/drivers/dma/dma-api.o a/arch/sh/drivers/dma/dma-api.c: In function 'dma_wait_for_completion': a/arch/sh/drivers/dma/dma-api.c:233: error: 'TASK_UNINTERRUPTIBLE' undeclared (first use in this function) a/arch/sh/drivers/dma/dma-api.c:233: error: (Each undeclared identifier is reported only once a/arch/sh/drivers/dma/dma-api.c:233: error: for each function it appears in.) a/arch/sh/drivers/dma/dma-api.c:233: warning: implicit declaration of function 'schedule' Signed-off-by: Manuel Lauss Signed-off-by: Paul Mundt --- arch/sh/drivers/dma/dma-api.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c index 8057a27a1bc..cf8e1199433 100644 --- a/arch/sh/drivers/dma/dma-api.c +++ b/arch/sh/drivers/dma/dma-api.c @@ -16,6 +16,7 @@ #include #include #include +#include #include DEFINE_SPINLOCK(dma_spin_lock); -- cgit v1.2.3 From f75522cea12fe1ed9336c1a02b170bd06383e8a3 Mon Sep 17 00:00:00 2001 From: Manuel Lauss Date: Thu, 31 May 2007 13:44:55 +0900 Subject: sh: Fix vsyscall build failure. CC arch/sh/kernel/vsyscall/vsyscall.o a/arch/sh/kernel/vsyscall/vsyscall.c: In function 'arch_setup_additional_pages': a/arch/sh/kernel/vsyscall/vsyscall.c:63: error: dereferencing pointer to incomplete type a/arch/sh/kernel/vsyscall/vsyscall.c:67: error: dereferencing pointer to incomplete type a/arch/sh/kernel/vsyscall/vsyscall.c:82: error: dereferencing pointer to incomplete type a/arch/sh/kernel/vsyscall/vsyscall.c:85: error: dereferencing pointer to incomplete type a/arch/sh/kernel/vsyscall/vsyscall.c: In function 'arch_vma_name': a/arch/sh/kernel/vsyscall/vsyscall.c:91: error: dereferencing pointer to incomplete type Signed-off-by: Manuel Lauss Signed-off-by: Paul Mundt --- arch/sh/kernel/vsyscall/vsyscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/kernel/vsyscall/vsyscall.c b/arch/sh/kernel/vsyscall/vsyscall.c index e146bafcd14..2aa9438361b 100644 --- a/arch/sh/kernel/vsyscall/vsyscall.c +++ b/arch/sh/kernel/vsyscall/vsyscall.c @@ -17,6 +17,7 @@ #include #include #include +#include /* * Should the kernel map a VDSO page into processes and pass its -- cgit v1.2.3 From 66c5227ecd3041b0467a091ad81b8d312e572ea8 Mon Sep 17 00:00:00 2001 From: Evgeniy Polyakov Date: Thu, 31 May 2007 13:46:21 +0900 Subject: sh: trivial build cleanups. Several errors were spotted during building for custom config (SMP included). Although SMP still does not compile (no ipi and __smp_call_function) and does not work, this looks a bit cleaner. Some other errors obtained via gcc-4.1.0 build. Signed-off-by: Evgeniy Polyakov Signed-off-by: Paul Mundt --- arch/sh/kernel/cf-enabler.c | 6 ++++++ arch/sh/kernel/cpu/sh4/probe.c | 1 + arch/sh/kernel/smp.c | 2 ++ include/asm-sh/cpu-sh4/freq.h | 3 +++ include/asm-sh/dma.h | 1 + include/asm-sh/io.h | 6 +++--- include/asm-sh/smp.h | 2 +- include/asm-sh/spinlock.h | 8 +++++++- include/asm-sh/spinlock_types.h | 4 +++- 9 files changed, 27 insertions(+), 6 deletions(-) diff --git a/arch/sh/kernel/cf-enabler.c b/arch/sh/kernel/cf-enabler.c index 849a9e19139..ebc73b85094 100644 --- a/arch/sh/kernel/cf-enabler.c +++ b/arch/sh/kernel/cf-enabler.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -149,6 +150,11 @@ static int __init cf_init_se(void) ctrl_outb(0x42, PA_MRSHPC_MW2 + 0x200); return 0; } +#else +static int __init cf_init_se(void) +{ + return -1; +} #endif int __init cf_init(void) diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c index 8cd04904c77..fab2eb07196 100644 --- a/arch/sh/kernel/cpu/sh4/probe.c +++ b/arch/sh/kernel/cpu/sh4/probe.c @@ -12,6 +12,7 @@ */ #include #include +#include #include #include diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index dbebaddcfe3..283e1425ced 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c @@ -10,6 +10,8 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ + +#include #include #include #include diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h index 86564e7a26a..39f41fcd509 100644 --- a/include/asm-sh/cpu-sh4/freq.h +++ b/include/asm-sh/cpu-sh4/freq.h @@ -24,6 +24,9 @@ #define FRQMR1 0xffc80014 #else #define FRQCR 0xffc00000 +#define FRQCR_PSTBY 0x0200 +#define FRQCR_PLLEN 0x0400 +#define FRQCR_CKOEN 0x0800 #endif #define MIN_DIVISOR_NR 0 #define MAX_DIVISOR_NR 3 diff --git a/include/asm-sh/dma.h b/include/asm-sh/dma.h index faf3051cd42..6034d4a29e7 100644 --- a/include/asm-sh/dma.h +++ b/include/asm-sh/dma.h @@ -13,6 +13,7 @@ #include #include +#include #include #include diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h index a0e55b09e4f..aa80930ce8e 100644 --- a/include/asm-sh/io.h +++ b/include/asm-sh/io.h @@ -116,13 +116,13 @@ void __raw_readsl(unsigned long addr, void *data, int longlen); * redefined by userlevel programs. */ #ifdef __readb -# define readb(a) ({ unsigned long r_ = __raw_readb(a); mb(); r_; }) +# define readb(a) ({ unsigned int r_ = __raw_readb(a); mb(); r_; }) #endif #ifdef __raw_readw -# define readw(a) ({ unsigned long r_ = __raw_readw(a); mb(); r_; }) +# define readw(a) ({ unsigned int r_ = __raw_readw(a); mb(); r_; }) #endif #ifdef __raw_readl -# define readl(a) ({ unsigned long r_ = __raw_readl(a); mb(); r_; }) +# define readl(a) ({ unsigned int r_ = __raw_readl(a); mb(); r_; }) #endif #ifdef __raw_writeb diff --git a/include/asm-sh/smp.h b/include/asm-sh/smp.h index 71ecddf70db..caa7b93f1bc 100644 --- a/include/asm-sh/smp.h +++ b/include/asm-sh/smp.h @@ -15,7 +15,7 @@ #ifdef CONFIG_SMP -#include +#include #include #include diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h index 2586eef07d5..92f6e2008b2 100644 --- a/include/asm-sh/spinlock.h +++ b/include/asm-sh/spinlock.h @@ -11,6 +11,7 @@ #define __ASM_SH_SPINLOCK_H #include +#include /* * Your basic SMP spinlocks, allowing only a single CPU anywhere @@ -42,7 +43,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) static inline void __raw_spin_unlock(raw_spinlock_t *lock) { - assert_spin_locked(lock); + //assert_spin_locked(lock); lock->lock = 0; } @@ -88,6 +89,11 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) __raw_spin_unlock(&rw->lock); } +static inline int __raw_write_can_lock(raw_rwlock_t *rw) +{ + return (atomic_read(&rw->counter) == RW_LOCK_BIAS); +} + static inline int __raw_read_trylock(raw_rwlock_t *lock) { atomic_t *count = (atomic_t*)lock; diff --git a/include/asm-sh/spinlock_types.h b/include/asm-sh/spinlock_types.h index 8c41b6c3aac..5c58134f2c4 100644 --- a/include/asm-sh/spinlock_types.h +++ b/include/asm-sh/spinlock_types.h @@ -9,7 +9,9 @@ typedef struct { volatile unsigned long lock; } raw_spinlock_t; -#define __SPIN_LOCK_UNLOCKED { 0 } +#define __RAW_SPIN_LOCK_UNLOCKED { 1 } + +#include typedef struct { raw_spinlock_t lock; -- cgit v1.2.3 From 4e1c20842044da32f771631049b7082dad63a9c5 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 31 May 2007 13:48:57 +0900 Subject: sh: support older gcc's Make my version of gcc happy. Signed-off-by: Andrew Morton Signed-off-by: Paul Mundt --- arch/sh/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 7b112241705..883b03b040c 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -39,7 +39,7 @@ cflags-$(CONFIG_CPU_SH2A) := -m2a $(call cc-option,-m2a-nofpu,) cflags-$(CONFIG_CPU_SH3) := -m3 cflags-$(CONFIG_CPU_SH4) := -m4 \ $(call cc-option,-mno-implicit-fp,-m4-nofpu) -cflags-$(CONFIG_CPU_SH4A) := -m4a $(call cc-option,-m4a-nofpu,) +cflags-$(CONFIG_CPU_SH4A) := $(call cc-option,-m4a,) $(call cc-option,-m4a-nofpu,) cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml -- cgit v1.2.3