From owner-freebsd-current@freebsd.org Tue Nov 17 16:04:36 2015 Return-Path: Delivered-To: freebsd-current@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 7700AA30F62 for ; Tue, 17 Nov 2015 16:04:36 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4292B19F3 for ; Tue, 17 Nov 2015 16:04:36 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by ioir85 with SMTP id r85so23134790ioi.1 for ; Tue, 17 Nov 2015 08:04:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=0q+jmYKce+UFqqwod75Cgco/ciuPd6aLV9vnHBkrRUQ=; b=kEpcy/dhzNku7fCtcs01GOF6J6YapNGWSItDEu+y8QeWbhjq/o228SdMM9VO09kUU6 gfoydX7mo8B1+deBch62TS7B9VFkWKbM4kWaDYopNwPhVI1CBLqtYxH3wE1KeDMtjwlJ kuNdyT9xKzqrJHGmaySLkXooYJXVixsum14/q6x+lKhDC7WCdaI2bWHnVaITLzpUUnz1 GcKBpUTobTGdXxz4vhcIowGtNG9HDwzKLV3nAoE/fyYiKmaaFdHtl6xRW3jwBWFmx1Uy vMae/mZsQesX1YU37IkFY9L5TzENtmilA4Z2tKnthAJROk0HgX6q7T1yfKZ7tbsFZe9D qp3w== MIME-Version: 1.0 X-Received: by 10.107.16.144 with SMTP id 16mr46897093ioq.119.1447776275527; Tue, 17 Nov 2015 08:04:35 -0800 (PST) Received: by 10.36.222.198 with HTTP; Tue, 17 Nov 2015 08:04:35 -0800 (PST) In-Reply-To: References: <75C2B97F-3C5E-49E3-A584-DE84463889FC@gmail.com> <0F3B8FF2-E54E-446F-8D4E-415A1111EF4D@bsdimp.com> Date: Tue, 17 Nov 2015 10:04:35 -0600 Message-ID: Subject: Re: CFT: uintmax_t rman From: Justin Hibbits To: Benjamin Kaduk Cc: Warner Losh , FreeBSD Current Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2015 16:04:36 -0000 On Mon, Nov 16, 2015 at 6:25 PM, Benjamin Kaduk wrote: > On Mon, 16 Nov 2015, Warner Losh wrote: > >> > >> > On Nov 15, 2015, at 9:13 PM, Justin Hibbits wro= te: >> > >> > (Attempted to send this yesterday, but appears it didn't go through. = Apologies if it really did go through). >> > >> > As part of a project getting FreeBSD on the Freescale P5020 SoC, I inc= reased the width of resources, from u_long(32 bits on 32-bit archs, 64 bits= on 64-bit archs) to uintmax_t (currently 64 bits on all archs). I have it= working on PowerPC, but have not tested it on any other architecture, I ha= ve no other systems to test it with, so I need help. This passes a tinderb= ox build. I need this tested on other archs, the more the better, especial= ly i386, including PAE. >> > >> > It should be effectively a no-op on most architectures, especially 64-= bit archs, though there were some checks I found in x86 code clamping addre= ss checks to under 4GB, commented as necessary purely for rman. If this is= n't the case, and we can't yet handle the checks being removed, they can go= in, but that needs testing. It should apply cleanly to recent head. >> >> I like the idea. There=E2=80=99s nothing offensive enough in the diffs t= o comment upon here (though I suppose I could see a few spots one could qui= bble over if one were so inclined). >> >> I wonder, though, why not make its own typedef, even if it is just >> =E2=80=98typedef man_res_t uintmax_t;=E2=80=99 in the rman headers? > > Channeling my inner bde (maybe?), the typedef is probably helpful, but > uintmax_t seems less so. uintmax_t has no guaranteed ABI, so a > fixed-width type like uint64_t seems beter, assuming that uintmax_t is > currently uint64_t everywhere (which I think is the case but did not > verify). > > -Ben I'm not opposed to a typedef for this, bde suggested I just use straight uintmax_t, so it's a good starting point for wider testing. I'm fine with anything as long as it's guaranteed to be the largest integer size (uintmax_t guarantees that, so any typedef of that is sufficient for me). Any name suggestions are appreciated, but what I want more than that right now is testing. Hammer the hell out of this on as wide a variety of platforms as anyone can, to make sure it doesn't break in odd cases. If typedefs are desired, it's no more work than a simple sed plus a single added line. If this breaks anything, that's the bigger problem. - Justin