sh: Calculate shm alignment at runtime.

Set the SHM alignment at runtime, based off of probed cache desc.
Optimize get_unmapped_area() to only colour align shared mappings.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
diff --git a/include/asm-sh/cacheflush.h b/include/asm-sh/cacheflush.h
index 92930b4..07f62ec 100644
--- a/include/asm-sh/cacheflush.h
+++ b/include/asm-sh/cacheflush.h
@@ -28,5 +28,7 @@
 		memcpy(dst, src, len);				\
 	} while (0)
 
+#define HAVE_ARCH_UNMAPPED_AREA
+
 #endif /* __KERNEL__ */
 #endif /* __ASM_SH_CACHEFLUSH_H */
diff --git a/include/asm-sh/cpu-sh3/cacheflush.h b/include/asm-sh/cpu-sh3/cacheflush.h
index 97f5a64..03fde97 100644
--- a/include/asm-sh/cpu-sh3/cacheflush.h
+++ b/include/asm-sh/cpu-sh3/cacheflush.h
@@ -64,12 +64,4 @@
 
 #define p3_cache_init()				do { } while (0)
 
-/*
- * We provide our own get_unmapped_area to avoid cache aliasing issues
- * on SH7705 with a 32KB cache, and to page align addresses in the
- * non-aliasing case.
- */
-#define HAVE_ARCH_UNMAPPED_AREA
-
 #endif /* __ASM_CPU_SH3_CACHEFLUSH_H */
-
diff --git a/include/asm-sh/cpu-sh4/cacheflush.h b/include/asm-sh/cpu-sh4/cacheflush.h
index a95fc95..515fd57 100644
--- a/include/asm-sh/cpu-sh4/cacheflush.h
+++ b/include/asm-sh/cpu-sh4/cacheflush.h
@@ -39,9 +39,6 @@
 
 #define PG_mapped	PG_arch_1
 
-/* We provide our own get_unmapped_area to avoid cache alias issue */
-#define HAVE_ARCH_UNMAPPED_AREA
-
 #ifdef CONFIG_MMU
 extern int remap_area_pages(unsigned long addr, unsigned long phys_addr,
 			    unsigned long size, unsigned long flags);
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h
index 3d8dae3..ca8b26d 100644
--- a/include/asm-sh/page.h
+++ b/include/asm-sh/page.h
@@ -44,6 +44,8 @@
 extern void (*clear_page)(void *to);
 extern void (*copy_page)(void *to, void *from);
 
+extern unsigned long shm_align_mask;
+
 #ifdef CONFIG_MMU
 extern void clear_page_slow(void *to);
 extern void copy_page_slow(void *to, void *from);
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index 41c559d..2c8682a 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -340,6 +340,4 @@
 #include <asm-generic/pgtable.h>
 
 #endif /* !__ASSEMBLY__ */
-
 #endif /* __ASM_SH_PAGE_H */
-