diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2007-07-27 09:34:42 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2007-07-27 09:34:42 +0000 |
commit | 16ad7cce99fdefc348a2c705afbcdccf1057386f (patch) | |
tree | f77724bc66fab766124306f6e6f47ca30b61fb69 /sys | |
parent | c2dedaa0a97d92108e28cc25b06bf5442d7488e9 (diff) | |
download | FreeBSD-src-16ad7cce99fdefc348a2c705afbcdccf1057386f.zip FreeBSD-src-16ad7cce99fdefc348a2c705afbcdccf1057386f.tar.gz |
It seems that some i386 mothermoards either do not implement the
day of week field correctly, or they remember bad values that are
written into the day of week field. For this reason, ignore the day
of week field when reading the clock on i386 rather than bailing if
it is set incorrectly.
Problems were seen on a number of platforms, including VMWare, qemu,
EPIA ME6000, Epox-3PTA and ABIT-SL30T.
This is a slightly different fix to that proposed by Ted in his PR,
but the same basic idea.
PR: 111117
Submitted by: Ted Faber <faber@lunabase.org>
Approved by: re (rwatson)
MFC after: 3 weeks
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/isa/clock.c | 3 | ||||
-rw-r--r-- | sys/isa/atrtc.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index a519a9e..4b848c4 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -703,7 +703,8 @@ inittodr(time_t base) #else ct.year += 2000; #endif - /* Should we set dow = -1 because some clocks don't set it correctly? */ + /* Set dow = -1 because some clocks don't set it correctly. */ + ct.dow = -1; if (clock_ct_to_ts(&ct, &ts)) { printf("Invalid time in clock: check and reset the date!\n"); return; diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index a519a9e..4b848c4 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -703,7 +703,8 @@ inittodr(time_t base) #else ct.year += 2000; #endif - /* Should we set dow = -1 because some clocks don't set it correctly? */ + /* Set dow = -1 because some clocks don't set it correctly. */ + ct.dow = -1; if (clock_ct_to_ts(&ct, &ts)) { printf("Invalid time in clock: check and reset the date!\n"); return; |