Skip to contentSkip to conversation

[6133] target-ppc: workaround OpenBIOS limitation

Qemu-devel Aurelien Jarno 1 participant 1 message Dec 26, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 6133

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6133
Author:   aurel32
Date:     2008-12-26 23:05:23 +0000 (Fri, 26 Dec 2008)

Log Message:
-----------
target-ppc: workaround OpenBIOS limitation

Modified Paths:
--------------
trunk/hw/mac_nvram.c

Modified: trunk/hw/mac_nvram.c
===================================================================

hw/mac_nvram.c +6 -0
@@ -43,6 +43,8 @@
     uint8_t *data;
 };
 
+#define DEF_SYSTEM_SIZE 0xc10
+
 /* Direct access to NVRAM */
 uint32_t macio_nvram_read (void *opaque, uint32_t addr)
 {
@@ -151,6 +153,10 @@
     nvr->data[end++] = '\0';
 
     end = start + ((end - start + 15) & ~15);
+    /* XXX: OpenBIOS is not able to grow up a partition. Leave some space for
+       new variables. */
+    if (end < DEF_SYSTEM_SIZE)
+        end = DEF_SYSTEM_SIZE;
     OpenBIOS_finish_partition(part_header, end - start);
 
     // free partition