From owner-freebsd-current@FreeBSD.ORG Sat Oct 15 15:13:31 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C262106564A; Sat, 15 Oct 2011 15:13:31 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 40D928FC17; Sat, 15 Oct 2011 15:13:31 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LT400G004YIJD00@smtpauth3.wiscmail.wisc.edu>; Sat, 15 Oct 2011 10:13:30 -0500 (CDT) Received: from comporellon.tachypleus.net (adsl-76-208-70-34.dsl.mdsnwi.sbcglobal.net [76.208.70.34]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LT4009KG4YHMB10@smtpauth3.wiscmail.wisc.edu>; Sat, 15 Oct 2011 10:13:30 -0500 (CDT) Date: Sat, 15 Oct 2011 10:13:29 -0500 From: Nathan Whitehorn In-reply-to: To: "Jayachandran C." Message-id: <4E99A319.20801@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.70.34 X-Spam-PmxInfo: Server=avs-14, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.10.15.150015, SenderIP=76.208.70.34 References: <4E989C28.3030606@freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0) Gecko/20110928 Thunderbird/7.0 Cc: Rafal Jaworowski , Marcel Moolenaar , FreeBSD Current Subject: Re: [RFC] FDT fix for 64 bit platforms X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 15 Oct 2011 15:13:31 -0000 On 10/15/11 01:12, Jayachandran C. wrote: > On Sat, Oct 15, 2011 at 2:01 AM, Nathan Whitehorn > wrote: >> On 10/14/11 14:10, Jayachandran C. wrote: >>> I'm planning commit this -CURRENT if there an no objections. >>> >>> In the current implementation, phandle is used to store a pointer to >>> the location inside the device tree. Since phandle_t is u32, this >>> will not work on 64 bit platforms. With this fix, the phandle is the >>> offset from the start of device tree pointer 'fdtp', which will be 32 >>> bit. >>> >>> Review or testing from device tree users will be welcome. >>> >>> JC. >> Why not use offsets into the FDT rather than full pointers? I believe having >> phandles greater than 32 bits violates the FDT spec, and declaring that the >> FDT can't itself be larger than 4 GB seems reasonable. > I am actually using the offset from the beginning of FDT (fdtp) as > phandle. I cannot use the usual fdt offset (after off_dt_struct) as > phandle, because in that case offset of 0 is valid, but phandle 0 > should not be valid. Why shouldn't phandle 0 be valid? The invalid phandle is -1. This is one of the problems with our existing FDT code -- it makes all kinds of wrong assumptions like this about IEEE 1275. -Nathan