summaryrefslogtreecommitdiffstats
path: root/sys/amd64/isa
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-12-04 13:46:49 +0000
committerphk <phk@FreeBSD.org>2002-12-04 13:46:49 +0000
commit7beb8a484e9e81dd0521f9480bd23f0cc33386f4 (patch)
treede81061901875a5c3e904ff3c96b0ae30fefdbd8 /sys/amd64/isa
parentfdd44c57ca843e292df42853dc891a43b435fa1d (diff)
downloadFreeBSD-src-7beb8a484e9e81dd0521f9480bd23f0cc33386f4.zip
FreeBSD-src-7beb8a484e9e81dd0521f9480bd23f0cc33386f4.tar.gz
Use the correct value when writing the Day Of Week byte in the CMOS.
The correct range is [1...7] with Sunday=1, but we have been writing [0...6] with Sunday=0. The Soekris computers flagged the zero, zapped the date, so if you rebooted your soekris on a sunday, it would come up with a wrong date. Bruce has a more extensive rework of this code, but we will stick with the minimalist fix for now. Spotted by: Soren Kristensen <soren@soekris.com> Thanks to: Michael Sierchio <kudzu@tenebras.com>. Confirmed by: bde Approved by: re
Diffstat (limited to 'sys/amd64/isa')
-rw-r--r--sys/amd64/isa/clock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c
index 93d486c..140f6bc 100644
--- a/sys/amd64/isa/clock.c
+++ b/sys/amd64/isa/clock.c
@@ -943,7 +943,7 @@ resettodr()
writertc(RTC_HRS, bin2bcd(tm%24)); tm /= 24; /* Write back Hours */
/* We have now the days since 01-01-1970 in tm */
- writertc(RTC_WDAY, (tm+4)%7); /* Write back Weekday */
+ writertc(RTC_WDAY, (tm + 4) % 7 + 1); /* Write back Weekday */
for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y);
tm >= m;
y++, m = DAYSPERYEAR + LEAPYEAR(y))
OpenPOWER on IntegriCloud