aboutsummaryrefslogtreecommitdiff
path: root/include/asm-sh
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh')
-rw-r--r--include/asm-sh/addrspace.h4
-rw-r--r--include/asm-sh/io.h5
-rw-r--r--include/asm-sh/uaccess.h9
3 files changed, 13 insertions, 5 deletions
diff --git a/include/asm-sh/addrspace.h b/include/asm-sh/addrspace.h
index 4207368267b..b860218e402 100644
--- a/include/asm-sh/addrspace.h
+++ b/include/asm-sh/addrspace.h
@@ -14,7 +14,7 @@
#include <asm/cpu/addrspace.h>
/* Memory segments (32bit Privileged mode addresses) */
-#ifdef CONFIG_MMU
+#ifndef CONFIG_CPU_SH2A
#define P0SEG 0x00000000
#define P1SEG 0x80000000
#define P2SEG 0xa0000000
@@ -24,7 +24,7 @@
#define P0SEG 0x00000000
#define P1SEG 0x00000000
#define P2SEG 0x20000000
-#define P3SEG 0x40000000
+#define P3SEG 0x00000000
#define P4SEG 0x80000000
#endif
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
index 27dba653cbe..377160b8629 100644
--- a/include/asm-sh/io.h
+++ b/include/asm-sh/io.h
@@ -216,6 +216,7 @@ static inline void ctrl_delay(void)
#define IO_SPACE_LIMIT 0xffffffff
+#ifdef CONFIG_MMU
/*
* Change virtual addresses to physical addresses and vv.
* These are trivial on the 1:1 Linux/SuperH mapping
@@ -229,6 +230,10 @@ static inline void *phys_to_virt(unsigned long address)
{
return (void *)P1SEGADDR(address);
}
+#else
+#define phys_to_virt(address) ((void *)(address))
+#define virt_to_phys(address) ((unsigned long)(address))
+#endif
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt
diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h
index 5c3b00c2f10..5c49ed6715f 100644
--- a/include/asm-sh/uaccess.h
+++ b/include/asm-sh/uaccess.h
@@ -34,12 +34,12 @@
#define segment_eq(a,b) ((a).seg == (b).seg)
-#define __addr_ok(addr) \
- ((unsigned long)(addr) < (current_thread_info()->addr_limit.seg))
-
#define get_ds() (KERNEL_DS)
#if !defined(CONFIG_MMU)
+/* NOMMU is always true */
+#define __addr_ok(addr) (1)
+
static inline mm_segment_t get_fs(void)
{
return USER_DS;
@@ -66,6 +66,9 @@ static inline int __access_ok(unsigned long addr, unsigned long size)
return ((addr >= memory_start) && ((addr + size) < memory_end));
}
#else /* CONFIG_MMU */
+#define __addr_ok(addr) \
+ ((unsigned long)(addr) < (current_thread_info()->addr_limit.seg))
+
#define get_fs() (current_thread_info()->addr_limit)
#define set_fs(x) (current_thread_info()->addr_limit = (x))