sh: Tidy up dependencies for SH-2 build.

SH-2 can presently get in to some pretty bogus states, so
we tidy up the dependencies a bit and get it all building
again.

This gets us a bit closer to a functional allyesconfig
and allmodconfig, though there are still a few things to
fix up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
diff --git a/include/asm-sh/cache.h b/include/asm-sh/cache.h
index 9a3cb6b..7a18649 100644
--- a/include/asm-sh/cache.h
+++ b/include/asm-sh/cache.h
@@ -9,6 +9,7 @@
 #define __ASM_SH_CACHE_H
 #ifdef __KERNEL__
 
+#include <linux/init.h>
 #include <asm/cpu/cache.h>
 
 #define SH_CACHE_VALID		1
@@ -48,6 +49,9 @@
 
 	unsigned long flags;
 };
+
+int __init detect_cpu_and_cache_system(void);
+
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* __ASM_SH_CACHE_H */
diff --git a/include/asm-sh/hd64461.h b/include/asm-sh/hd64461.h
index 27e5c34..c9050b2 100644
--- a/include/asm-sh/hd64461.h
+++ b/include/asm-sh/hd64461.h
@@ -184,7 +184,7 @@
 #define HD64461_NIRR		0x15000
 #define HD64461_NIMR		0x15002
 
-#define HD64461_IRQBASE		OFFCHIP_IRQ_BASE
+#define HD64461_IRQBASE		64
 #define HD64461_IRQ_NUM		16
 
 #define HD64461_IRQ_UART	(HD64461_IRQBASE+5)
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index 1fc5eed..1a20db0 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -228,11 +228,7 @@
 	regs->sr &= ~SR_FD;
 }
 
-#ifdef CONFIG_CPU_SH4
 extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
-#else
-#define save_fpu(tsk)	do { } while (0)
-#endif
 
 #define unlazy_fpu(tsk, regs) do {			\
 	if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) {	\
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index fb22fc3..7c75045 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -126,7 +126,7 @@
 #define smp_read_barrier_depends()	do { } while(0)
 #endif
 
-#define set_mb(var, value) do { xchg(&var, value); } while (0)
+#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
 
 /*
  * Jump to P2 area.
diff --git a/include/asm-sh/ubc.h b/include/asm-sh/ubc.h
index ae9bbde..38d46e0 100644
--- a/include/asm-sh/ubc.h
+++ b/include/asm-sh/ubc.h
@@ -51,9 +51,14 @@
 #define BRCR_UBDE		(1 << 0)
 
 #ifndef __ASSEMBLY__
-/* arch/sh/kernel/ubc.S */
-extern void ubc_wakeup(void);
+/* arch/sh/kernel/cpu/ubc.S */
 extern void ubc_sleep(void);
+
+#ifdef CONFIG_UBC_WAKEUP
+extern void ubc_wakeup(void);
+#else
+#define ubc_wakeup()	do { } while (0)
+#endif
 #endif
 
 #endif /* __KERNEL__ */