diff options
Diffstat (limited to 'arch/sh/kernel/cpu/sh4/sq.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh4/sq.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c index 7bcc73f9b8df..d7fff752e569 100644 --- a/arch/sh/kernel/cpu/sh4/sq.c +++ b/arch/sh/kernel/cpu/sh4/sq.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/vmalloc.h> | 20 | #include <linux/vmalloc.h> |
21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
22 | #include <asm/io.h> | 22 | #include <linux/io.h> |
23 | #include <asm/page.h> | 23 | #include <asm/page.h> |
24 | #include <asm/cacheflush.h> | 24 | #include <asm/cacheflush.h> |
25 | #include <asm/cpu/sq.h> | 25 | #include <asm/cpu/sq.h> |
@@ -38,7 +38,7 @@ struct sq_mapping { | |||
38 | 38 | ||
39 | static struct sq_mapping *sq_mapping_list; | 39 | static struct sq_mapping *sq_mapping_list; |
40 | static DEFINE_SPINLOCK(sq_mapping_lock); | 40 | static DEFINE_SPINLOCK(sq_mapping_lock); |
41 | static kmem_cache_t *sq_cache; | 41 | static struct kmem_cache *sq_cache; |
42 | static unsigned long *sq_bitmap; | 42 | static unsigned long *sq_bitmap; |
43 | 43 | ||
44 | #define store_queue_barrier() \ | 44 | #define store_queue_barrier() \ |
@@ -67,6 +67,7 @@ void sq_flush_range(unsigned long start, unsigned int len) | |||
67 | /* Wait for completion */ | 67 | /* Wait for completion */ |
68 | store_queue_barrier(); | 68 | store_queue_barrier(); |
69 | } | 69 | } |
70 | EXPORT_SYMBOL(sq_flush_range); | ||
70 | 71 | ||
71 | static inline void sq_mapping_list_add(struct sq_mapping *map) | 72 | static inline void sq_mapping_list_add(struct sq_mapping *map) |
72 | { | 73 | { |
@@ -110,8 +111,9 @@ static int __sq_remap(struct sq_mapping *map, unsigned long flags) | |||
110 | 111 | ||
111 | vma->phys_addr = map->addr; | 112 | vma->phys_addr = map->addr; |
112 | 113 | ||
113 | if (remap_area_pages((unsigned long)vma->addr, vma->phys_addr, | 114 | if (ioremap_page_range((unsigned long)vma->addr, |
114 | map->size, flags)) { | 115 | (unsigned long)vma->addr + map->size, |
116 | vma->phys_addr, __pgprot(flags))) { | ||
115 | vunmap(vma->addr); | 117 | vunmap(vma->addr); |
116 | return -EAGAIN; | 118 | return -EAGAIN; |
117 | } | 119 | } |
@@ -166,7 +168,7 @@ unsigned long sq_remap(unsigned long phys, unsigned int size, | |||
166 | map->size = size; | 168 | map->size = size; |
167 | map->name = name; | 169 | map->name = name; |
168 | 170 | ||
169 | page = bitmap_find_free_region(sq_bitmap, 0x04000000, | 171 | page = bitmap_find_free_region(sq_bitmap, 0x04000000 >> PAGE_SHIFT, |
170 | get_order(map->size)); | 172 | get_order(map->size)); |
171 | if (unlikely(page < 0)) { | 173 | if (unlikely(page < 0)) { |
172 | ret = -ENOSPC; | 174 | ret = -ENOSPC; |
@@ -175,7 +177,7 @@ unsigned long sq_remap(unsigned long phys, unsigned int size, | |||
175 | 177 | ||
176 | map->sq_addr = P4SEG_STORE_QUE + (page << PAGE_SHIFT); | 178 | map->sq_addr = P4SEG_STORE_QUE + (page << PAGE_SHIFT); |
177 | 179 | ||
178 | ret = __sq_remap(map, flags); | 180 | ret = __sq_remap(map, pgprot_val(PAGE_KERNEL_NOCACHE) | flags); |
179 | if (unlikely(ret != 0)) | 181 | if (unlikely(ret != 0)) |
180 | goto out; | 182 | goto out; |
181 | 183 | ||
@@ -193,6 +195,7 @@ out: | |||
193 | kmem_cache_free(sq_cache, map); | 195 | kmem_cache_free(sq_cache, map); |
194 | return ret; | 196 | return ret; |
195 | } | 197 | } |
198 | EXPORT_SYMBOL(sq_remap); | ||
196 | 199 | ||
197 | /** | 200 | /** |
198 | * sq_unmap - Unmap a Store Queue allocation | 201 | * sq_unmap - Unmap a Store Queue allocation |
@@ -234,6 +237,7 @@ void sq_unmap(unsigned long vaddr) | |||
234 | 237 | ||
235 | kmem_cache_free(sq_cache, map); | 238 | kmem_cache_free(sq_cache, map); |
236 | } | 239 | } |
240 | EXPORT_SYMBOL(sq_unmap); | ||
237 | 241 | ||
238 | /* | 242 | /* |
239 | * Needlessly complex sysfs interface. Unfortunately it doesn't seem like | 243 | * Needlessly complex sysfs interface. Unfortunately it doesn't seem like |
@@ -402,7 +406,3 @@ module_exit(sq_api_exit); | |||
402 | MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, M. R. Brown <mrbrown@0xd6.org>"); | 406 | MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, M. R. Brown <mrbrown@0xd6.org>"); |
403 | MODULE_DESCRIPTION("Simple API for SH-4 integrated Store Queues"); | 407 | MODULE_DESCRIPTION("Simple API for SH-4 integrated Store Queues"); |
404 | MODULE_LICENSE("GPL"); | 408 | MODULE_LICENSE("GPL"); |
405 | |||
406 | EXPORT_SYMBOL(sq_remap); | ||
407 | EXPORT_SYMBOL(sq_unmap); | ||
408 | EXPORT_SYMBOL(sq_flush_range); | ||