diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-11-05 08:12:32 +0100 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-11-07 03:14:12 +0100 |
commit | 7747b9a493a197cb4db44c98d25ce6d3d9f586d1 (patch) | |
tree | 636aa0624e6768ef0e8ea02d0692f91dfb51d79f /arch/sh | |
parent | sh: Kill off the remaining ST40 cruft. (diff) | |
download | linux-7747b9a493a197cb4db44c98d25ce6d3d9f586d1.tar.xz linux-7747b9a493a197cb4db44c98d25ce6d3d9f586d1.zip |
sh: Wire up clear_user_highpage().
With the kmap_coherent() API in place, this is trivial to implement,
and lets us avoid the cache flush in certain cases.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/mm/pg-sh4.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/sh/mm/pg-sh4.c b/arch/sh/mm/pg-sh4.c index 25f5c6f6821d..ede6dd1e3701 100644 --- a/arch/sh/mm/pg-sh4.c +++ b/arch/sh/mm/pg-sh4.c @@ -9,6 +9,8 @@ #include <linux/mm.h> #include <linux/mutex.h> #include <linux/fs.h> +#include <linux/highmem.h> +#include <linux/module.h> #include <asm/mmu_context.h> #include <asm/cacheflush.h> @@ -79,6 +81,27 @@ void copy_user_page(void *to, void *from, unsigned long address, } } +void copy_user_highpage(struct page *to, struct page *from, + unsigned long vaddr, struct vm_area_struct *vma) +{ + void *vfrom, *vto; + + __set_bit(PG_mapped, &to->flags); + + vto = kmap_atomic(to, KM_USER1); + vfrom = kmap_coherent(from, vaddr); + copy_page(vto, vfrom); + kunmap_coherent(vfrom); + + if (((vaddr ^ (unsigned long)vto) & CACHE_ALIAS)) + __flush_wback_region(vto, PAGE_SIZE); + + kunmap_atomic(vto, KM_USER1); + /* Make sure this page is cleared on other CPU's too before using it */ + smp_wmb(); +} +EXPORT_SYMBOL(copy_user_highpage); + /* * For SH-4, we have our own implementation for ptep_get_and_clear */ |