From owner-svn-src-all@FreeBSD.ORG Thu Jan 13 02:54:01 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 B8640106564A; Thu, 13 Jan 2011 02:54:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 4DD228FC08; Thu, 13 Jan 2011 02:54:00 +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 mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0D2rvWl024946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Jan 2011 13:53:58 +1100 Date: Thu, 13 Jan 2011 13:53:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: mdf@FreeBSD.org In-Reply-To: Message-ID: <20110113132935.A1458@besplex.bde.org> References: <201101122108.p0CL8o3Q012038@svn.freebsd.org> <201101121621.30371.jhb@freebsd.org> <20110113104728.L1003@besplex.bde.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1264095000-1294887237=:1458" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin , Bruce Evans 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 02:54:01 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1264095000-1294887237=:1458 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 12 Jan 2011 mdf@FreeBSD.org wrote: > On Wed, Jan 12, 2011 at 4:06 PM, Bruce Evans wrote= : >> On Wed, 12 Jan 2011, John Baldwin wrote: >>> ... >>> 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. =A0malloc(9) still uses u_long instead >> of size_t. =A0This 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. =A0This fails for pointers. =A0Newer parts of mal= loc() >> and uma are broken unless u_long is the same as uintptr_t, since they >> cast pointers to u_long. =A0This direction is fail-safe too, but gcc war= ns >> about it. > > In this case for PAE u_long is (theoretically) too small, because a > bus_size_t is an uint64_t. Lucky there is no BUS_SIZE_MAX to complicate recent changes to :-). >> uquad_t should never be used, like unsigned long long. =A0Similarly for >> signed types. =A0Perhaps it could be removed in sysctl interfaces first. > > The name SYSCTL_ADD_UQUAD is a little misleading since it's really for > a uint64_t. The name could be changed, but there's already plenty of > existing uses of QUAD for int64_t which aren't being changed. Yes, I almost suggested changing all of these to int64_t etc. Recent changes to result in quad_t and its limits being assumed to be the same as int64_t on all arches, at the top level (previously this was stated to be true by MD levels, except for some broken cases where the limits had type long long but int64_t has type long). quad_t must be precisely 64 bits 2's complement with no padding to work. int64_t must be the same to meet its spec. Now I seem to remember that sysctl() users are the largest user of quad_t's (since sysctl never supported int64_t or intmax_t). It would be easy to change all its quads to int64's since these types must be essentially the same to work. But as you know too well, there are now an enormous number of sysctls to change from [U]QUAD to [U]INT64. This despite CTLTYPE_QUAD being unused between at least 4.4BSD-Lite2 and FreeBSD-3, and being broken in sysctl(8) between FreeBSD-4 and ~2007. I tried to kill quads and long longs 10-15 years ago because they were about to be superseded by initmax_t, but of course they are used much more now :-(. Bruce --0-1264095000-1294887237=:1458--