From owner-cvs-all Mon Jan 3 22:31:11 2000 Delivered-To: cvs-all@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id 0B70015009; Mon, 3 Jan 2000 22:31:08 -0800 (PST) (envelope-from mjacob@feral.com) Received: from beppo.feral.com (beppo [192.67.166.79]) by feral.com (8.9.3/8.9.3) with ESMTP id WAA07936; Mon, 3 Jan 2000 22:28:51 -0800 Date: Mon, 3 Jan 2000 22:31:02 -0800 (PST) From: Matthew Jacob Reply-To: mjacob@feral.com To: Peter Wemm Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/dec mcclock.c In-Reply-To: <20000104052133.C85E01CA0@overcee.netplex.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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