blob: 3f1eb59b5f08bda91acc5ae33c94e73b350c6524 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#include <linux/string.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#include <linux/module.h>
Paolo Ciarrocchi4b44f812008-02-17 14:41:16 +01003#include <asm/io.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
Paolo Ciarrocchi4b44f812008-02-17 14:41:16 +01005void __memcpy_toio(unsigned long dst, const void *src, unsigned len)
Linus Torvalds1da177e2005-04-16 15:20:36 -07006{
Paolo Ciarrocchi4b44f812008-02-17 14:41:16 +01007 __inline_memcpy((void *)dst, src, len);
Linus Torvalds1da177e2005-04-16 15:20:36 -07008}
9EXPORT_SYMBOL(__memcpy_toio);
10
Paolo Ciarrocchi4b44f812008-02-17 14:41:16 +010011void __memcpy_fromio(void *dst, unsigned long src, unsigned len)
Linus Torvalds1da177e2005-04-16 15:20:36 -070012{
Paolo Ciarrocchi4b44f812008-02-17 14:41:16 +010013 __inline_memcpy(dst, (const void *)src, len);
Linus Torvalds1da177e2005-04-16 15:20:36 -070014}
15EXPORT_SYMBOL(__memcpy_fromio);
16
17void memset_io(volatile void __iomem *a, int b, size_t c)
18{
Paolo Ciarrocchi4b44f812008-02-17 14:41:16 +010019 /*
20 * TODO: memset can mangle the IO patterns quite a bit.
21 * perhaps it would be better to use a dumb one:
22 */
23 memset((void *)a, b, c);
Linus Torvalds1da177e2005-04-16 15:20:36 -070024}
25EXPORT_SYMBOL(memset_io);