aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux/io.h
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2016-05-24 09:23:04 +0000
committerKevin Lo <kevlo@FreeBSD.org>2016-05-24 09:23:04 +0000
commit8636496407cfeebfcef436387c4dec61f32113b4 (patch)
tree414a576edc52ea6fd6ae4c5bded866e9129d990e /sys/compat/linuxkpi/common/include/linux/io.h
parent93fb610fe8a57c7e1b333cf899f8eacb840b1daf (diff)
downloadsrc-8636496407cfeebfcef436387c4dec61f32113b4.tar.gz
src-8636496407cfeebfcef436387c4dec61f32113b4.zip
Add __iowrite32_copy() to the Linux kernel compatibility layer.
Reviewed by: hselasky
Notes
Notes: svn path=/head/; revision=300594
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/io.h')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/io.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h
index f6c9405f7c00..090934675686 100644
--- a/sys/compat/linuxkpi/common/include/linux/io.h
+++ b/sys/compat/linuxkpi/common/include/linux/io.h
@@ -202,6 +202,17 @@ void iounmap(void *addr);
#define memcpy_toio(a, b, c) memcpy((a), (b), (c))
static inline void
+__iowrite32_copy(void *to, void *from, size_t count)
+{
+ uint32_t *src;
+ uint32_t *dst;
+ int i;
+
+ for (i = 0, src = from, dst = to; i < count; i++, src++, dst++)
+ __raw_writel(*src, dst);
+}
+
+static inline void
__iowrite64_copy(void *to, void *from, size_t count)
{
#ifdef __LP64__
@@ -212,13 +223,7 @@ __iowrite64_copy(void *to, void *from, size_t count)
for (i = 0, src = from, dst = to; i < count; i++, src++, dst++)
__raw_writeq(*src, dst);
#else
- uint32_t *src;
- uint32_t *dst;
- int i;
-
- count *= 2;
- for (i = 0, src = from, dst = to; i < count; i++, src++, dst++)
- __raw_writel(*src, dst);
+ __iowrite32_copy(to, from, count * 2);
#endif
}