From 6736511571e5bfea34f364806712294bde7081f3 Mon Sep 17 00:00:00 2001 From: kstailey Date: Fri, 17 Jan 1997 05:53:37 +0000 Subject: [PATCH] don't update battery backed up clock if system time is wrong from begin in ddb. --- sys/arch/alpha/alpha/machdep.c | 11 ++++++++--- sys/arch/amiga/amiga/machdep.c | 11 ++++++++--- sys/arch/sparc/sparc/machdep.c | 9 +++++++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index df76a3845fc..4a31d9652e7 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.13 1996/12/08 00:20:18 niklas Exp $ */ +/* $OpenBSD: machdep.c,v 1.14 1997/01/17 05:53:37 kstailey Exp $ */ /* $NetBSD: machdep.c,v 1.52 1996/11/06 20:19:19 cgd Exp $ */ /* @@ -852,9 +852,14 @@ boot(howto /* , bootstr */) vfs_shutdown(); /* * If we've been adjusting the clock, the todr - * will be out of synch; adjust it now. + * will be out of synch; adjust it now unless + * the system was sitting in ddb. */ - resettodr(); + if ((howto & RB_TIMEBAD) == 0) { + resettodr(); + } else { + printf("WARNING: not updating battery clock\n"); + } } /* Disable interrupts. */ diff --git a/sys/arch/amiga/amiga/machdep.c b/sys/arch/amiga/amiga/machdep.c index f998c2b3386..95619f69328 100644 --- a/sys/arch/amiga/amiga/machdep.c +++ b/sys/arch/amiga/amiga/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.16 1997/01/16 09:23:24 niklas Exp $ */ +/* $OpenBSD: machdep.c,v 1.17 1997/01/17 05:53:39 kstailey Exp $ */ /* $NetBSD: machdep.c,v 1.82 1996/12/17 07:32:54 is Exp $ */ /* @@ -1037,9 +1037,14 @@ bootsync(void) /* * If we've been adjusting the clock, the todr - * will be out of synch; adjust it now. + * will be out of synch; adjust it now unless + * the system was sitting in ddb. */ - resettodr(); + if ((howto & RB_TIMEBAD) == 0) { + resettodr(); + } else { + printf("WARNING: not updating battery clock\n"); + } } } diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 1cb608323a6..6b84e987d6b 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -653,9 +653,14 @@ boot(howto) /* * If we've been adjusting the clock, the todr - * will be out of synch; adjust it now. + * will be out of synch; adjust it now unless + * the system was sitting in ddb. */ - resettodr(); + if ((howto & RB_TIMEBAD) == 0) { + resettodr(); + } else { + printf("WARNING: not updating battery clock\n"); + } } (void) splhigh(); /* ??? */ if (howto & RB_HALT) { -- 2.20.1