From a2d1a5fae6296c2a3ac1aaa982c95464c46c0585 Mon Sep 17 00:00:00 2001 From: Yoshinori Sato Date: Wed, 27 Sep 2006 17:25:07 +0900 Subject: sh: __addr_ok() and other misc nommu fixups. A few more outstanding nommu fixups.. Signed-off-by: Yoshinori Sato Signed-off-by: Paul Mundt --- include/asm-sh/addrspace.h | 4 ++-- include/asm-sh/io.h | 5 +++++ include/asm-sh/uaccess.h | 9 ++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'include/asm-sh') 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 /* 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)) -- cgit v1.2.3