Y2000-patch for A2000, A3000 and A4000 battery backed clock modules,
mostly by Adam Ciarcinski.
This commit is contained in:
is 2000-01-02 18:29:22 +00:00
parent 07c2fe1cd9
commit 5614cd4fce
2 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: a2kbbc.c,v 1.7 1999/03/28 21:39:59 is Exp $ */
/* $NetBSD: a2kbbc.c,v 1.8 2000/01/02 18:29:22 is Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -169,11 +169,13 @@ a2kugettod(tvp)
rt->control1 &= ~A2CONTROL1_HOLD;
dt.dt_year += CLOCK_BASE_YEAR;
if (dt.dt_year < STARTOFTIME)
dt.dt_year += 100;
if ((dt.dt_hour > 23) ||
(dt.dt_day > 31) ||
(dt.dt_mon > 12) ||
(dt.dt_year < STARTOFTIME) || (dt.dt_year > 2036))
/* (dt.dt_year < STARTOFTIME) || */ (dt.dt_year > 2036))
return (0);
secs = clock_ymdhms_to_secs(&dt);

View File

@ -1,4 +1,4 @@
/* $NetBSD: a34kbbc.c,v 1.3 1999/03/14 22:42:12 is Exp $ */
/* $NetBSD: a34kbbc.c,v 1.4 2000/01/02 18:29:23 is Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -127,6 +127,8 @@ a34kugettod(tvp)
dt.dt_year = rt->year1 * 10 + rt->year2;
dt.dt_year += CLOCK_BASE_YEAR;
if (dt.dt_year < STARTOFTIME)
dt.dt_year += 100;
/* let it run again.. */
rt->control1 = A3CONTROL1_FREE_CLOCK;
@ -135,7 +137,7 @@ a34kugettod(tvp)
(dt.dt_wday > 6) ||
(dt.dt_day > 31) ||
(dt.dt_mon > 12) ||
(dt.dt_year < STARTOFTIME) || (dt.dt_year > 2036))
/* (dt.dt_year < STARTOFTIME) || */ (dt.dt_year > 2036))
return (0);
secs = clock_ymdhms_to_secs(&dt);