flush text cache and resynch todr clock on boot;
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Tue, 14 Jan 1986 09:53:12 +0000 (01:53 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Tue, 14 Jan 1986 09:53:12 +0000 (01:53 -0800)
fix and use microtime; more spl[67]'s bite the dust

SCCS-vsn: sys/vax/vax/machdep.c 6.23

usr/src/sys/vax/vax/machdep.c

index 9e88e65..dde6b14 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)machdep.c   6.22 (Berkeley) %G%
+ *     @(#)machdep.c   6.23 (Berkeley) %G%
  */
 
 #include "reg.h"
  */
 
 #include "reg.h"
@@ -734,6 +734,10 @@ boot(paniced, arghowto)
                waittime = 0;
                (void) splnet();
                printf("syncing disks... ");
                waittime = 0;
                (void) splnet();
                printf("syncing disks... ");
+               /*
+                * Release inodes held by texts before update.
+                */
+               xumount(NODEV);
                update();
                { register struct buf *bp;
                  int iter, nbusy;
                update();
                { register struct buf *bp;
                  int iter, nbusy;
@@ -750,6 +754,11 @@ boot(paniced, arghowto)
                  }
                }
                printf("done\n");
                  }
                }
                printf("done\n");
+               /*
+                * If we've been adjusting the clock, the todr
+                * will be out of synch; adjust it now.
+                */
+               resettodr();
        }
        splx(0x1f);                     /* extreme priority */
        devtype = major(rootdev);
        }
        splx(0x1f);                     /* extreme priority */
        devtype = major(rootdev);
@@ -1081,21 +1090,19 @@ machinecheck(cmcf)
        panic("mchk");
 }
 
        panic("mchk");
 }
 
-#ifdef notdef
 microtime(tvp)
 microtime(tvp)
-       struct timeval *tvp;
+       register struct timeval *tvp;
 {
 {
-       int s = spl7();
+       int s = splhigh();
 
 
-       tvp->tv_sec = time.tv_sec;
-       tvp->tv_usec = (lbolt+1)*16667 + mfpr(ICR);
+       *tvp = time;
+       tvp->tv_usec += tick + mfpr(ICR);
        while (tvp->tv_usec > 1000000) {
                tvp->tv_sec++;
                tvp->tv_usec -= 1000000;
        }
        splx(s);
 }
        while (tvp->tv_usec > 1000000) {
                tvp->tv_sec++;
                tvp->tv_usec -= 1000000;
        }
        splx(s);
 }
-#endif
 
 physstrat(bp, strat, prio)
        struct buf *bp;
 
 physstrat(bp, strat, prio)
        struct buf *bp;
@@ -1107,7 +1114,7 @@ physstrat(bp, strat, prio)
        /* pageout daemon doesn't wait for pushed pages */
        if (bp->b_flags & B_DIRTY)
                return;
        /* pageout daemon doesn't wait for pushed pages */
        if (bp->b_flags & B_DIRTY)
                return;
-       s = spl6();
+       s = splbio();
        while ((bp->b_flags & B_DONE) == 0)
                sleep((caddr_t)bp, prio);
        splx(s);
        while ((bp->b_flags & B_DONE) == 0)
                sleep((caddr_t)bp, prio);
        splx(s);