Annotation of researchv10no/sys/io/fineclock.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * read a fine-resolution clock,
        !             3:  * derived from the VAX interval timer
        !             4:  */
        !             5: #include "sys/param.h"
        !             6: #include "sys/mtpr.h"
        !             7: #include "sys/clock.h"
        !             8: #include "sys/systm.h" /* for time and lbolt */
        !             9: #include "sys/buf.h"   /* just for B_READ */
        !            10: #include "sys/conf.h"
        !            11: #include "sys/user.h"
        !            12: 
        !            13: static int clkread();
        !            14: struct cdevsw clkcdev = cdinit(nulldev, nulldev, clkread, nodev, nodev);
        !            15: 
        !            16: #define        FINERES (-CLK60HZ)
        !            17: 
        !            18: static
        !            19: clkread(dev)
        !            20: int dev;
        !            21: {
        !            22:        register int s;
        !            23:        long finetime;
        !            24: 
        !            25:        s = spl7();
        !            26:        finetime = FINERES + mfpr(ICR); /* ICR is negative remaining count */
        !            27:        if (mfpr(ICCS) & ICCS_INT)
        !            28:                finetime += FINERES;    /* one tick already past */
        !            29:        finetime += (lbolt * FINERES) + (time * FINERES * HZ);
        !            30:        splx(s);
        !            31:        iomove((caddr_t)&finetime, MIN(u.u_count, sizeof(finetime)), B_READ);
        !            32: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.