Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LvhJt-0000Qq-W7 for mharc-grub-devel@gnu.org; Sun, 19 Apr 2009 20:25:10 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LvhJq-0000Pi-4d for grub-devel@gnu.org; Sun, 19 Apr 2009 20:25:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LvhJo-0000PV-59 for grub-devel@gnu.org; Sun, 19 Apr 2009 20:25:04 -0400 Received: from [199.232.76.173] (port=36205 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LvhJn-0000PN-Tc for grub-devel@gnu.org; Sun, 19 Apr 2009 20:25:03 -0400 Received: from [74.93.104.97] (port=51160 helo=sunset.davemloft.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LvhJn-0005nz-GT for grub-devel@gnu.org; Sun, 19 Apr 2009 20:25:03 -0400 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id 178FB35C12C for ; Sun, 19 Apr 2009 17:24:55 -0700 (PDT) Date: Sun, 19 Apr 2009 17:24:54 -0700 (PDT) Message-Id: <20090419.172454.193715137.davem@davemloft.net> To: grub-devel@gnu.org From: David Miller X-Mailer: Mew version 6.2.51 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH]: grub: Handle the case where the root node has size-cells but not address-cells. X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2009 00:25:06 -0000 Under OpenBoot on sparc64: The value of the #address-cells property in the root node is the default value of 2. The value of the #size-cells property in the root node is the non-default value 2. (NOTE: Since the #address-cells property value in the root node is the default value 2, the property may or may not exist since the absence of the property implies the default value.) So the address-cells property may or may not be there in the root device node. However we can depend upon the size-cells property being there, and equal to 2. The easiest way to handle this in the current grub code is to check to see if the size-cells value is larger than the address-cells value. Since that is nonsensicle, when we see that situation we set the address-cells value to be equal to size-cells. 2009-04-19 David S. Miller * kern/ieee1275/mmap.c (grub_machine_mmap_iterate): If size_cells is larger than address_cells, use that value for address_cells too. --- kern/ieee1275/mmap.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kern/ieee1275/mmap.c b/kern/ieee1275/mmap.c index 5b30dbb..317a121 100644 --- a/kern/ieee1275/mmap.c +++ b/kern/ieee1275/mmap.c @@ -38,6 +38,9 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uin grub_ieee1275_get_integer_property (root, "#size-cells", &size_cells, sizeof size_cells, 0); + if (size_cells > address_cells) + address_cells = size_cells; + /* Load `/memory/available'. */ if (grub_ieee1275_finddevice ("/memory", &memory)) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, -- 1.6.2.3