Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 2010 02:21:18 +0000 (UTC)
From:      Jeff Roberson <jeff@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r210591 - projects/ofed/head/sys/ofed/include/linux
Message-ID:  <201007290221.o6T2LIIg001695@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jeff
Date: Thu Jul 29 02:21:18 2010
New Revision: 210591
URL: http://svn.freebsd.org/changeset/base/210591

Log:
   - Define some memcpy_* routines.
  
  Sponsored by:	Isilon Systems, iX Systems, and Panasas.

Modified:
  projects/ofed/head/sys/ofed/include/linux/io.h
  projects/ofed/head/sys/ofed/include/linux/socket.h

Modified: projects/ofed/head/sys/ofed/include/linux/io.h
==============================================================================
--- projects/ofed/head/sys/ofed/include/linux/io.h	Thu Jul 29 02:20:20 2010	(r210590)
+++ projects/ofed/head/sys/ofed/include/linux/io.h	Thu Jul 29 02:21:18 2010	(r210591)
@@ -92,6 +92,10 @@ writew(uint16_t b, void *addr)
 
 #define	ioremap	pmap_mapdev
 
+#define	memset_io(a, b, c)	memset((a), (b), (c))
+#define	memcpy_fromio(a, b, c)	memcpy((a), (b), (c))
+#define	memcpy_toio(a, b, c)	memcpy((a), (b), (c))
+
 /*
  * iounmap is not defined as pmap_unmapdev requires a length that can
  * not easily be determined on BSD.

Modified: projects/ofed/head/sys/ofed/include/linux/socket.h
==============================================================================
--- projects/ofed/head/sys/ofed/include/linux/socket.h	Thu Jul 29 02:20:20 2010	(r210590)
+++ projects/ofed/head/sys/ofed/include/linux/socket.h	Thu Jul 29 02:21:18 2010	(r210591)
@@ -30,4 +30,37 @@
 
 #include <sys/socket.h>
 
+#ifdef notyet
+static inline int
+memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len)
+{
+	struct uio uio;
+	int error;
+
+	uio.uio_iov = v;
+	uio.uio_iovcnt = -1;
+	uio.uio_offset = 0;
+	uio.uio_resid = len;
+	uio.uio_segflag = UIO_USERSPACE;
+	uio.uio_rw = UIO_READ;
+	error = -uiomove(kdata, len, &uio);
+	return (error);
+}
+
+static inline int
+memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len)
+{
+	struct uio uio;
+	int error;
+
+	uio.uio_iov = v;
+	uio.uio_iovcnt = -1;
+	uio.uio_offset = 0;
+	uio.uio_resid = len;
+	uio.uio_segflag = UIO_USERSPACE;
+	uio.uio_rw = UIO_WRITE;
+	error = -uiomove(kdata, len, &uio);
+}
+#endif
+
 #endif	/* _LINUX_SOCKET_H_ */



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