Commit 54f6d1be authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Tony Luck

[IA64] Fix memcpy_fromio prototype

Remove one layer of indirection from memcpy_fromio/memcpy_toio/memset_io
and fix the prototypes to be const where appropriate.
Signed-off-by: default avatarMatthew Wilcox <matthew@wil.cx>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 445fe6d1
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
* Copy data from IO memory space to "real" memory space. * Copy data from IO memory space to "real" memory space.
* This needs to be optimized. * This needs to be optimized.
*/ */
void void memcpy_fromio(void *to, const volatile void __iomem *from, long count)
__ia64_memcpy_fromio (void *to, volatile void __iomem *from, long count)
{ {
char *dst = to; char *dst = to;
...@@ -18,30 +17,28 @@ __ia64_memcpy_fromio (void *to, volatile void __iomem *from, long count) ...@@ -18,30 +17,28 @@ __ia64_memcpy_fromio (void *to, volatile void __iomem *from, long count)
*dst++ = readb(from++); *dst++ = readb(from++);
} }
} }
EXPORT_SYMBOL(__ia64_memcpy_fromio); EXPORT_SYMBOL(memcpy_fromio);
/* /*
* Copy data from "real" memory space to IO memory space. * Copy data from "real" memory space to IO memory space.
* This needs to be optimized. * This needs to be optimized.
*/ */
void void memcpy_toio(volatile void __iomem *to, const void *from, long count)
__ia64_memcpy_toio (volatile void __iomem *to, void *from, long count)
{ {
char *src = from; const char *src = from;
while (count) { while (count) {
count--; count--;
writeb(*src++, to++); writeb(*src++, to++);
} }
} }
EXPORT_SYMBOL(__ia64_memcpy_toio); EXPORT_SYMBOL(memcpy_toio);
/* /*
* "memset" on IO memory space. * "memset" on IO memory space.
* This needs to be optimized. * This needs to be optimized.
*/ */
void void memset_io(volatile void __iomem *dst, int c, long count)
__ia64_memset_c_io (volatile void __iomem *dst, unsigned long c, long count)
{ {
unsigned char ch = (char)(c & 0xff); unsigned char ch = (char)(c & 0xff);
...@@ -51,7 +48,7 @@ __ia64_memset_c_io (volatile void __iomem *dst, unsigned long c, long count) ...@@ -51,7 +48,7 @@ __ia64_memset_c_io (volatile void __iomem *dst, unsigned long c, long count)
dst++; dst++;
} }
} }
EXPORT_SYMBOL(__ia64_memset_c_io); EXPORT_SYMBOL(memset_io);
#ifdef CONFIG_IA64_GENERIC #ifdef CONFIG_IA64_GENERIC
......
...@@ -447,14 +447,9 @@ iounmap (volatile void __iomem *addr) ...@@ -447,14 +447,9 @@ iounmap (volatile void __iomem *addr)
/* /*
* String version of IO memory access ops: * String version of IO memory access ops:
*/ */
extern void __ia64_memcpy_fromio (void *, volatile void __iomem *, long); extern void memcpy_fromio(void *dst, const volatile void __iomem *src, long n);
extern void __ia64_memcpy_toio (volatile void __iomem *, void *, long); extern void memcpy_toio(volatile void __iomem *dst, const void *src, long n);
extern void __ia64_memset_c_io (volatile void __iomem *, unsigned long, long); extern void memset_io(volatile void __iomem *s, int c, long n);
#define memcpy_fromio(to,from,len) __ia64_memcpy_fromio((to), (from),(len))
#define memcpy_toio(to,from,len) __ia64_memcpy_toio((to),(from),(len))
#define memset_io(addr,c,len) __ia64_memset_c_io((addr), 0x0101010101010101UL*(u8)(c), \
(len))
#define dma_cache_inv(_start,_size) do { } while (0) #define dma_cache_inv(_start,_size) do { } while (0)
#define dma_cache_wback(_start,_size) do { } while (0) #define dma_cache_wback(_start,_size) do { } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment