From 65cbe19b94884cd565699e57b7922998058b0182 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 3 Jul 2004 14:36:20 +0000 Subject: On 1[67]7 boards, always use the VMEChip2 timers for delay(), even if the device is not attached yet. --- sys/arch/mvme68k/dev/clock.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'sys/arch/mvme68k/dev') diff --git a/sys/arch/mvme68k/dev/clock.c b/sys/arch/mvme68k/dev/clock.c index bb181688123..5d93b1a6f47 100644 --- a/sys/arch/mvme68k/dev/clock.c +++ b/sys/arch/mvme68k/dev/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.10 2004/01/14 20:50:48 miod Exp $ */ +/* $OpenBSD: clock.c,v 1.11 2004/07/03 14:36:19 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -408,20 +408,23 @@ delay(us) * possible. However, since clock attaches before vme, * use a tight loop if necessary. */ - if (sys_vme2 != NULL) { - sys_vme2->vme2_t1cmp = 0xffffffff; - sys_vme2->vme2_t1count = 0; - sys_vme2->vme2_tctl |= VME2_TCTL_CEN; - - while (sys_vme2->vme2_t1count < us) - ; - - sys_vme2->vme2_tctl &= ~VME2_TCTL_CEN; - } else { - c = 4 * us; - while (--c > 0) - ; - } + { + struct vme2reg *vme2; + + if (sys_vme2 != NULL) + vme2 = sys_vme2; + else + vme2 = (struct vme2reg *)IIOV(0xfff40000); + + vme2->vme2_t1cmp = 0xffffffff; + vme2->vme2_t1count = 0; + vme2->vme2_tctl |= VME2_TCTL_CEN; + + while (vme2->vme2_t1count < us) + ; + + vme2->vme2_tctl &= ~VME2_TCTL_CEN; + } break; #endif } -- cgit v1.2.3