aboutsummaryrefslogtreecommitdiff
path: root/hw/mac_nvram.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-26 23:05:23 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-26 23:05:23 +0000
commitbd89f43f3254f672648ef292dff05736b339ab96 (patch)
treeb378638163d5254bdb6ac831df06dbab0cf86197 /hw/mac_nvram.c
parent3f7cbbbdd4d45f30f1dfcb3905cee5e085f99011 (diff)
downloadqemu-bd89f43f3254f672648ef292dff05736b339ab96.zip
qemu-bd89f43f3254f672648ef292dff05736b339ab96.tar.gz
qemu-bd89f43f3254f672648ef292dff05736b339ab96.tar.bz2
target-ppc: workaround OpenBIOS limitation
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6133 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/mac_nvram.c')
-rw-r--r--hw/mac_nvram.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/mac_nvram.c b/hw/mac_nvram.c
index 6bf666f..b4e9deb 100644
--- a/hw/mac_nvram.c
+++ b/hw/mac_nvram.c
@@ -43,6 +43,8 @@ struct MacIONVRAMState {
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 @@ void pmac_format_nvram_partition (MacIONVRAMState *nvr, int len)
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