From owner-svn-src-head@freebsd.org Wed Jan 13 01:03:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D68F9A80C88; Wed, 13 Jan 2016 01:03:56 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 829B31AC9; Wed, 13 Jan 2016 01:03:56 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 469B25A9F12; Wed, 13 Jan 2016 01:03:48 +0000 (UTC) Date: Wed, 13 Jan 2016 01:03:48 +0000 From: Brooks Davis To: Steven Hartland Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293775 - head/sys/boot/uboot/lib Message-ID: <20160113010348.GF79262@spindle.one-eyed-alien.net> References: <201601121631.u0CGV7v6074494@repo.freebsd.org> <569582F6.4060108@multiplay.co.uk> <1452644710.46848.31.camel@freebsd.org> <56959D45.7070204@multiplay.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a+b56+3nqLzpiR9O" Content-Disposition: inline In-Reply-To: <56959D45.7070204@multiplay.co.uk> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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: Wed, 13 Jan 2016 01:03:57 -0000 --a+b56+3nqLzpiR9O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 13, 2016 at 12:41:41AM +0000, Steven Hartland wrote: > Was this meant to be a full revert as you now have: >=20 > subldr =3D rounddown2((uintptr_t)_start, KERN_ALIGN); >=20 > vs the original: >=20 > subldr =3D rounddown2((uint64_t)(uintptr_t)_start, KERN_ALIGN); >=20 > i.e. missing the final conversion to uint64_t? The cast through uint64_t isn't allowed by the standard if you want the result to be a function pointer. The implementation of rounddown2() should work fine on an uintptr_t even for fairly radical implementations. -- Brooks >=20 >=20 >=20 > On 13/01/2016 00:25, Ian Lepore wrote: > > On Tue, 2016-01-12 at 22:49 +0000, Steven Hartland wrote: > >> I think this breaks arm arches: > >> /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/copy.c:103:24: > >> error: use of undeclared identifier 'uintfptr_t' > >> subldr =3D rounddown2((uintfptr_t)_start, KERN_ALIGN= ); > >> ^ > >> /usr/home/smh/freebsd/base/head1/sys/boot/uboot/lib/../../../sys/para > >> m.h:295:28: > >> note: expanded from macro 'rounddown2' > >> #define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power > >> of > >> two */ > >> > > Ooops, sorry. Should be fixed now. > > > > -- Ian > > > >> On 12/01/2016 16:31, Ian Lepore wrote: > >>> Author: ian > >>> Date: Tue Jan 12 16:31:07 2016 > >>> New Revision: 293775 > >>> URL: https://svnweb.freebsd.org/changeset/base/293775 > >>> > >>> Log: > >>> Cast using uintfptr_t and eliminate the cast to uint64_t which > >>> is uneeded > >>> because rounding down cannot increase the number of bits needed > >>> to express > >>> the result. > >>> =20 > >>> I had no idea there was such a thing as uintfptr_t. > >>> =20 > >>> Requested by: bde > >>> > >>> Modified: > >>> head/sys/boot/uboot/lib/copy.c > >>> > >>> Modified: head/sys/boot/uboot/lib/copy.c > >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>> --- head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:21:34 2016=09 > >>> (r293774) > >>> +++ head/sys/boot/uboot/lib/copy.c Tue Jan 12 16:31:07 2016=09 > >>> (r293775) > >>> @@ -100,7 +100,7 @@ uboot_loadaddr(u_int type, void *data, u > >>> =20 > >>> biggest_block =3D 0; > >>> biggest_size =3D 0; > >>> - subldr =3D rounddown2((uint64_t)(uintptr_t)_start, > >>> KERN_ALIGN); > >>> + subldr =3D rounddown2((uintfptr_t)_start, > >>> KERN_ALIGN); > >>> eubldr =3D roundup2((uint64_t)uboot_heap_end, > >>> KERN_ALIGN); > >>> for (i =3D 0; i < si->mr_no; i++) { > >>> if (si->mr[i].flags !=3D MR_ATTR_DRAM) > >>> > >> >=20 >=20 --a+b56+3nqLzpiR9O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWlaJzAAoJEKzQXbSebgfA12gH/1Tf3ZSe6+pKCDzAPYX3Ab1r yjPhwCvo2bXEw6gWoeNaU+l4uFwGmH+q97RQfdYwadJKZSx6YuG09fwZmBRvregZ QgFD7zGPnXGSWW/zv7bamXwc/u72aMx40YLqzAt0ivyMs3pjQmhyw4ltQ3FYCYet JDDHC7HJHuJ5Sw6Pnk931vq7VzGMnnPll2Y7agVucf7GlSf7zcOIFVzeaBg1aKm8 rf0JZW3NXvVSffQXAD2x9Z/6SVSVeyn+AcstwDUPWs/EWnijMun3G5qq71ZKkr7H Dr/W5jbQ6fL7KDJHnUwapMr7N9lUcJpqmIUZDOMttAQRdzQfNXd5ASv62sHHq1Y= =KySu -----END PGP SIGNATURE----- --a+b56+3nqLzpiR9O--