diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-07-03 14:36:20 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-07-03 14:36:20 +0000 |
commit | 65cbe19b94884cd565699e57b7922998058b0182 (patch) | |
tree | cb0fb547c5ae43e5ebad7f1418b6cb41716f6559 /sys/arch/mvme68k/dev | |
parent | 1900f41e1792e3c488cda6ecaa504f8ff620b67d (diff) |
On 1[67]7 boards, always use the VMEChip2 timers for delay(), even if the
device is not attached yet.
Diffstat (limited to 'sys/arch/mvme68k/dev')
-rw-r--r-- | sys/arch/mvme68k/dev/clock.c | 33 |
1 files changed, 18 insertions, 15 deletions
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 } |