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 /arch | |
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 'arch')
-rw-r--r-- | arch/sh/boot/compressed/Makefile | 10 | ||||
-rw-r--r-- | arch/sh/mm/init.c | 5 | ||||
-rw-r--r-- | arch/sh/mm/pg-nommu.c | 17 |
3 files changed, 22 insertions, 10 deletions
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index 7074267c01b7..903470429cb4 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile | |||
@@ -21,11 +21,17 @@ endif | |||
21 | CONFIG_PAGE_OFFSET ?= 0x80000000 | 21 | CONFIG_PAGE_OFFSET ?= 0x80000000 |
22 | CONFIG_MEMORY_START ?= 0x0c000000 | 22 | CONFIG_MEMORY_START ?= 0x0c000000 |
23 | CONFIG_BOOT_LINK_OFFSET ?= 0x00800000 | 23 | CONFIG_BOOT_LINK_OFFSET ?= 0x00800000 |
24 | IMAGE_OFFSET := $(shell printf "0x%8x" $$[$(CONFIG_PAGE_OFFSET)+$(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)]) | 24 | |
25 | IMAGE_OFFSET := $(shell printf "0x%8x" $$[$(CONFIG_PAGE_OFFSET) + \ | ||
26 | $(CONFIG_MEMORY_START) + \ | ||
27 | $(CONFIG_BOOT_LINK_OFFSET)]) | ||
28 | |||
29 | LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) | ||
25 | 30 | ||
26 | LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds | 31 | LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds |
27 | 32 | ||
28 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE | 33 | |
34 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE | ||
29 | $(call if_changed,ld) | 35 | $(call if_changed,ld) |
30 | @: | 36 | @: |
31 | 37 | ||
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index d1a979eab656..2c6dc3d8df2c 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
@@ -248,8 +248,13 @@ void __init mem_init(void) | |||
248 | * Setup wrappers for copy/clear_page(), these will get overridden | 248 | * Setup wrappers for copy/clear_page(), these will get overridden |
249 | * later in the boot process if a better method is available. | 249 | * later in the boot process if a better method is available. |
250 | */ | 250 | */ |
251 | #ifdef CONFIG_MMU | ||
251 | copy_page = copy_page_slow; | 252 | copy_page = copy_page_slow; |
252 | clear_page = clear_page_slow; | 253 | clear_page = clear_page_slow; |
254 | #else | ||
255 | copy_page = copy_page_nommu; | ||
256 | clear_page = clear_page_nommu; | ||
257 | #endif | ||
253 | 258 | ||
254 | /* this will put all low memory onto the freelists */ | 259 | /* this will put all low memory onto the freelists */ |
255 | totalram_pages += free_all_bootmem_node(NODE_DATA(0)); | 260 | totalram_pages += free_all_bootmem_node(NODE_DATA(0)); |
diff --git a/arch/sh/mm/pg-nommu.c b/arch/sh/mm/pg-nommu.c index 8f9165a4e333..d15221beaa16 100644 --- a/arch/sh/mm/pg-nommu.c +++ b/arch/sh/mm/pg-nommu.c | |||
@@ -14,23 +14,24 @@ | |||
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | #include <asm/page.h> | 15 | #include <asm/page.h> |
16 | 16 | ||
17 | static void copy_page_nommu(void *to, void *from) | 17 | void copy_page_nommu(void *to, void *from) |
18 | { | 18 | { |
19 | memcpy(to, from, PAGE_SIZE); | 19 | memcpy(to, from, PAGE_SIZE); |
20 | } | 20 | } |
21 | 21 | ||
22 | static void clear_page_nommu(void *to) | 22 | void clear_page_nommu(void *to) |
23 | { | 23 | { |
24 | memset(to, 0, PAGE_SIZE); | 24 | memset(to, 0, PAGE_SIZE); |
25 | } | 25 | } |
26 | 26 | ||
27 | static int __init pg_nommu_init(void) | 27 | __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n) |
28 | { | 28 | { |
29 | copy_page = copy_page_nommu; | 29 | memcpy(to, from, n); |
30 | clear_page = clear_page_nommu; | ||
31 | |||
32 | return 0; | 30 | return 0; |
33 | } | 31 | } |
34 | 32 | ||
35 | subsys_initcall(pg_nommu_init); | 33 | __kernel_size_t __clear_user(void *to, __kernel_size_t n) |
36 | 34 | { | |
35 | memset(to, 0, n); | ||
36 | return 0; | ||
37 | } | ||