Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #include <linux/string.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #include <linux/module.h> |
Paolo Ciarrocchi | 4b44f81 | 2008-02-17 14:41:16 +0100 | [diff] [blame] | 3 | #include <asm/io.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
Paolo Ciarrocchi | 4b44f81 | 2008-02-17 14:41:16 +0100 | [diff] [blame] | 5 | void __memcpy_toio(unsigned long dst, const void *src, unsigned len) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | { |
Paolo Ciarrocchi | 4b44f81 | 2008-02-17 14:41:16 +0100 | [diff] [blame] | 7 | __inline_memcpy((void *)dst, src, len); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | } |
| 9 | EXPORT_SYMBOL(__memcpy_toio); |
| 10 | |
Paolo Ciarrocchi | 4b44f81 | 2008-02-17 14:41:16 +0100 | [diff] [blame] | 11 | void __memcpy_fromio(void *dst, unsigned long src, unsigned len) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | { |
Paolo Ciarrocchi | 4b44f81 | 2008-02-17 14:41:16 +0100 | [diff] [blame] | 13 | __inline_memcpy(dst, (const void *)src, len); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | } |
| 15 | EXPORT_SYMBOL(__memcpy_fromio); |
| 16 | |
| 17 | void memset_io(volatile void __iomem *a, int b, size_t c) |
| 18 | { |
Paolo Ciarrocchi | 4b44f81 | 2008-02-17 14:41:16 +0100 | [diff] [blame] | 19 | /* |
| 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | } |
| 25 | EXPORT_SYMBOL(memset_io); |