aboutsummaryrefslogtreecommitdiff
path: root/arch/sh/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/mm')
-rw-r--r--arch/sh/mm/init.c5
-rw-r--r--arch/sh/mm/pg-nommu.c17
2 files changed, 14 insertions, 8 deletions
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index d1a979eab65..2c6dc3d8df2 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -248,8 +248,13 @@ void __init mem_init(void)
* Setup wrappers for copy/clear_page(), these will get overridden
* later in the boot process if a better method is available.
*/
+#ifdef CONFIG_MMU
copy_page = copy_page_slow;
clear_page = clear_page_slow;
+#else
+ copy_page = copy_page_nommu;
+ clear_page = clear_page_nommu;
+#endif
/* this will put all low memory onto the freelists */
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 8f9165a4e33..d15221beaa1 100644
--- a/arch/sh/mm/pg-nommu.c
+++ b/arch/sh/mm/pg-nommu.c
@@ -14,23 +14,24 @@
#include <linux/string.h>
#include <asm/page.h>
-static void copy_page_nommu(void *to, void *from)
+void copy_page_nommu(void *to, void *from)
{
memcpy(to, from, PAGE_SIZE);
}
-static void clear_page_nommu(void *to)
+void clear_page_nommu(void *to)
{
memset(to, 0, PAGE_SIZE);
}
-static int __init pg_nommu_init(void)
+__kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n)
{
- copy_page = copy_page_nommu;
- clear_page = clear_page_nommu;
-
+ memcpy(to, from, n);
return 0;
}
-subsys_initcall(pg_nommu_init);
-
+__kernel_size_t __clear_user(void *to, __kernel_size_t n)
+{
+ memset(to, 0, n);
+ return 0;
+}