From 8fe7b2bbb712def8d0f4a83c6fc43c9736d0f8bd Mon Sep 17 00:00:00 2001 From: scottr Date: Mon, 19 Feb 1996 05:20:54 +0000 Subject: [PATCH] Be a bit more careful when setting up the timer for calibrating delay(). --- sys/arch/mac68k/mac68k/clock.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/arch/mac68k/mac68k/clock.c b/sys/arch/mac68k/mac68k/clock.c index 265319043343..41d1055e616b 100644 --- a/sys/arch/mac68k/mac68k/clock.c +++ b/sys/arch/mac68k/mac68k/clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.20 1996/02/17 19:23:03 briggs Exp $ */ +/* $NetBSD: clock.c,v 1.21 1996/02/19 05:20:54 scottr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -472,7 +472,12 @@ mac68k_calibrate_delay() int n; int sum; + /* Disable VIA1 timer 1 interrupts and set up service routine */ + via_reg(VIA1, vIER) = V1IF_T1; mac68k_register_via1_t1_irq(delay_timer1_irq); + + /* Set the timer for one-shot mode and enable interrupts */ + via_reg(VIA1, vACR) &= ~ACR_T1LATCH; via_reg(VIA1, vIER) = 0x80 | V1IF_T1; for (sum = 0, n = 8; n > 0; n--) { @@ -482,9 +487,8 @@ mac68k_calibrate_delay() sum += dummy_delay(1); } + /* Disable timer interrupts and reset service routine */ via_reg(VIA1, vIER) = V1IF_T1; - via_reg(VIA1, vT1C) = 0; - via_reg(VIA1, vT1CH) = 0; mac68k_register_via1_t1_irq(NULL); /*