|
From: Paul M. <le...@us...> - 2006-07-19 15:45:47
|
Update of /cvsroot/linuxsh/linux/arch/sh/mm In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8921/arch/sh/mm Modified Files: init.c pg-nommu.c Log Message: Fixup nommu page ops. Index: init.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/mm/init.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- init.c 5 Jul 2006 08:46:48 -0000 1.28 +++ init.c 19 Jul 2006 15:45:38 -0000 1.29 @@ -249,8 +249,13 @@ * 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)); Index: pg-nommu.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/mm/pg-nommu.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pg-nommu.c 25 Oct 2003 21:45:29 -0000 1.1 +++ pg-nommu.c 19 Jul 2006 15:45:38 -0000 1.2 @@ -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; +} |