Module Name: src
Committed By: mhitch
Date: Mon May 3 18:04:56 UTC 2010
Modified Files:
src/sys/dev/dec: mcclock.c
Log Message:
Fix error introduced with timecounters - RTC clock register only uses
the last 2 digits of the year. Fixes setting the clock and keeps the
DECstation PROM happy and stops it from setting the date to Jan 1, 1972.
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/dec/mcclock.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/dec/mcclock.c
diff -u src/sys/dev/dec/mcclock.c:1.24 src/sys/dev/dec/mcclock.c:1.25
--- src/sys/dev/dec/mcclock.c:1.24 Sat Dec 12 14:44:10 2009
+++ src/sys/dev/dec/mcclock.c Mon May 3 18:04:56 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: mcclock.c,v 1.24 2009/12/12 14:44:10 tsutsui Exp $ */
+/* $NetBSD: mcclock.c,v 1.25 2010/05/03 18:04:56 mhitch Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 1.24 2009/12/12 14:44:10 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 1.25 2010/05/03 18:04:56 mhitch Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -232,7 +232,7 @@
regs[MC_DOW] = dt.dt_wday;
regs[MC_DOM] = dt.dt_day;
regs[MC_MONTH] = dt.dt_mon;
- regs[MC_YEAR] = dt.dt_year;
+ regs[MC_YEAR] = dt.dt_year - 1900; /* rt clock wants 2 digits */
s = splclock();
MC146818_PUTTOD(sc, ®s);