From: briggs Date: Thu, 1 Feb 1996 05:11:39 +0000 (+0000) Subject: Get rid of some useless intermediate vars and add a register keyword X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2e3b81de6161be1ede6a9fe35d56b072982e9c07;p=openbsd Get rid of some useless intermediate vars and add a register keyword in delay(). There still seems to be a problem with this routine in that when we actually touch the VIA1 T2 timer, it seems to hose the ADB subsystem. --- diff --git a/sys/arch/mac68k/mac68k/clock.c b/sys/arch/mac68k/mac68k/clock.c index 0d4b8bdc8a5..a24b3555408 100644 --- a/sys/arch/mac68k/mac68k/clock.c +++ b/sys/arch/mac68k/mac68k/clock.c @@ -420,8 +420,7 @@ resettodr(void) void delay(int usec) { - int ticks; - int t, timerh, timerl; + register int ticks, t; if (usec <= 0) usec = 1; @@ -434,11 +433,8 @@ delay(int usec) while (ticks) { t = min(ticks, 65535); - timerh = (t & 0xff00) >> 8; - timerl = (t & 0xff); - - via_reg(VIA1, vT2C) = timerl; - via_reg(VIA1, vT2CH) = timerh; + via_reg(VIA1, vT2C) = (t & 0xff); + via_reg(VIA1, vT2CH) = ((t >> 8) & 0xff); while (!(via_reg(VIA1, vIFR) & V1IF_T2)) ;