svn commit: r210591 - projects/ofed/head/sys/ofed/include/linux
Jeff Roberson
jeff at FreeBSD.org
Thu Jul 29 02:21:18 UTC 2010
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_ */
More information about the svn-src-projects
mailing list