From owner-cvs-src@FreeBSD.ORG Mon Sep 20 18:14:17 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 06B3716A4DB for ; Mon, 20 Sep 2004 18:14:16 +0000 (GMT) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id A821643D5C for ; Mon, 20 Sep 2004 18:14:15 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 14278 invoked from network); 20 Sep 2004 18:14:15 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 20 Sep 2004 18:14:15 -0000 Received: from [10.50.40.210] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i8KIE3lW024500; Mon, 20 Sep 2004 14:14:12 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Marius Strobl Date: Mon, 20 Sep 2004 13:46:13 -0400 User-Agent: KMail/1.6.2 References: <200409192138.i8JLcBC7094537@repoman.freebsd.org> In-Reply-To: <200409192138.i8JLcBC7094537@repoman.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200409201346.13358.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/mk48txx mk48txx.c mk48txxreg.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2004 18:14:17 -0000 On Sunday 19 September 2004 05:38 pm, Marius Strobl wrote: > marius 2004-09-19 21:38:11 UTC > > FreeBSD src repository > > Modified files: > sys/dev/mk48txx mk48txx.c mk48txxreg.h > Log: > - Some of the upper bits of the time related (seconds, minutes, etc.) > registers are control bits or depending on the model contain additional > time bits with a different meaning than the lower ones. In order to > only read the desired time bits and not change the upper bits on write > use appropriate masks in the gettime and settime function respectively. > Due to the polarity of the stop oscillator bit and the fact that the > century bits aren't used on sparc64 not masking them didn't cause > problems so far. > - Fix two off-by-one errors in the handling of the day of week. The > genclock code represents the dow as 0 - 6 with 0 being Sunday but the > mk48txx use 1 - 7 with 1 being Sunday. In the settime function when > writing the dow to the clock the range wasn't adjusted accordingly but > the clock apparently played along nicely otherwise the second bug in > the gettime function which mapped 1 - 7 to 0 - 6 but with 0 meaning > Saturday would have been triggered. Fixing these makes the date being > stored in the same format Sun/Solaris uses and cures the "Invalid time > in real time clock. Check and reset the date immediately!" when the > date was set under Solaris prior to booting FreeBSD/sparc64. [1] > Looking at other clock drivers/code e.g. FreeBSD/alpha the former > "bug", i.e. storing the dow as 0 - 6 even when the clock uses 1 - 7, seems > to be common but might be on purpose for compatibility when multi-booting > with other OS which do the same. So it might make sense to add a flag to > handle the dow off-by-one for use of this driver on platforms other than > sparc64. Hmm, I get them occasionally on my Alphas which only run FreeBSD, so I think it's probably a bug that needs to be fixed in FreeBSD/alpha. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org