Annotation of 3BSD/sys/stand/mba.c, revision 1.1

1.1     ! root        1: #include "../h/param.h"
        !             2: #include "../h/inode.h"
        !             3: #include "../h/pte.h"
        !             4: #include "../h/mba.h"
        !             5: #include "../h/mtpr.h"
        !             6: #include "../h/vm.h"
        !             7: #include "saio.h"
        !             8: 
        !             9: /*
        !            10:  * startup routine for MBA controllers.
        !            11:  */
        !            12: #define        MBAWCOM 0x30
        !            13: #define        MBARCOM 0x38
        !            14: #define        GO      01
        !            15: 
        !            16: mbastart(io, adcr, func)
        !            17: register struct iob *io;
        !            18: int *adcr;
        !            19: {
        !            20:        register int i;
        !            21:        int npf;
        !            22:        unsigned v;
        !            23:        register struct pte *pte;
        !            24:        int o;
        !            25:        int vaddr;
        !            26:        extern int mbanum[], *mbaloc[];
        !            27:        register struct mba_regs *mbap;
        !            28: 
        !            29:        mbap = (struct mba_regs *)mbaloc[mbanum[io->i_unit]];
        !            30:        pte = (struct pte *)mbap;
        !            31:        pte += (MBA_MAP + 128*4)/4;
        !            32:        v = btop(io->i_ma);
        !            33:        o = (int)io->i_ma & PGOFSET;
        !            34:        npf = btoc(io->i_cc + o);
        !            35:        vaddr = (128 << 9) | o;
        !            36:        v &= 0x1fffff;          /* drop to physical addr */
        !            37:        while (--npf >= 0)
        !            38:                *(int *)pte++ = v++ | PG_V;
        !            39:        mbap->mba_sr = -1;      /* clear status (error) bits */
        !            40:        mbap->mba_bcr = -io->i_cc;
        !            41:        mbap->mba_var = vaddr;
        !            42:        if (func == READ)
        !            43:                *adcr = MBARCOM | GO;
        !            44:        else if (func == WRITE) {
        !            45:                *adcr = MBAWCOM | GO;
        !            46:        }
        !            47: }

unix.superglobalmegacorp.com

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