From owner-freebsd-ppc@FreeBSD.ORG Sat Sep 14 23:56:41 2013 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 64DFACAA; Sat, 14 Sep 2013 23:56:41 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76E0522D1; Sat, 14 Sep 2013 23:56:40 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id cb5so2148200wib.4 for ; Sat, 14 Sep 2013 16:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ZycrML/hIP2Sah54+NzJc9dtsEWQz87fPAXwIgL86FI=; b=O8wo6agX40agX2tJMcAVOcfiqHCa5JevI5OqeZ1A8AEapGUQ7hUcDcRdG+MN526Lsp +zQdYZae4BFWNiMFcYjw+Kp4KRu6ozZs0Be32TW3EULRYRzwLbBAalxU7W1RE5na1r82 bWQzyr4jXwtxscrnGxwd59G1M2MEhzGhRKzbGWcUtm2gyAQeH1o0HTDJ+5iVuCjISRDI B13CKbgk72hX2BWhb5o9gdvBoai4/Ey1TDtwzzGPdmcTQDRBHtWJZ75ZpyakX9Blu4F6 gfYC3v+3lpmFLy0q3LI3f0WMyGz26HKbomrqURGXIm0bWCEZvzU30/I8eub8NgIq1fN1 O0Yw== MIME-Version: 1.0 X-Received: by 10.180.211.206 with SMTP id ne14mr7879817wic.30.1379202998780; Sat, 14 Sep 2013 16:56:38 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.73.133 with HTTP; Sat, 14 Sep 2013 16:56:38 -0700 (PDT) In-Reply-To: <1379181341.1197.26.camel@revolution.hippie.lan> References: <522CC7E0.9060508@freebsd.org> <5231D8A6.9080501@freebsd.org> <20130914133155.GA32845@alchemy.franken.de> <52346D71.4080407@freebsd.org> <1379173405.1197.7.camel@revolution.hippie.lan> <20130914172735.GX68682@funkthat.com> <1379181341.1197.26.camel@revolution.hippie.lan> Date: Sat, 14 Sep 2013 16:56:38 -0700 X-Google-Sender-Auth: _CI1hHXjH1V6SuhYPJe4s_9MoYo Message-ID: Subject: Re: Patch for Cross-Reference Phandles From: Adrian Chadd To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: John-Mark Gurney , FreeBSD PowerPC ML , "freebsd-arm@freebsd.org" , freebsd-sparc64 X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2013 23:56:41 -0000 ... holy crap. :-) erm, try writing some code that does something with it: int foo[2] = { 0, 0 }; main() { int i; for (i = 0; i < 2; i++) { foo[i] = i; } } .. and then make foo[2] be foo[512] and explicitly set it up to be zero'ed. see what happens. -a On 14 September 2013 10:55, Ian Lepore wrote: > On Sat, 2013-09-14 at 10:27 -0700, John-Mark Gurney wrote: > > Ian Lepore wrote this message on Sat, Sep 14, 2013 at 09:43 -0600: > > > On Sat, 2013-09-14 at 09:06 -0500, Nathan Whitehorn wrote: > > > > On 09/14/13 08:31, Marius Strobl wrote: > > > > > On Thu, Sep 12, 2013 at 10:07:18AM -0500, Nathan Whitehorn wrote: > > > > >> On 09/08/13 13:54, Nathan Whitehorn wrote: > > > > >>> Open Firmware has three namespaces for handles: > > > > >>> 1. Instance handles, for open devices > > > > >>> 2. Package handles for the client interface > > > > >>> 3. Package handles for device tree cross references > > > > >>> > > > > >>> On Powermac hardware, we assume that (2) and (3) are identical > and > > > > >>> call both phandles. On embedded FDT systems, you can't open > devices > > > > >>> and so we abuse ihandle_t for (3). IBM pSeries hardware, > however, has > > > > >>> all three things. With that in mind, I'd like to start separating > > > > >>> them. The patch at > > > > >>> http://people.freebsd.org/~nwhitehorn/xref_phandle.diff adds a > new > > > > >>> function (OF_child_xref_phandle) that takes a phandle of type > (3) and > > > > >>> turns into one of type (2) by searching for entries named > "phandle", > > > > >>> "ibm,phandle", or "linux,phandle" in the tree. This should work > for > > > > >>> FDT as well, but is not connected in the patch to anything > actually > > > > >>> FDT related. > > > > >>> > > > > >>> Comments would be appreciated. I'd like to get to get this as in > as > > > > >>> soon as possible (given the HEAD freeze) otherwise. > > > > >>> -Nathan > > > > >> Since I haven't heard anything, it shouldn't affect any existing > > > > >> platforms or code, and it would be nice to have this interface > available > > > > >> in the 10.x series, I plan to ask re@ for commit approval > tomorrow. > > > > >> Please let me know if there are any objections. > > > > > Technically that patch is fine. It would be nice if you could fix > the > > > > > style bugs before committing, though. In OF_child_xref_phandle(), > the > > > > > variables should go above the comment and you don't need to > initialize > > > > > the static global one in ofw_pcibus.c to zero explicitly. If you do > > > > > nevertheless, spaces should go before and after the '='. > > > > > > > > > > > > > Thanks! I think the explicit zero initialization adds some clarity > for > > > > people reading the code, so I'd like to keep it. The rest of the > changes > > > > have been made. > > > > -Nathan > > > > > > The explicit zero init also makes it 4 bytes harder to fit the kernel > > > into a small flash on embedded systems. We should be eliminating > > > zero-inits that move items from bss to data, not adding new ones. > > > > I just ran a simple test: > > int foo = 0; > > > > and compiled it, both with: > > FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 > > Target: x86_64-unknown-freebsd10.0 > > Thread model: posix > > > > and: > > FreeBSD clang version 3.3 (trunk 178860) 20130405 > > Target: armv6--freebsd > > Thread model: posix > > > > and: > > gcc (GCC) 4.2.1 20070831 patched [FreeBSD] > > Copyright (C) 2007 Free Software Foundation, Inc. > > This is free software; see the source for copying conditions. There is > NO > > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR > PURPOSE. > > > > all are smart enough to know that zero init is the same as locating it > > in bss, and do so... and not put it in data... Oh, these were all > > compiled w/o any options, just -c foo.c... > > > > Huh. That's pretty surprising to me, because IMO, an explicit zero-init > is NOT the same as putting it in bss, it's explicitly a way to say "I > want this in the data segment." I guess there are other ways to control > placement these days. > > -- Ian > > > _______________________________________________ > freebsd-ppc@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ppc > To unsubscribe, send any mail to "freebsd-ppc-unsubscribe@freebsd.org" >