diff options
| author | Matt Jacob <mjacob@FreeBSD.org> | 2001-03-10 19:21:41 +0000 |
|---|---|---|
| committer | Matt Jacob <mjacob@FreeBSD.org> | 2001-03-10 19:21:41 +0000 |
| commit | 7accaab00167ca7c82597f019eaaa03bd0cefc38 (patch) | |
| tree | cf51adf7ba362f1c6150713c7327103822bbb792 /sys/dev/dec | |
| parent | d66f8b3cf04ac9922e1f71a52a78cadf0157514f (diff) | |
Notes
Diffstat (limited to 'sys/dev/dec')
| -rw-r--r-- | sys/dev/dec/mcclock.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/dev/dec/mcclock.c b/sys/dev/dec/mcclock.c index 4efc484e7bcf..9cb3af200ce1 100644 --- a/sys/dev/dec/mcclock.c +++ b/sys/dev/dec/mcclock.c @@ -85,9 +85,10 @@ mcclock_get(device_t dev, time_t base, struct clocktime *ct) ct->mon = regs[MC_MONTH]; ct->year = regs[MC_YEAR]; /* - * This chip is not y2k compliant, so we'll do a 10 year window fix. + * This chip is not y2k compliant- If it's less than + * 70, we're clearly past the year 2000. */ - if (ct->year >= 0 && ct->year < 10) { + if (ct->year < 70) { ct->year += 100; } } @@ -111,15 +112,11 @@ mcclock_set(device_t dev, struct clocktime *ct) regs[MC_DOW] = ct->dow; regs[MC_DOM] = ct->day; regs[MC_MONTH] = ct->mon; - regs[MC_YEAR] = ct->year; /* - * This chip is not y2k compliant, so we'll do a 10 year window fix. - * It's probably okay to write more than 100, but let's not and - * and say we didn't. + * This chip is not y2k compliant- write it with + * no more than two digits. */ - if (ct->year >= 100) { - ct->year -= 100; - } + regs[MC_YEAR] = ct->year % 100; s = splclock(); MC146818_PUTTOD(dev, ®s); splx(s); |
