From 9c7f82f7b8558e869035c03d7ead004e335c9e00 Mon Sep 17 00:00:00 2001 From: scottr Date: Tue, 7 Oct 1997 03:04:55 +0000 Subject: [PATCH] The annoying message about trusting ourselves to write the PRAM should really be dependent on DEBUG, not DIAGNOSTIC. While we're here, add a couple of DEBUG messages to mac68k_calibrate_delay(), and wrap them all appropriately so that the messages aren't enabled unless we specifically ask for them (by setting clock_debug). --- sys/arch/mac68k/mac68k/clock.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/sys/arch/mac68k/mac68k/clock.c b/sys/arch/mac68k/mac68k/clock.c index bee806e63847..95de17d1b46d 100644 --- a/sys/arch/mac68k/mac68k/clock.c +++ b/sys/arch/mac68k/mac68k/clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.35 1997/09/03 06:14:42 scottr Exp $ */ +/* $NetBSD: clock.c,v 1.36 1997/10/07 03:04:55 scottr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -95,6 +95,10 @@ #include #include +#ifdef DEBUG +int clock_debug = 0; +#endif + void rtclock_intr __P((void)); #define DIFF19041970 2082844800 @@ -401,10 +405,10 @@ resettodr() * (gmtbias is in minutes, multiply by 60). */ pram_settime(ugmt_2_pramt(time.tv_sec + macos_gmtbias * 60)); -#if DIAGNOSTIC - else +#ifdef DEBUG + else if (clock_debug) printf("NetBSD/mac68k does not trust itself to try and write " - "to the pram on this system.\n"); + "to the PRAM on this system.\n"); #endif } /* @@ -490,6 +494,11 @@ mac68k_calibrate_delay() via_reg(VIA1, vIFR) = V1IF_T1; /* (this is needed for IIsi) */ via_reg(VIA1, vIER) = 0x80 | V1IF_T1; +#ifdef DEBUG + if (clock_debug) + printf("mac68k_calibrate_delay(): entering timing loop\n"); +#endif + for (sum = 0, n = 8; n > 0; n--) { delay_flag = 1; via_reg(VIA1, vT1C) = 0; /* 1024 clock ticks */ @@ -521,4 +530,9 @@ mac68k_calibrate_delay() /* Reset the delay_flag for normal use */ delay_flag = 1; + +#ifdef DEBUG + if (clock_debug) + printf("mac68k_calibrate_delay(): delay_factor calibrated\n"); +#endif }