aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-03-13 23:04:41 -0500
committerKevin O'Connor <kevin@koconnor.net>2010-03-13 23:04:41 -0500
commit11cc662d04f29b9639f222efc9cc51bbfa2ff737 (patch)
tree72e2ac0c54c6c3511489e240cc8a6b97cf81bd0c /src
parent4ed378a3c000dd3c4226e60a468cc1ea2210254e (diff)
downloadseabios-11cc662d04f29b9639f222efc9cc51bbfa2ff737.tar.gz
Extend time for rtc to be ready.
Increase the time waiting for rtc from 3ms to 15ms - only 3ms is needed on real hardware, but scheduling delays on qemu can make this longer. Extending the time prevents annoying debugging messages.
Diffstat (limited to 'src')
-rw-r--r--src/clock.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/clock.c b/src/clock.c
index 9afa71d8..4756ea8c 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -156,18 +156,19 @@ rtc_updating(void)
// to 0, and will return 0 if such a transition occurs. A -1
// is returned only after timing out. The maximum period
// that this bit should be set is constrained to (1984+244)
- // useconds, so we wait for 3 msec max.
+ // useconds, but we wait for longer just to be sure.
if ((inb_cmos(CMOS_STATUS_A) & RTC_A_UIP) == 0)
return 0;
- u64 end = calc_future_tsc(3);
- do {
+ u64 end = calc_future_tsc(15);
+ for (;;) {
if ((inb_cmos(CMOS_STATUS_A) & RTC_A_UIP) == 0)
return 0;
- } while (!check_time(end));
-
- // update-in-progress never transitioned to 0
- return -1;
+ if (check_time(end))
+ // update-in-progress never transitioned to 0
+ return -1;
+ yield();
+ }
}
static void