Skip to contentSkip to conversation

: grub: Handle the case where the root node has size-cells but not address-cells.

PATCH In review David Miller 1 participant 2 messages Apr 20, 2009 – Apr 22, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : grub: Handle the case where the root node has size-cells but not address-cells.

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 <[email protected]>

* 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(-)
kern/ieee1275/mmap.c +3 -0
index 5b30dbb..317a121 100644
@@ -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,
Signature · 1 line
1.6.2.3
#1 lore raw

From: David Miller <[email protected]>
Date: Sun, 19 Apr 2009 17:24:54 -0700 (PDT)

Quoted 4 lines

2009-04-19 David S. Miller <[email protected]>

* kern/ieee1275/mmap.c (grub_machine_mmap_iterate): If size_cells is larger than address_cells, use that value for address_cells too.

Committed.