sh: Make 29/32-bit mode check helper generally available.
authorPaul Mundt <lethal@linux-sh.org>
Wed, 20 Jan 2010 07:40:48 +0000 (16:40 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 20 Jan 2010 07:40:48 +0000 (16:40 +0900)
Presently __in_29bit_mode() is only defined for the PMB case, but
it's also easily derived from the CONFIG_29BIT and CONFIG_32BIT &&
CONFIG_PMB=n cases.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/include/asm/addrspace.h
arch/sh/include/asm/mmu.h
arch/sh/mm/init.c
arch/sh/mm/pmb.c

index 268efd62ed2182f756952f211bdf2d0e81162b69..446b3831c2149380265476f47674d4ad4ea72b1e 100644 (file)
 #define P3_ADDR_MAX            P4SEG
 #endif
 
-#ifndef __ASSEMBLY__
-#ifdef CONFIG_PMB
-extern int __in_29bit_mode(void);
-#endif /* CONFIG_PMB */
-#endif /* __ASSEMBLY__ */
-
 #endif /* __KERNEL__ */
 #endif /* __ASM_SH_ADDRSPACE_H */
index e5e8f48830efd9ded6df3513348f3ffd6a53240d..ca7d91e8aa72d3a151c3fdac9548654308a299f9 100644 (file)
@@ -31,6 +31,7 @@
 
 #ifndef __ASSEMBLY__
 #include <linux/errno.h>
+#include <linux/threads.h>
 
 /* Default "unsigned long" context */
 typedef unsigned long mm_context_id_t[NR_CPUS];
@@ -72,6 +73,7 @@ long pmb_remap(unsigned long virt, unsigned long phys,
               unsigned long size, unsigned long flags);
 void pmb_unmap(unsigned long addr);
 int pmb_init(void);
+bool __in_29bit_mode(void);
 #else
 static inline long pmb_remap(unsigned long virt, unsigned long phys,
                             unsigned long size, unsigned long flags)
@@ -87,8 +89,14 @@ static inline int pmb_init(void)
 {
        return -ENODEV;
 }
-#endif /* CONFIG_PMB */
 
+#ifdef CONFIG_29BIT
+#define __in_29bit_mode()      (1)
+#else
+#define __in_29bit_mode()      (0)
+#endif
+
+#endif /* CONFIG_PMB */
 #endif /* __ASSEMBLY__ */
 
 #endif /* __MMU_H */
index 32ebd1592e633a9ee2e6c41924089ab04df06aa9..491d9d5c8e0d8cdaec89b040729dcbaacc687351 100644 (file)
@@ -338,10 +338,3 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
 
 #endif /* CONFIG_MEMORY_HOTPLUG */
-
-#ifdef CONFIG_PMB
-int __in_29bit_mode(void)
-{
-       return !(ctrl_inl(PMB_PASCR) & PASCR_SE);
-}
-#endif /* CONFIG_PMB */
index b796b6c021b4095c793bd4edddba2a912b8ad126..d318fa6caffe0d50463ec97591279ff1291f9c2c 100644 (file)
@@ -436,6 +436,11 @@ int __uses_jump_to_uncached pmb_init(void)
        return 0;
 }
 
+bool __in_29bit_mode(void)
+{
+        return (__raw_readl(PMB_PASCR) & PASCR_SE) == 0;
+}
+
 static int pmb_seq_show(struct seq_file *file, void *iter)
 {
        int i;
This page took 0.028827 seconds and 5 git commands to generate.