diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2005-09-03 18:57:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:06:19 -0400 |
commit | 2855b97020f6d4a4dfb005fb77c0b79c8cb9d13f (patch) | |
tree | 6746ded865a27cb23f1646ea2b9e10f76c9d9601 /include/asm-m68k | |
parent | 69f447cffb911bb2d9737fa905f6d983ec2aa5d3 (diff) |
[PATCH] m68k: move cache functions into separate file
Move a few cache functions into its own file and fix flush_icache_range() so
it can handle both kernel and user addresses correctly (assuming context is
set correctly).
Turn copy_to_user_page/copy_from_user_page into inline functions and add a
missing cache flush.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-m68k')
-rw-r--r-- | include/asm-m68k/cacheflush.h | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/include/asm-m68k/cacheflush.h b/include/asm-m68k/cacheflush.h index e4773946f10d..8aba971b1368 100644 --- a/include/asm-m68k/cacheflush.h +++ b/include/asm-m68k/cacheflush.h | |||
@@ -130,20 +130,25 @@ static inline void __flush_page_to_ram(void *vaddr) | |||
130 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | 130 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
131 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | 131 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
132 | #define flush_icache_page(vma, page) __flush_page_to_ram(page_address(page)) | 132 | #define flush_icache_page(vma, page) __flush_page_to_ram(page_address(page)) |
133 | #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) | ||
134 | |||
135 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | ||
136 | do { \ | ||
137 | flush_cache_page(vma, vaddr, page_to_pfn(page));\ | ||
138 | memcpy(dst, src, len); \ | ||
139 | } while (0) | ||
140 | |||
141 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | ||
142 | do { \ | ||
143 | flush_cache_page(vma, vaddr, page_to_pfn(page));\ | ||
144 | memcpy(dst, src, len); \ | ||
145 | } while (0) | ||
146 | 133 | ||
134 | extern void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, | ||
135 | unsigned long addr, int len); | ||
147 | extern void flush_icache_range(unsigned long address, unsigned long endaddr); | 136 | extern void flush_icache_range(unsigned long address, unsigned long endaddr); |
148 | 137 | ||
138 | static inline void copy_to_user_page(struct vm_area_struct *vma, | ||
139 | struct page *page, unsigned long vaddr, | ||
140 | void *dst, void *src, int len) | ||
141 | { | ||
142 | flush_cache_page(vma, vaddr, page_to_pfn(page)); | ||
143 | memcpy(dst, src, len); | ||
144 | flush_icache_user_range(vma, page, vaddr, len); | ||
145 | } | ||
146 | static inline void copy_from_user_page(struct vm_area_struct *vma, | ||
147 | struct page *page, unsigned long vaddr, | ||
148 | void *dst, void *src, int len) | ||
149 | { | ||
150 | flush_cache_page(vma, vaddr, page_to_pfn(page)); | ||
151 | memcpy(dst, src, len); | ||
152 | } | ||
153 | |||
149 | #endif /* _M68K_CACHEFLUSH_H */ | 154 | #endif /* _M68K_CACHEFLUSH_H */ |