From owner-svn-src-projects@FreeBSD.ORG Wed Jan 9 05:02:56 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A85A7D6A; Wed, 9 Jan 2013 05:02:56 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6ACFC11E; Wed, 9 Jan 2013 05:02:56 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0952umt043601; Wed, 9 Jan 2013 05:02:56 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0952tCY043599; Wed, 9 Jan 2013 05:02:55 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201301090502.r0952tCY043599@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 9 Jan 2013 05:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r245214 - in projects/altix2/sys: kern sys X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 09 Jan 2013 05:02:56 -0000 Author: marcel Date: Wed Jan 9 05:02:55 2013 New Revision: 245214 URL: http://svnweb.freebsd.org/changeset/base/245214 Log: Add the BUSDMA_ALLOC_CONSISTENT flag. Pass it along in the mtag and save it in the memory descriptor. The flag tells the backend that the allocation needs a coherent and unbuffered (synchronous) DMA mapping because it's used for a CPU and device handshake protocol, such as mailboxes and/or buffer rings. On the SGI Altix, this means that we cannot use a direct-mapped 32-bit DMA address, nor a 64-bit DAC address when the PCI bus is not in PCI-X mode. Modified: projects/altix2/sys/kern/subr_busdma.c projects/altix2/sys/sys/busdma.h Modified: projects/altix2/sys/kern/subr_busdma.c ============================================================================== --- projects/altix2/sys/kern/subr_busdma.c Wed Jan 9 04:04:30 2013 (r245213) +++ projects/altix2/sys/kern/subr_busdma.c Wed Jan 9 05:02:55 2013 (r245214) @@ -813,7 +813,7 @@ busdma_mem_alloc(struct busdma_tag *tag, if (md == NULL) return (ENOMEM); - mtag.dmt_flags = flags & BUSDMA_MD_PLATFORM_FLAGS; + mtag.dmt_flags = flags; mtag.dmt_minaddr = tag->dt_minaddr; mtag.dmt_maxaddr = tag->dt_maxaddr; mtag.dmt_maxsz = tag->dt_maxsegsz; @@ -826,7 +826,7 @@ busdma_mem_alloc(struct busdma_tag *tag, goto fail; } - md->md_flags |= mtag.dmt_flags & BUSDMA_MD_PLATFORM_FLAGS; + md->md_flags = mtag.dmt_flags; mflags = (flags & BUSDMA_ALLOC_ZERO) ? M_ZERO : 0; idx = 0; Modified: projects/altix2/sys/sys/busdma.h ============================================================================== --- projects/altix2/sys/sys/busdma.h Wed Jan 9 04:04:30 2013 (r245213) +++ projects/altix2/sys/sys/busdma.h Wed Jan 9 05:02:55 2013 (r245214) @@ -148,9 +148,12 @@ busdma_md_get_pointer(busdma_md_t md, u_ */ int busdma_mem_alloc(busdma_tag_t tag, u_int flags, busdma_md_t *md_p); -/* Allocate pre-zeroed memory. */ +/* Allocate pre-zeroed DMA memory. */ #define BUSDMA_ALLOC_ZERO 0x10000 +/* Allocate memory with consistent mapping. */ +#define BUSDMA_ALLOC_CONSISTENT 0x20000 + /* * busdma_mem_free * returns: errno value