Date: Mon, 3 Jan 2000 22:31:02 -0800 (PST) From: Matthew Jacob <mjacob@feral.com> To: Peter Wemm <peter@netplex.com.au> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/dec mcclock.c Message-ID: <Pine.BSF.4.10.10001032228380.3517-100000@beppo.feral.com> In-Reply-To: <20000104052133.C85E01CA0@overcee.netplex.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
The reason I didn't do it this way is that there are cases where OSF/1 and
ARC usages of the TOY chip leave it with a date readable with what you
have below, but completely wrong. I always can tell when I've been running
NT because the date is 2021. That's why I specifically selected a 10 year
window.
If you think there's something else going on, let me know.
-matt
On Tue, 4 Jan 2000, Peter Wemm wrote:
> Matt Jacob wrote:
> > mjacob 2000/01/03 19:22:06 PST
> >
> > Modified files:
> > sys/dev/dec mcclock.c
> > Log:
> > Ho, ho, ho... this clock chip is not y2k compliant. Motorola
> > has it blacklisted. Silly us for not planning ahead. Tsk. Anyway-
> > a 10 year window patch is probably sufficient to still detect
> > nonsense in the clock but allow us to roll past the year 2000.
>
> Umm, this is the same chip that the PC rtc is based on:
> #define MC_YEAR 0x9 /* Time of year: year in century (0-99) */
>
> On the PC side of things we use an 70 year window. < 70 = 2000-2069
> and >= 70 = 1970-1999.
> #ifdef USE_RTC_CENTURY
> year = readrtc(RTC_YEAR) + readrtc(RTC_CENTURY) * 100;
> #else
> year = readrtc(RTC_YEAR) + 1900;
> if (year < 1970)
> year += 100;
> #endif
> if (year < 1970) {
> splx(s);
> goto wrong_time;
> }
>
> The alpha equivalent of this code is in alpha/alpha/clock.c (inittodr), which
> doesn't look quite right...
>
> Cheers,
> -Peter
>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10001032228380.3517-100000>
