From owner-freebsd-alpha Fri Mar 9 0:43:32 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id 310DE37B71A for ; Fri, 9 Mar 2001 00:43:29 -0800 (PST) (envelope-from mjacob@feral.com) Received: from beppo (beppo [192.67.166.79]) by feral.com (8.9.3/8.9.3) with ESMTP id AAA21120; Fri, 9 Mar 2001 00:43:21 -0800 Date: Fri, 9 Mar 2001 00:43:19 -0800 (PST) From: Matthew Jacob Reply-To: mjacob@feral.com To: Yoriaki FUJIMORI Cc: freebsd-alpha@freebsd.org, Jordan Hubbard Subject: realtime clock problem solved In-Reply-To: <200103051823.f25INdT38459@baron.fujimori.cache.waseda.ac.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Mon, 5 Mar 2001, Yoriaki FUJIMORI wrote: > > As for a realtime clock problem, it should persist on many alphapc164, > pc164lx and up1100. At least in my lab, they all suffer from this. > It was a fun to see `Feb 29, 2000' on all of them. (;_;) > > I guess FreeBSD/Alpha alone makes use of mcclock.c. I could not find > its counterpart in FreeBSD/i386. > > Yoriaki Fujimori > I think I have a fix for this- it fixed my problem. The problem here is that the clock register was being written with a > 2 digit value. The below patch could be simpler in that just the update of the regs value should come after the rolloff to 2 digits. Could you try this for your machines? Jordan? If this pans out is this still possible to get into 4.3? Index: sys/dev/dec/mcclock.c =================================================================== RCS file: /home/ncvs/src/sys/dev/dec/mcclock.c,v retrieving revision 1.5 diff -u -r1.5 mcclock.c --- sys/dev/dec/mcclock.c 2000/01/04 03:22:04 1.5 +++ sys/dev/dec/mcclock.c 2001/03/09 08:39:19 @@ -84,10 +84,7 @@ ct->day = regs[MC_DOM]; 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. - */ - if (ct->year >= 0 && ct->year < 10) { + if (ct->year < 70) { ct->year += 100; } } @@ -111,15 +108,7 @@ 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. - */ - if (ct->year >= 100) { - ct->year -= 100; - } + regs[MC_YEAR] = ct->year % 100; s = splclock(); MC146818_PUTTOD(dev, ®s); splx(s); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message