From owner-svn-src-all@FreeBSD.ORG Thu Jan 13 00:06:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1793E106564A; Thu, 13 Jan 2011 00:06:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 8D0F28FC0C; Thu, 13 Jan 2011 00:06:25 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0D06LMu011430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Jan 2011 11:06:22 +1100 Date: Thu, 13 Jan 2011 11:06:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin In-Reply-To: <201101121621.30371.jhb@freebsd.org> Message-ID: <20110113104728.L1003@besplex.bde.org> References: <201101122108.p0CL8o3Q012038@svn.freebsd.org> <201101121621.30371.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Matthew D Fleming , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217330 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2011 00:06:26 -0000 On Wed, 12 Jan 2011, John Baldwin wrote: >> 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(). U_LONG should work on all arches. malloc(9) still uses u_long instead of size_t. This works for scalars even on the recently removed i386's with 32-bit longs where u_long is larger than size_t, since larger is a fail-safe direction. This fails for pointers. Newer parts of malloc() and uma are broken unless u_long is the same as uintptr_t, since they cast pointers to u_long. This direction is fail-safe too, but gcc warns about it. uquad_t should never be used, like unsigned long long. Similarly for signed types. Perhaps it could be removed in sysctl interfaces first. Bruce