]> git.proxmox.com Git - qemu.git/commitdiff
reset state for load_linux
authorGlauber Costa <glommer@redhat.com>
Fri, 8 May 2009 05:22:13 +0000 (02:22 -0300)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 8 May 2009 20:24:10 +0000 (15:24 -0500)
The linux loader is just an option rom like any other, just with
some special requirements. Right now, our option rom resetting
mechanism is not being applied to it. As a result, users using
-kernel will not be able to successfully reboot their machines

This patch fixes it by saving all the data we generated in
the load_linux() function, to be used later by the option rom
resetting mechanism.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/pc.c

diff --git a/hw/pc.c b/hw/pc.c
index 00254743ba3f1fc0e6b3a8ce47307aa4a3f3d1dd..6b4642742d0e7dabe2dd537668970ea2fd501b1b 100644 (file)
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -579,6 +579,7 @@ static void generate_bootsect(target_phys_addr_t option_rom,
     rom[sizeof(rom) - 1] = -sum;
 
     cpu_physical_memory_write_rom(option_rom, rom, sizeof(rom));
+    option_rom_setup_reset(option_rom, sizeof (rom));
 }
 
 static long get_file_size(FILE *f)
@@ -746,6 +747,12 @@ static void load_linux(target_phys_addr_t option_rom,
     memset(gpr, 0, sizeof gpr);
     gpr[4] = cmdline_addr-real_addr-16;        /* SP (-16 is paranoia) */
 
+    option_rom_setup_reset(real_addr, setup_size);
+    option_rom_setup_reset(prot_addr, kernel_size);
+    option_rom_setup_reset(cmdline_addr, cmdline_size);
+    if (initrd_filename)
+        option_rom_setup_reset(initrd_addr, initrd_size);
+
     generate_bootsect(option_rom, gpr, seg, 0);
 }