Commit 2efa53b2 authored by Paul Mundt's avatar Paul Mundt

sh: Make 29/32-bit mode check helper generally available.

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: default avatarPaul Mundt <lethal@linux-sh.org>
parent 5f240718
...@@ -65,11 +65,5 @@ ...@@ -65,11 +65,5 @@
#define P3_ADDR_MAX P4SEG #define P3_ADDR_MAX P4SEG
#endif #endif
#ifndef __ASSEMBLY__
#ifdef CONFIG_PMB
extern int __in_29bit_mode(void);
#endif /* CONFIG_PMB */
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* __ASM_SH_ADDRSPACE_H */ #endif /* __ASM_SH_ADDRSPACE_H */
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/threads.h>
/* Default "unsigned long" context */ /* Default "unsigned long" context */
typedef unsigned long mm_context_id_t[NR_CPUS]; typedef unsigned long mm_context_id_t[NR_CPUS];
...@@ -72,6 +73,7 @@ long pmb_remap(unsigned long virt, unsigned long phys, ...@@ -72,6 +73,7 @@ long pmb_remap(unsigned long virt, unsigned long phys,
unsigned long size, unsigned long flags); unsigned long size, unsigned long flags);
void pmb_unmap(unsigned long addr); void pmb_unmap(unsigned long addr);
int pmb_init(void); int pmb_init(void);
bool __in_29bit_mode(void);
#else #else
static inline long pmb_remap(unsigned long virt, unsigned long phys, static inline long pmb_remap(unsigned long virt, unsigned long phys,
unsigned long size, unsigned long flags) unsigned long size, unsigned long flags)
...@@ -87,8 +89,14 @@ static inline int pmb_init(void) ...@@ -87,8 +89,14 @@ static inline int pmb_init(void)
{ {
return -ENODEV; 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 /* __ASSEMBLY__ */
#endif /* __MMU_H */ #endif /* __MMU_H */
...@@ -338,10 +338,3 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); ...@@ -338,10 +338,3 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
#endif #endif
#endif /* CONFIG_MEMORY_HOTPLUG */ #endif /* CONFIG_MEMORY_HOTPLUG */
#ifdef CONFIG_PMB
int __in_29bit_mode(void)
{
return !(ctrl_inl(PMB_PASCR) & PASCR_SE);
}
#endif /* CONFIG_PMB */
...@@ -436,6 +436,11 @@ int __uses_jump_to_uncached pmb_init(void) ...@@ -436,6 +436,11 @@ int __uses_jump_to_uncached pmb_init(void)
return 0; 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) static int pmb_seq_show(struct seq_file *file, void *iter)
{ {
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment