Annotation of xinu/sys/dlcwrite.c, revision 1.1

1.1     ! root        1: /* dlcwrite.c - dlcwrite */
        !             2: 
        !             3: #include <conf.h>
        !             4: #include <kernel.h>
        !             5: #include <slu11.h>
        !             6: #include <proc.h>
        !             7: #include <sleep.h>
        !             8: #include <dlc.h>
        !             9: 
        !            10: /*------------------------------------------------------------------------
        !            11:  *  dlcwrite  --  write a block (frame) with byte-stuffing and EOB
        !            12:  *------------------------------------------------------------------------
        !            13:  */
        !            14: dlcwrite(devptr, buff, count)
        !            15: struct devsw   *devptr;
        !            16: char   *buff;
        !            17: int    count;
        !            18: {
        !            19:        char    ps;
        !            20:        struct  dlblk   *dptr;
        !            21:        struct  csr     *cptr;
        !            22: 
        !            23:        if (count < 0)
        !            24:                return(SYSERR);
        !            25:        else if (count == 0)
        !            26:                return(OK);
        !            27:        disable(ps);
        !            28:        dptr = devptr->dvioblk;
        !            29:        if (dptr->dostate != DLOINIT) {
        !            30:                restore(ps);
        !            31:                return(SYSERR);
        !            32:        }
        !            33:        dptr->dostate = DLOREADY;
        !            34:        dptr->dostart = dptr->donext = buff;
        !            35:        dptr->dotot = dptr->docount = count;
        !            36:        dptr->doesc = FALSE;
        !            37:        (dptr->dioaddr)->ctstat = SLUENABLE;
        !            38:        dptr->doproc = currpid;
        !            39:        suspend(currpid);
        !            40:        dptr->dostate = DLOINIT;
        !            41:        restore(ps);
        !            42:        return(OK);
        !            43: }

unix.superglobalmegacorp.com

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