Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 May 2016 09:23:04 +0000 (UTC)
From:      Kevin Lo <kevlo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300594 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201605240923.u4O9N4lU017097@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevlo
Date: Tue May 24 09:23:04 2016
New Revision: 300594
URL: https://svnweb.freebsd.org/changeset/base/300594

Log:
  Add __iowrite32_copy() to the Linux kernel compatibility layer.
  
  Reviewed by:	hselasky

Modified:
  head/sys/compat/linuxkpi/common/include/linux/io.h

Modified: head/sys/compat/linuxkpi/common/include/linux/io.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/io.h	Tue May 24 08:54:41 2016	(r300593)
+++ head/sys/compat/linuxkpi/common/include/linux/io.h	Tue May 24 09:23:04 2016	(r300594)
@@ -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, s
 	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
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605240923.u4O9N4lU017097>