Get rid of some useless intermediate vars and add a register keyword
authorbriggs <briggs@openbsd.org>
Thu, 1 Feb 1996 05:11:39 +0000 (05:11 +0000)
committerbriggs <briggs@openbsd.org>
Thu, 1 Feb 1996 05:11:39 +0000 (05:11 +0000)
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.

sys/arch/mac68k/mac68k/clock.c

index 0d4b8bd..a24b355 100644 (file)
@@ -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))
                        ;