Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Jan 2000 13:21:33 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Matt Jacob <mjacob@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/dec mcclock.c 
Message-ID:  <20000104052133.C85E01CA0@overcee.netplex.com.au>
In-Reply-To: Message from Matt Jacob <mjacob@FreeBSD.org>  of "Mon, 03 Jan 2000 19:22:06 PST." <200001040322.TAA74392@freefall.freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
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?20000104052133.C85E01CA0>