aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh
diff options
context:
space:
mode:
authorYoshinori Sato <ysato@users.sourceforge.jp>2006-09-27 04:25:07 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 04:25:07 -0400
commita2d1a5fae6296c2a3ac1aaa982c95464c46c0585 (patch)
treefa704906d368f6ab0f03b164d5071992a4029a9a /include/asm-sh
parent0b8929354cdeddb17e81bfda903812c9adfd0b67 (diff)
sh: __addr_ok() and other misc nommu fixups.
A few more outstanding nommu fixups.. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
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 4207368267b1..b860218e402e 100644
--- a/include/asm-sh/addrspace.h
+++ b/include/asm-sh/addrspace.h
@@ -14,7 +14,7 @@
14#include <asm/cpu/addrspace.h> 14#include <asm/cpu/addrspace.h>
15 15
16/* Memory segments (32bit Privileged mode addresses) */ 16/* Memory segments (32bit Privileged mode addresses) */
17#ifdef CONFIG_MMU 17#ifndef CONFIG_CPU_SH2A
18#define P0SEG 0x00000000 18#define P0SEG 0x00000000
19#define P1SEG 0x80000000 19#define P1SEG 0x80000000
20#define P2SEG 0xa0000000 20#define P2SEG 0xa0000000
@@ -24,7 +24,7 @@
24#define P0SEG 0x00000000 24#define P0SEG 0x00000000
25#define P1SEG 0x00000000 25#define P1SEG 0x00000000
26#define P2SEG 0x20000000 26#define P2SEG 0x20000000
27#define P3SEG 0x40000000 27#define P3SEG 0x00000000
28#define P4SEG 0x80000000 28#define P4SEG 0x80000000
29#endif 29#endif
30 30
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
index 27dba653cbe7..377160b86295 100644
--- a/include/asm-sh/io.h
+++ b/include/asm-sh/io.h
@@ -216,6 +216,7 @@ static inline void ctrl_delay(void)
216 216
217#define IO_SPACE_LIMIT 0xffffffff 217#define IO_SPACE_LIMIT 0xffffffff
218 218
219#ifdef CONFIG_MMU
219/* 220/*
220 * Change virtual addresses to physical addresses and vv. 221 * Change virtual addresses to physical addresses and vv.
221 * These are trivial on the 1:1 Linux/SuperH mapping 222 * These are trivial on the 1:1 Linux/SuperH mapping
@@ -229,6 +230,10 @@ static inline void *phys_to_virt(unsigned long address)
229{ 230{
230 return (void *)P1SEGADDR(address); 231 return (void *)P1SEGADDR(address);
231} 232}
233#else
234#define phys_to_virt(address) ((void *)(address))
235#define virt_to_phys(address) ((unsigned long)(address))
236#endif
232 237
233#define virt_to_bus virt_to_phys 238#define virt_to_bus virt_to_phys
234#define bus_to_virt phys_to_virt 239#define bus_to_virt phys_to_virt
diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h
index 5c3b00c2f107..5c49ed6715f2 100644
--- a/include/asm-sh/uaccess.h
+++ b/include/asm-sh/uaccess.h
@@ -34,12 +34,12 @@
34 34
35#define segment_eq(a,b) ((a).seg == (b).seg) 35#define segment_eq(a,b) ((a).seg == (b).seg)
36 36
37#define __addr_ok(addr) \
38 ((unsigned long)(addr) < (current_thread_info()->addr_limit.seg))
39
40#define get_ds() (KERNEL_DS) 37#define get_ds() (KERNEL_DS)
41 38
42#if !defined(CONFIG_MMU) 39#if !defined(CONFIG_MMU)
40/* NOMMU is always true */
41#define __addr_ok(addr) (1)
42
43static inline mm_segment_t get_fs(void) 43static inline mm_segment_t get_fs(void)
44{ 44{
45 return USER_DS; 45 return USER_DS;
@@ -66,6 +66,9 @@ static inline int __access_ok(unsigned long addr, unsigned long size)
66 return ((addr >= memory_start) && ((addr + size) < memory_end)); 66 return ((addr >= memory_start) && ((addr + size) < memory_end));
67} 67}
68#else /* CONFIG_MMU */ 68#else /* CONFIG_MMU */
69#define __addr_ok(addr) \
70 ((unsigned long)(addr) < (current_thread_info()->addr_limit.seg))
71
69#define get_fs() (current_thread_info()->addr_limit) 72#define get_fs() (current_thread_info()->addr_limit)
70#define set_fs(x) (current_thread_info()->addr_limit = (x)) 73#define set_fs(x) (current_thread_info()->addr_limit = (x))
71 74