grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH]: grub: Handle the case where the root node has size-cells but no


From: David Miller
Subject: [PATCH]: grub: Handle the case where the root node has size-cells but not address-cells.
Date: Sun, 19 Apr 2009 17:24:54 -0700 (PDT)

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  <address@hidden>

        * 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]