diff options
author | Yoshinori Sato <ysato@users.sourceforge.jp> | 2006-09-27 04:21:02 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 04:21:02 -0400 |
commit | e96636ccfa373a00a0ee0558e1971baa7856d8b5 (patch) | |
tree | c4f98b1c92f30f17c8c0d36419977789fe537aab /include | |
parent | e7f93a355c7e32c26eab8910cf53b7506bb046c5 (diff) |
sh: Various nommu fixes.
This fixes up some of the various outstanding nommu bugs on
SH.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-sh/addrspace.h | 8 | ||||
-rw-r--r-- | include/asm-sh/flat.h | 2 | ||||
-rw-r--r-- | include/asm-sh/mmu.h | 13 | ||||
-rw-r--r-- | include/asm-sh/page.h | 5 | ||||
-rw-r--r-- | include/asm-sh/uaccess.h | 13 |
5 files changed, 28 insertions, 13 deletions
diff --git a/include/asm-sh/addrspace.h b/include/asm-sh/addrspace.h index 720afc11c2ca..4207368267b1 100644 --- a/include/asm-sh/addrspace.h +++ b/include/asm-sh/addrspace.h | |||
@@ -14,11 +14,19 @@ | |||
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 | #define P0SEG 0x00000000 | 18 | #define P0SEG 0x00000000 |
18 | #define P1SEG 0x80000000 | 19 | #define P1SEG 0x80000000 |
19 | #define P2SEG 0xa0000000 | 20 | #define P2SEG 0xa0000000 |
20 | #define P3SEG 0xc0000000 | 21 | #define P3SEG 0xc0000000 |
21 | #define P4SEG 0xe0000000 | 22 | #define P4SEG 0xe0000000 |
23 | #else | ||
24 | #define P0SEG 0x00000000 | ||
25 | #define P1SEG 0x00000000 | ||
26 | #define P2SEG 0x20000000 | ||
27 | #define P3SEG 0x40000000 | ||
28 | #define P4SEG 0x80000000 | ||
29 | #endif | ||
22 | 30 | ||
23 | /* Returns the privileged segment base of a given address */ | 31 | /* Returns the privileged segment base of a given address */ |
24 | #define PXSEG(a) (((unsigned long)(a)) & 0xe0000000) | 32 | #define PXSEG(a) (((unsigned long)(a)) & 0xe0000000) |
diff --git a/include/asm-sh/flat.h b/include/asm-sh/flat.h index f29072e1c87e..0d5cc04ab005 100644 --- a/include/asm-sh/flat.h +++ b/include/asm-sh/flat.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #define __ASM_SH_FLAT_H | 13 | #define __ASM_SH_FLAT_H |
14 | 14 | ||
15 | #define flat_stack_align(sp) /* nothing needed */ | 15 | #define flat_stack_align(sp) /* nothing needed */ |
16 | #define flat_argvp_envp_on_stack() 1 | 16 | #define flat_argvp_envp_on_stack() 0 |
17 | #define flat_old_ram_flag(flags) (flags) | 17 | #define flat_old_ram_flag(flags) (flags) |
18 | #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) | 18 | #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) |
19 | #define flat_get_addr_from_rp(rp, relval, flags) get_unaligned(rp) | 19 | #define flat_get_addr_from_rp(rp, relval, flags) get_unaligned(rp) |
diff --git a/include/asm-sh/mmu.h b/include/asm-sh/mmu.h index ec09589fa6ca..6383dc84501e 100644 --- a/include/asm-sh/mmu.h +++ b/include/asm-sh/mmu.h | |||
@@ -3,19 +3,8 @@ | |||
3 | 3 | ||
4 | #if !defined(CONFIG_MMU) | 4 | #if !defined(CONFIG_MMU) |
5 | 5 | ||
6 | struct mm_rblock_struct { | ||
7 | int size; | ||
8 | int refcount; | ||
9 | void *kblock; | ||
10 | }; | ||
11 | |||
12 | struct mm_tblock_struct { | ||
13 | struct mm_rblock_struct *rblock; | ||
14 | struct mm_tblock_struct *next; | ||
15 | }; | ||
16 | |||
17 | typedef struct { | 6 | typedef struct { |
18 | struct mm_tblock_struct tblock; | 7 | struct vm_list_struct *vmlist; |
19 | unsigned long end_brk; | 8 | unsigned long end_brk; |
20 | } mm_context_t; | 9 | } mm_context_t; |
21 | 10 | ||
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 1b3cfd165a66..e9135532d00c 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
@@ -38,8 +38,13 @@ | |||
38 | extern void (*clear_page)(void *to); | 38 | extern void (*clear_page)(void *to); |
39 | extern void (*copy_page)(void *to, void *from); | 39 | extern void (*copy_page)(void *to, void *from); |
40 | 40 | ||
41 | #ifdef CONFIG_MMU | ||
41 | extern void clear_page_slow(void *to); | 42 | extern void clear_page_slow(void *to); |
42 | extern void copy_page_slow(void *to, void *from); | 43 | extern void copy_page_slow(void *to, void *from); |
44 | #else | ||
45 | extern void clear_page_nommu(void *to); | ||
46 | extern void copy_page_nommu(void *to, void *from); | ||
47 | #endif | ||
43 | 48 | ||
44 | #if defined(CONFIG_MMU) && (defined(CONFIG_CPU_SH4) || \ | 49 | #if defined(CONFIG_MMU) && (defined(CONFIG_CPU_SH4) || \ |
45 | defined(CONFIG_SH7705_CACHE_32KB)) | 50 | defined(CONFIG_SH7705_CACHE_32KB)) |
diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h index 6c0014dd2ef7..5c3b00c2f107 100644 --- a/include/asm-sh/uaccess.h +++ b/include/asm-sh/uaccess.h | |||
@@ -168,6 +168,7 @@ do { \ | |||
168 | __gu_err; \ | 168 | __gu_err; \ |
169 | }) | 169 | }) |
170 | 170 | ||
171 | #ifdef CONFIG_MMU | ||
171 | #define __get_user_check(x,ptr,size) \ | 172 | #define __get_user_check(x,ptr,size) \ |
172 | ({ \ | 173 | ({ \ |
173 | long __gu_err, __gu_val; \ | 174 | long __gu_err, __gu_val; \ |
@@ -257,6 +258,18 @@ __asm__("stc r7_bank, %1\n\t" \ | |||
257 | : "r" (addr) \ | 258 | : "r" (addr) \ |
258 | : "t"); \ | 259 | : "t"); \ |
259 | }) | 260 | }) |
261 | #else /* CONFIG_MMU */ | ||
262 | #define __get_user_check(x,ptr,size) \ | ||
263 | ({ \ | ||
264 | long __gu_err, __gu_val; \ | ||
265 | if (__access_ok((unsigned long)(ptr), (size))) { \ | ||
266 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ | ||
267 | (x) = (__typeof__(*(ptr)))__gu_val; \ | ||
268 | } else \ | ||
269 | __gu_err = -EFAULT; \ | ||
270 | __gu_err; \ | ||
271 | }) | ||
272 | #endif | ||
260 | 273 | ||
261 | #define __get_user_asm(x, addr, err, insn) \ | 274 | #define __get_user_asm(x, addr, err, insn) \ |
262 | ({ \ | 275 | ({ \ |