summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2013-03-05 17:52:21 +0800
committerGerd Hoffmann <kraxel@redhat.com>2013-05-15 07:47:31 +0200
commitd4f7d90f47462b4e8836899adc5060fbde5253e9 (patch)
tree1298346f7cfe5b9c550e1b0560fad60ebe34a317
parent49b9c599b5a05ef8b557bc5f10872a6093aef771 (diff)
downloadqemu-seabios-1.7.2-stable.tar.gz
Cache boot-fail-wait to avoid romfile access after POST.rel-1.7.2.21.7.2-stable
Memory allocated with malloc_tmp() can't be used after the POST phase. So, access boot-fail-wait in post phase and store it for the boot phase to use. This fixes the regression introduced by commit 59d6ca52. Signed-off-by: Kevin O'Connor <kevin@koconnor.net> Signed-off-by: Amos Kong <akong@redhat.com> (cherry picked from commit 11a7234491cb2a027b0fa5e82af38a3e78b44c80)
-rw-r--r--src/boot.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/boot.c b/src/boot.c
index 56843e3..1a2218e 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -228,6 +228,7 @@ int bootprio_find_usb(struct usbdevice_s *usbdev, int lun)
* Boot setup
****************************************************************/
+static int BootRetryTime;
static int CheckFloppySig = 1;
#define DEFAULT_PRIO 9999
@@ -264,6 +265,8 @@ boot_setup(void)
}
}
+ BootRetryTime = romfile_loadint("etc/boot-fail-wait", 60*1000);
+
loadBootOrder();
}
@@ -628,15 +631,15 @@ boot_rom(u32 vector)
static void
boot_fail(void)
{
- u32 retrytime = romfile_loadint("etc/boot-fail-wait", 60*1000);
- if (retrytime == (u32)-1)
+ if (BootRetryTime == (u32)-1)
printf("No bootable device.\n");
else
- printf("No bootable device. Retrying in %d seconds.\n", retrytime/1000);
- // Wait for 'retrytime' milliseconds and then reboot.
- u32 end = calc_future_timer(retrytime);
+ printf("No bootable device. Retrying in %d seconds.\n"
+ , BootRetryTime/1000);
+ // Wait for 'BootRetryTime' milliseconds and then reboot.
+ u32 end = calc_future_timer(BootRetryTime);
for (;;) {
- if (retrytime != (u32)-1 && check_timer(end))
+ if (BootRetryTime != (u32)-1 && check_timer(end))
break;
yield_toirq();
}