diff options
Diffstat (limited to 'include/asm-sh')
-rw-r--r-- | include/asm-sh/cacheflush.h | 18 | ||||
-rw-r--r-- | include/asm-sh/page.h | 11 |
2 files changed, 21 insertions, 8 deletions
diff --git a/include/asm-sh/cacheflush.h b/include/asm-sh/cacheflush.h index aa558da08471..b91246153b7e 100644 --- a/include/asm-sh/cacheflush.h +++ b/include/asm-sh/cacheflush.h @@ -43,21 +43,31 @@ extern void __flush_purge_region(void *start, int size); extern void __flush_invalidate_region(void *start, int size); #endif -#define flush_cache_vmap(start, end) flush_cache_all() -#define flush_cache_vunmap(start, end) flush_cache_all() +#ifdef CONFIG_CPU_SH4 +extern void copy_to_user_page(struct vm_area_struct *vma, + struct page *page, unsigned long vaddr, void *dst, const void *src, + unsigned long len); -#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ +extern void copy_from_user_page(struct vm_area_struct *vma, + struct page *page, unsigned long vaddr, void *dst, const void *src, + unsigned long len); +#else +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ do { \ flush_cache_page(vma, vaddr, page_to_pfn(page));\ memcpy(dst, src, len); \ flush_icache_user_range(vma, page, vaddr, len); \ } while (0) -#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ do { \ flush_cache_page(vma, vaddr, page_to_pfn(page));\ memcpy(dst, src, len); \ } while (0) +#endif + +#define flush_cache_vmap(start, end) flush_cache_all() +#define flush_cache_vunmap(start, end) flush_cache_all() #define HAVE_ARCH_UNMAPPED_AREA diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 3aa8b07da47d..d00a8fde7c7f 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h @@ -73,10 +73,13 @@ extern void copy_page_nommu(void *to, void *from); #if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \ (defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB)) struct page; -extern void clear_user_page(void *to, unsigned long address, struct page *pg); -extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg); -extern void __clear_user_page(void *to, void *orig_to); -extern void __copy_user_page(void *to, void *from, void *orig_to); +struct vm_area_struct; +extern void clear_user_page(void *to, unsigned long address, struct page *page); +#ifdef CONFIG_CPU_SH4 +extern void copy_user_highpage(struct page *to, struct page *from, + unsigned long vaddr, struct vm_area_struct *vma); +#define __HAVE_ARCH_COPY_USER_HIGHPAGE +#endif #else #define clear_user_page(page, vaddr, pg) clear_page(page) #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |