From owner-svn-src-head@FreeBSD.ORG Thu Jan 13 05:27:40 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFDFC106564A; Thu, 13 Jan 2011 05:27:40 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 6CEC88FC0C; Thu, 13 Jan 2011 05:27:40 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p0CNiv9g070111; Wed, 12 Jan 2011 16:44:57 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D2E3CF9.5080603@bsdimp.com> Date: Wed, 12 Jan 2011 16:44:57 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: mdf@FreeBSD.org References: <201101122108.p0CL8o3Q012038@svn.freebsd.org> <201101121621.30371.jhb@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r217330 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2011 05:27:40 -0000 On 01/12/2011 14:27, mdf@FreeBSD.org wrote: > On Wed, Jan 12, 2011 at 1:21 PM, John Baldwin wrote: >> On Wednesday, January 12, 2011 4:08:50 pm Matthew D Fleming wrote: >>> Author: mdf >>> Date: Wed Jan 12 21:08:49 2011 >>> New Revision: 217330 >>> URL: http://svn.freebsd.org/changeset/base/217330 >>> >>> Log: >>> Fix a brain fart. Since this file is shared between i386 and amd64, a >>> bus_size_t may be 32 or 64 bits. Change the bounce_zone alignment field >>> to explicitly be 32 bits, as I can't really imagine a DMA device that >>> needs anything close to 2GB alignment of data. >> Hmm, we do have devices with 4GB boundaries though. I think I'd prefer it if >> you instead if you did this: >> >> #if defined(amd64) || defined(PAE) >> #define SYSCTL_ADD_BUS_SIZE_T SYSCTL_ADD_UQUAD >> #else >> #define SYSCTL_ADD_BUS_SIZE_T SYSCTL_ADD_UINT >> #endif >> >> and then just used SYSCTL_ADD_BUS_SIZE_T() in the code so we could let the >> members in the bounce zone retain the same types passed to >> bus_dma_tag_create(). > But would there be a device that can't start DMA except on a 4GB > boundary? I thought that's what this member was for. You never know about weird, custom devices... This is safer and would be more future proof. its the whole reason we have the different types... And sysctl is too type-poor these days, imho, since it goes to the base type and has little facility to go for the logical type. Go on, tell me how to specify a physical address that will always work... Warner