From owner-svn-src-projects@FreeBSD.ORG Thu Jul 29 02:21:18 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B720C1065672; Thu, 29 Jul 2010 02:21:18 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C3AC8FC18; Thu, 29 Jul 2010 02:21:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6T2LIaM001698; Thu, 29 Jul 2010 02:21:18 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6T2LIIg001695; Thu, 29 Jul 2010 02:21:18 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201007290221.o6T2LIIg001695@svn.freebsd.org> From: Jeff Roberson Date: Thu, 29 Jul 2010 02:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210591 - projects/ofed/head/sys/ofed/include/linux X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2010 02:21:18 -0000 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 +#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_ */