Annotation of 43BSD/sys/stand/uba.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1982, 1986 Regents of the University of California.
                      3:  * All rights reserved.  The Berkeley software License Agreement
                      4:  * specifies the terms and conditions for redistribution.
                      5:  *
                      6:  *     @(#)uba.c       7.1 (Berkeley) 6/5/86
                      7:  */
                      8: 
                      9: #include "../machine/pte.h"
                     10: 
                     11: #include "../h/param.h"
                     12: #include "../h/inode.h"
                     13: #include "../h/vm.h"
                     14: #include "../h/fs.h"
                     15: 
                     16: #include "../vax/cpu.h"
                     17: #include "../vaxuba/ubareg.h"
                     18: 
                     19: #include "saio.h"
                     20: #include "savax.h"
                     21: 
                     22: /*
                     23:  * Note... this routine does not
                     24:  * really allocate; unless bdp == 2
                     25:  * you always get the same space.
                     26:  * When bdp == 2 you get some other space.
                     27:  */
                     28: ubasetup(io, bdp)
                     29:        register struct iob *io;
                     30:        int bdp;
                     31: {
                     32:        int npf;
                     33:        unsigned v;
                     34:        register struct pte *pte;
                     35:        int o, temp, reg;
                     36:        static int lastreg = 128+64;
                     37: 
                     38:        v = btop(io->i_ma);
                     39:        o = (int)io->i_ma & PGOFSET;
                     40:        npf = btoc(io->i_cc + o) +1;
                     41:        if (bdp == 2) {
                     42:                reg = lastreg;
                     43:                lastreg += npf;
                     44:                bdp = 0;
                     45:        } else
                     46:                reg = 0;
                     47:        pte = &ubauba(io->i_unit)->uba_map[reg];
                     48:        temp = (bdp << 21) | UBAMR_MRV;
                     49:        if (bdp && (o & 01))
                     50:                temp |= UBAMR_BO;
                     51:        v &= 0x1fffff;                  /* drop to physical addr */
                     52:        while (--npf != 0)
                     53:                *(int *)pte++ = v++ | temp;
                     54:        *(int *)pte++ = 0;
                     55:        return ((bdp << 28) | (reg << 9) | o);
                     56: }
                     57: 
                     58: ubafree(io, mr)
                     59:        struct iob *io;
                     60:        int mr;
                     61: {
                     62:        register int bdp;
                     63:  
                     64:        bdp = (mr >> 28) & 0x0f;
                     65:        if (bdp == 0)
                     66:                return;
                     67:        switch (cpu) {
                     68: 
                     69:        case VAX_8600:
                     70:        case VAX_780:
                     71:                ubauba(io->i_unit)->uba_dpr[bdp] |= UBADPR_BNE;
                     72:                break;
                     73: 
                     74:        case VAX_750:
                     75:                ubauba(io->i_unit)->uba_dpr[bdp] |=
                     76:                     UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE;
                     77:                break;
                     78:        case VAX_730:
                     79:                break;
                     80:        }
                     81: }

unix.superglobalmegacorp.com

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