sun merge
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Sat, 18 Dec 1982 04:17:49 +0000 (20:17 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Sat, 18 Dec 1982 04:17:49 +0000 (20:17 -0800)
SCCS-vsn: sys/kern/init_main.c 4.44
SCCS-vsn: sys/kern/kern_clock.c 4.48
SCCS-vsn: sys/kern/kern_descrip.c 5.20
SCCS-vsn: sys/kern/kern_proc.c 4.53
SCCS-vsn: sys/kern/kern_prot.c 5.13
SCCS-vsn: sys/kern/kern_resource.c 4.18
SCCS-vsn: sys/kern/kern_sig.c 5.13
SCCS-vsn: sys/kern/kern_synch.c 4.25
SCCS-vsn: sys/kern/kern_time.c 5.12
SCCS-vsn: sys/kern/subr_prof.c 4.3
SCCS-vsn: sys/kern/subr_prf.c 4.25
SCCS-vsn: sys/kern/subr_xxx.c 4.21
SCCS-vsn: sys/kern/sys_process.c 5.8
SCCS-vsn: sys/kern/tty.c 4.37
SCCS-vsn: sys/kern/tty_subr.c 4.18
SCCS-vsn: sys/ufs/ffs/ffs_alloc.c 2.20
SCCS-vsn: sys/ufs/lfs/lfs_alloc.c 2.20
SCCS-vsn: sys/kern/vfs_bio.c 4.40
SCCS-vsn: sys/kern/vfs_cluster.c 4.40
SCCS-vsn: sys/kern/vfs_vnops.c 4.31
SCCS-vsn: sys/ufs/ffs/ffs_subr.c 4.4
SCCS-vsn: sys/kern/uipc_mbuf.c 1.42
SCCS-vsn: sys/kern/kern_physio.c 4.37
SCCS-vsn: sys/vax/vax/Locore.c 4.23
SCCS-vsn: sys/vax/vax/autoconf.c 4.45
SCCS-vsn: sys/vax/vax/cpudata.c 4.8
SCCS-vsn: sys/vax/vax/genassym.c 4.2
SCCS-vsn: sys/vax/vax/locore.s 4.75
SCCS-vsn: sys/vax/vax/machdep.c 4.72
SCCS-vsn: sys/vax/vax/mem.c 4.12
SCCS-vsn: sys/vax/vax/swapgeneric.c 4.5
SCCS-vsn: sys/vax/vax/trap.c 4.26
SCCS-vsn: sys/vax/vax/vm_machdep.c 5.3
SCCS-vsn: sys/vax/uba/ad.c 4.7
SCCS-vsn: sys/vax/uba/ct.c 4.12
SCCS-vsn: sys/vax/uba/dh.c 4.56
SCCS-vsn: sys/vax/uba/dmf.c 4.16
SCCS-vsn: sys/vax/uba/dn.c 4.15
SCCS-vsn: sys/vax/uba/dz.c 4.48
SCCS-vsn: sys/vax/uba/idc.c 4.11
SCCS-vsn: sys/vax/uba/lp.c 4.31
SCCS-vsn: sys/vax/uba/ps.c 4.9
SCCS-vsn: sys/vax/uba/rk.c 4.51
SCCS-vsn: sys/vax/uba/tm.c 4.60
SCCS-vsn: sys/vax/uba/ts.c 4.37
SCCS-vsn: sys/vax/uba/uba.c 4.59
SCCS-vsn: sys/vax/uba/uda.c 4.16
SCCS-vsn: sys/vax/uba/up.c 4.64
SCCS-vsn: sys/vax/uba/ut.c 4.25
SCCS-vsn: sys/vax/uba/va.c 4.19
SCCS-vsn: sys/vax/uba/vp.c 4.22
SCCS-vsn: sys/vax/mba/hp.c 4.59
SCCS-vsn: sys/vax/mba/ht.c 4.35
SCCS-vsn: sys/vax/mba/mba.c 4.30
SCCS-vsn: sys/vax/mba/mt.c 4.15
SCCS-vsn: sys/sys/buf.h 4.19
SCCS-vsn: sys/ufs/ffs/dinode.h 4.21
SCCS-vsn: sys/ufs/ffs/inode.h 4.21
SCCS-vsn: sys/ufs/ufs/dinode.h 4.21
SCCS-vsn: sys/ufs/ufs/inode.h 4.21
SCCS-vsn: sys/sys/ioctl.h 4.26
SCCS-vsn: sys/sys/param.h 4.26
SCCS-vsn: sys/sys/user.h 4.24
SCCS-vsn: sys/vax/conf/Makefile.vax 4.4
SCCS-vsn: sys/vax/if/if_acc.c 4.32
SCCS-vsn: sys/vax/if/if_css.c 4.6
SCCS-vsn: sys/vax/if/if_dmc.c 4.22
SCCS-vsn: sys/vax/if/if_ec.c 4.32
SCCS-vsn: sys/vax/if/if_en.c 4.75
SCCS-vsn: sys/vax/if/if_il.c 4.17
SCCS-vsn: sys/vax/if/if_uba.c 4.16
SCCS-vsn: sys/vax/if/if_vv.c 4.11
SCCS-vsn: sys/deprecated/netimp/if_imp.c 4.46
SCCS-vsn: sys/netinet/in.h 4.19

74 files changed:
usr/src/sys/deprecated/netimp/if_imp.c
usr/src/sys/kern/init_main.c
usr/src/sys/kern/kern_clock.c
usr/src/sys/kern/kern_descrip.c
usr/src/sys/kern/kern_physio.c
usr/src/sys/kern/kern_proc.c
usr/src/sys/kern/kern_prot.c
usr/src/sys/kern/kern_resource.c
usr/src/sys/kern/kern_sig.c
usr/src/sys/kern/kern_synch.c
usr/src/sys/kern/kern_time.c
usr/src/sys/kern/subr_prf.c
usr/src/sys/kern/subr_prof.c
usr/src/sys/kern/subr_xxx.c
usr/src/sys/kern/sys_process.c
usr/src/sys/kern/tty.c
usr/src/sys/kern/tty_subr.c
usr/src/sys/kern/uipc_mbuf.c
usr/src/sys/kern/vfs_bio.c
usr/src/sys/kern/vfs_cluster.c
usr/src/sys/kern/vfs_vnops.c
usr/src/sys/netinet/in.h
usr/src/sys/sys/buf.h
usr/src/sys/sys/ioctl.h
usr/src/sys/sys/param.h
usr/src/sys/sys/user.h
usr/src/sys/ufs/ffs/dinode.h
usr/src/sys/ufs/ffs/ffs_alloc.c
usr/src/sys/ufs/ffs/ffs_subr.c
usr/src/sys/ufs/ffs/inode.h
usr/src/sys/ufs/lfs/lfs_alloc.c
usr/src/sys/ufs/ufs/dinode.h
usr/src/sys/ufs/ufs/inode.h
usr/src/sys/vax/conf/Makefile.vax
usr/src/sys/vax/if/if_acc.c
usr/src/sys/vax/if/if_css.c
usr/src/sys/vax/if/if_dmc.c
usr/src/sys/vax/if/if_ec.c
usr/src/sys/vax/if/if_en.c
usr/src/sys/vax/if/if_il.c
usr/src/sys/vax/if/if_uba.c
usr/src/sys/vax/if/if_vv.c
usr/src/sys/vax/mba/hp.c
usr/src/sys/vax/mba/ht.c
usr/src/sys/vax/mba/mba.c
usr/src/sys/vax/mba/mt.c
usr/src/sys/vax/uba/ad.c
usr/src/sys/vax/uba/ct.c
usr/src/sys/vax/uba/dh.c
usr/src/sys/vax/uba/dmf.c
usr/src/sys/vax/uba/dn.c
usr/src/sys/vax/uba/dz.c
usr/src/sys/vax/uba/idc.c
usr/src/sys/vax/uba/lp.c
usr/src/sys/vax/uba/ps.c
usr/src/sys/vax/uba/rk.c
usr/src/sys/vax/uba/tm.c
usr/src/sys/vax/uba/ts.c
usr/src/sys/vax/uba/uba.c
usr/src/sys/vax/uba/uda.c
usr/src/sys/vax/uba/up.c
usr/src/sys/vax/uba/ut.c
usr/src/sys/vax/uba/va.c
usr/src/sys/vax/uba/vp.c
usr/src/sys/vax/vax/Locore.c
usr/src/sys/vax/vax/autoconf.c
usr/src/sys/vax/vax/cpudata.c
usr/src/sys/vax/vax/genassym.c
usr/src/sys/vax/vax/locore.s
usr/src/sys/vax/vax/machdep.c
usr/src/sys/vax/vax/mem.c
usr/src/sys/vax/vax/swapgeneric.c
usr/src/sys/vax/vax/trap.c
usr/src/sys/vax/vax/vm_machdep.c

index 0767502..7e39b50 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_imp.c        4.45    82/12/14        */
+/*     if_imp.c        4.46    82/12/17        */
 
 #include "imp.h"
 #if NIMP > 0
 
 #include "imp.h"
 #if NIMP > 0
@@ -8,10 +8,11 @@
  * The IMP-host protocol is handled here, leaving
  * hardware specifics to the lower level interface driver.
  */
  * The IMP-host protocol is handled here, leaving
  * hardware specifics to the lower level interface driver.
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
index 5dc0edb..1116446 100644 (file)
@@ -1,4 +1,6 @@
-/*     init_main.c     4.43    82/11/13        */
+/*     init_main.c     4.44    82/12/17        */
+
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -13,7 +15,6 @@
 #include "../h/seg.h"
 #include "../h/conf.h"
 #include "../h/buf.h"
 #include "../h/seg.h"
 #include "../h/conf.h"
 #include "../h/buf.h"
-#include "../h/pte.h"
 #include "../h/vm.h"
 #include "../h/cmap.h"
 #include "../h/text.h"
 #include "../h/vm.h"
 #include "../h/cmap.h"
 #include "../h/text.h"
 #endif
 #include "../h/quota.h"
 
 #endif
 #include "../h/quota.h"
 
+#ifdef sun
+#include "../sun/reg.h"
+#include "../sun/cpu.h"
+#endif
+
 extern struct user u;          /* have to declare it somewhere! */
 /*
  * Initialization code.
 extern struct user u;          /* have to declare it somewhere! */
 /*
  * Initialization code.
@@ -77,7 +83,7 @@ main(regs)
        setredzone(p->p_addr, (caddr_t)&u);
        u.u_procp = p;
 #ifdef sun
        setredzone(p->p_addr, (caddr_t)&u);
        u.u_procp = p;
 #ifdef sun
-       u.u_ar0 = &regs.r0;
+       u.u_ar0 = &regs.r_r0;
 #endif
        u.u_cmask = CMASK;
        for (i = 1; i < NGROUPS; i++)
 #endif
        u.u_cmask = CMASK;
        for (i = 1; i < NGROUPS; i++)
@@ -167,6 +173,7 @@ main(regs)
 #ifdef NOPAGING
                for (;;)
                        sleep((caddr_t)&u, PSLEP);
 #ifdef NOPAGING
                for (;;)
                        sleep((caddr_t)&u, PSLEP);
+               /*NOTREACHED*/
 #else
                pageout();
                /*NOTREACHED*/
 #else
                pageout();
                /*NOTREACHED*/
@@ -204,6 +211,7 @@ main(regs)
         *                      pid == 3
         */
        if (newproc(0)) {
         *                      pid == 3
         */
        if (newproc(0)) {
+#ifdef vax
                expand(clrnd((int)btoc(szmcode)), 0);
                (void) swpexpand(u.u_dsize, 0, &u.u_dmap, &u.u_smap);
                (void) copyout((caddr_t)mcode, (caddr_t)0, (unsigned)szmcode);
                expand(clrnd((int)btoc(szmcode)), 0);
                (void) swpexpand(u.u_dsize, 0, &u.u_dmap, &u.u_smap);
                (void) copyout((caddr_t)mcode, (caddr_t)0, (unsigned)szmcode);
@@ -212,6 +220,7 @@ main(regs)
                 * code just copied out.
                 */
                return;
                 * code just copied out.
                 */
                return;
+#endif
        }
 #endif
        proc[0].p_szpt = 1;
        }
 #endif
        proc[0].p_szpt = 1;
@@ -244,17 +253,19 @@ binit()
                dp->b_forw = dp->b_back = dp->av_forw = dp->av_back = dp;
                dp->b_flags = B_HEAD;
        }
                dp->b_forw = dp->b_back = dp->av_forw = dp->av_back = dp;
                dp->b_flags = B_HEAD;
        }
-       dp = &bfreelist[BQ_AGE];
        for (i = 0; i < nbuf; i++) {
                bp = &buf[i];
                bp->b_dev = NODEV;
                bp->b_bcount = 0;
        for (i = 0; i < nbuf; i++) {
                bp = &buf[i];
                bp->b_dev = NODEV;
                bp->b_bcount = 0;
+#ifndef sun
                bp->b_un.b_addr = buffers + i * MAXBSIZE;
                bp->b_bufsize = 2 * CLBYTES;
                bp->b_un.b_addr = buffers + i * MAXBSIZE;
                bp->b_bufsize = 2 * CLBYTES;
-               bp->b_back = dp;
-               bp->b_forw = dp->b_forw;
-               dp->b_forw->b_back = bp;
-               dp->b_forw = bp;
+               binshash(bp, &bfreelist[BQ_AGE]);
+#else
+               bp->b_un.b_addr = (char *)0;
+               bp->b_bufsize = 0;
+               binshash(bp, &bfreelist[BQ_EMPTY]);
+#endif
                bp->b_flags = B_BUSY|B_INVAL;
                brelse(bp);
        }
                bp->b_flags = B_BUSY|B_INVAL;
                brelse(bp);
        }
index 6b3ca91..6769872 100644 (file)
@@ -1,4 +1,7 @@
-/*     kern_clock.c    4.47    82/12/16        */
+/*     kern_clock.c    4.48    82/12/17        */
+
+#include "../machine/reg.h"
+#include "../machine/psl.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/user.h"
 #include "../h/kernel.h"
 #include "../h/proc.h"
 #include "../h/user.h"
 #include "../h/kernel.h"
 #include "../h/proc.h"
-#include "../h/psl.h"
 #include "../h/vm.h"
 #include "../h/text.h"
 #include "../h/vm.h"
 #include "../h/text.h"
-#ifdef vax
-#include "../vax/mtpr.h"
-#endif
 #ifdef MUSH
 #include "../h/quota.h"
 #include "../h/share.h"
 #endif
 
 #ifdef MUSH
 #include "../h/quota.h"
 #include "../h/share.h"
 #endif
 
+#ifdef vax
+#include "../vax/mtpr.h"
+#endif
+
+#
 /*
  * Clock handling routines.
  *
 /*
  * Clock handling routines.
  *
@@ -72,6 +76,10 @@ hardclock(regs)
        register struct proc *p;
        register int s, cpstate;
 
        register struct proc *p;
        register int s, cpstate;
 
+#ifdef sun
+       if (USERMODE(ps))               /* aston needs ar0 */
+               u.u_ar0 = &regs.r_r0;
+#endif
        /*
         * Update real-time timeout queue.
         * At front of queue are some number of events which are ``due''.
        /*
         * Update real-time timeout queue.
         * At front of queue are some number of events which are ``due''.
@@ -227,12 +235,10 @@ softclock(pc, ps)
 {
 #endif
 #ifdef sun
 {
 #endif
 #ifdef sun
-softclock(sirret, regs)
-       caddr_t sirreg;
-       struct regs regs;
+softclock()
 {
 {
-       int ps = regs.r_sr;
-       caddr_t pc = (caddr_t)regs.r_pc;
+       int ps = u.u_ar0[PS];
+       caddr_t pc = (caddr_t)u.u_ar0[PC];
 #endif
 
        for (;;) {
 #endif
 
        for (;;) {
index 4a39ae8..469198c 100644 (file)
@@ -1,4 +1,4 @@
-/*     kern_descrip.c  5.19    82/12/09        */
+/*     kern_descrip.c  5.20    82/12/17        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -102,10 +102,8 @@ dup2()
        if (uap->i == uap->j)
                return;
        if (u.u_ofile[uap->j]) {
        if (uap->i == uap->j)
                return;
        if (u.u_ofile[uap->j]) {
-#ifdef SUNMMAP
                if (u.u_pofile[uap->j] & UF_MAPPED)
                        munmapfd(uap->j);
                if (u.u_pofile[uap->j] & UF_MAPPED)
                        munmapfd(uap->j);
-#endif
                closef(u.u_ofile[uap->j], 0, u.u_pofile[uap->j]);
                if (u.u_error)
                        return;
                closef(u.u_ofile[uap->j], 0, u.u_pofile[uap->j]);
                if (u.u_error)
                        return;
index 728f012..7375a2a 100644 (file)
@@ -1,4 +1,6 @@
-/*     kern_physio.c   4.36    82/11/02        */
+/*     kern_physio.c   4.37    82/12/17        */
+
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -8,7 +10,6 @@
 #include "../h/conf.h"
 #include "../h/proc.h"
 #include "../h/seg.h"
 #include "../h/conf.h"
 #include "../h/proc.h"
 #include "../h/seg.h"
-#include "../h/pte.h"
 #include "../h/vm.h"
 #include "../h/trace.h"
 #include "../h/uio.h"
 #include "../h/vm.h"
 #include "../h/trace.h"
 #include "../h/uio.h"
@@ -211,12 +212,14 @@ nextiov:
                iov->iov_len -= c;
                uio->uio_resid -= c;
                uio->uio_offset += c;
                iov->iov_len -= c;
                uio->uio_resid -= c;
                uio->uio_offset += c;
-               if (bp->b_flags&B_ERROR)
+               /* temp kludge for tape drives */
+               if (bp->b_resid || bp->b_flags&B_ERROR)
                        break;
        }
        bp->b_flags &= ~(B_BUSY|B_WANTED|B_PHYS);
        error = geterror(bp);
                        break;
        }
        bp->b_flags &= ~(B_BUSY|B_WANTED|B_PHYS);
        error = geterror(bp);
-       if (error)
+       /* temp kludge for tape drives */
+       if (bp->b_resid || error)
                return (error);
        uio->uio_iov++;
        uio->uio_iovcnt--;
                return (error);
        uio->uio_iov++;
        uio->uio_iovcnt--;
index 27d5814..65efbf7 100644 (file)
@@ -1,4 +1,8 @@
-/*     kern_proc.c     4.52    82/12/16        */
+/*     kern_proc.c     4.53    82/12/17        */
+
+#include "../machine/reg.h"
+#include "../machine/pte.h"
+#include "../machine/psl.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/kernel.h"
 #include "../h/proc.h"
 #include "../h/buf.h"
 #include "../h/kernel.h"
 #include "../h/proc.h"
 #include "../h/buf.h"
-#include "../h/reg.h"
 #include "../h/inode.h"
 #include "../h/seg.h"
 #include "../h/acct.h"
 #include <wait.h>
 #include "../h/inode.h"
 #include "../h/seg.h"
 #include "../h/acct.h"
 #include <wait.h>
-#include "../h/pte.h"
 #include "../h/vm.h"
 #include "../h/text.h"
 #include "../h/vm.h"
 #include "../h/text.h"
-#include "../h/psl.h"
 #include "../h/file.h"
 #include "../h/quota.h"
 #include "../h/descrip.h"
 #include "../h/file.h"
 #include "../h/quota.h"
 #include "../h/descrip.h"
@@ -141,6 +142,7 @@ execve()
         * ONLY ONE ARGUMENT MAY BE PASSED TO THE SHELL FROM
         * THE ASCII LINE.
         */
         * ONLY ONE ARGUMENT MAY BE PASSED TO THE SHELL FROM
         * THE ASCII LINE.
         */
+       u.u_exdata.ux_shell[0] = 0;     /* for zero length files */
        u.u_error = rdwri(UIO_READ, ip, (caddr_t)&u.u_exdata, sizeof (u.u_exdata),
            0, 1, &resid);
        if (u.u_error)
        u.u_error = rdwri(UIO_READ, ip, (caddr_t)&u.u_exdata, sizeof (u.u_exdata),
            0, 1, &resid);
        if (u.u_error)
@@ -504,9 +506,7 @@ setregs()
                        u.u_ofile[i] = NULL;
                        u.u_pofile[i] = 0;
                }
                        u.u_ofile[i] = NULL;
                        u.u_pofile[i] = 0;
                }
-#ifdef SUNMMAP
                u.u_pofile[i] &= ~UF_MAPPED;
                u.u_pofile[i] &= ~UF_MAPPED;
-#endif
        }
 
        /*
        }
 
        /*
@@ -674,7 +674,7 @@ panic("exit: m_getclr");
        swtch();
 }
 
        swtch();
 }
 
-#include <vtimes.h>
+#include "../h/vtimes.h"
 
 owait()
 {
 
 owait()
 {
index 858462c..c5b04c3 100644 (file)
@@ -1,14 +1,15 @@
-/*     kern_prot.c     5.12    82/11/22        */
+/*     kern_prot.c     5.13    82/12/17        */
 
 /*
  * System calls related to processes and protection
  */
 
 
 /*
  * System calls related to processes and protection
  */
 
+#include "../machine/reg.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/dir.h"
 #include "../h/user.h"
-#include "../h/reg.h"
 #include "../h/inode.h"
 #include "../h/proc.h"
 #include "../h/timeb.h"
 #include "../h/inode.h"
 #include "../h/proc.h"
 #include "../h/timeb.h"
index 94901d0..9f748f2 100644 (file)
@@ -1,4 +1,4 @@
-/*     kern_resource.c 4.17    82/10/19        */
+/*     kern_resource.c 4.18    82/12/17        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -279,7 +279,7 @@ scale60(tvp)
        return (tvp->tv_sec * 60 + tvp->tv_usec / 16667);
 }
 
        return (tvp->tv_sec * 60 + tvp->tv_usec / 16667);
 }
 
-#include <vtimes.h>
+#include "../h/vtimes.h"
 
 ovtimes()
 {
 
 ovtimes()
 {
index 2da158a..d9f91b4 100644 (file)
@@ -1,10 +1,13 @@
-/*     kern_sig.c      5.12    82/11/13        */
+/*     kern_sig.c      5.13    82/12/17        */
+
+#include "../machine/reg.h"
+#include "../machine/pte.h"
+#include "../machine/psl.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/dir.h"
 #include "../h/user.h"
-#include "../h/reg.h"
 #include "../h/inode.h"
 #include "../h/proc.h"
 #include "../h/timeb.h"
 #include "../h/inode.h"
 #include "../h/proc.h"
 #include "../h/timeb.h"
@@ -14,8 +17,6 @@
 #include "../h/mount.h"
 #include "../h/text.h"
 #include "../h/seg.h"
 #include "../h/mount.h"
 #include "../h/text.h"
 #include "../h/seg.h"
-#include "../h/pte.h"
-#include "../h/psl.h"
 #include "../h/vm.h"
 #include "../h/acct.h"
 #include "../h/uio.h"
 #include "../h/vm.h"
 #include "../h/acct.h"
 #include "../h/uio.h"
index 3316273..1843863 100644 (file)
@@ -1,4 +1,6 @@
-/*     kern_synch.c    4.24    82/10/21        */
+/*     kern_synch.c    4.25    82/12/17        */
+
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/file.h"
 #include "../h/inode.h"
 #include "../h/vm.h"
 #include "../h/file.h"
 #include "../h/inode.h"
 #include "../h/vm.h"
-#include "../h/pte.h"
 #ifdef MUSH
 #include "../h/quota.h"
 #include "../h/share.h"
 #endif
 #include "../h/kernel.h"
 #include "../h/buf.h"
 #ifdef MUSH
 #include "../h/quota.h"
 #include "../h/share.h"
 #endif
 #include "../h/kernel.h"
 #include "../h/buf.h"
-#include "../vax/mtpr.h"       /* XXX */
 
 
+#ifdef vax
+#include "../vax/mtpr.h"       /* XXX */
+#endif
 /*
  * Force switch among equal priority processes every 100ms.
  */
 /*
  * Force switch among equal priority processes every 100ms.
  */
index 731e220..b7710b5 100644 (file)
@@ -1,10 +1,11 @@
-/*     kern_time.c     5.11    82/11/02        */
+/*     kern_time.c     5.12    82/12/17        */
+
+#include "../machine/reg.h"
 
 #include "../h/param.h"
 #include "../h/dir.h"          /* XXX */
 #include "../h/user.h"
 #include "../h/kernel.h"
 
 #include "../h/param.h"
 #include "../h/dir.h"          /* XXX */
 #include "../h/user.h"
 #include "../h/kernel.h"
-#include "../h/reg.h"
 #include "../h/inode.h"
 #include "../h/proc.h"
 
 #include "../h/inode.h"
 #include "../h/proc.h"
 
index eddf715..303db76 100644 (file)
@@ -1,4 +1,4 @@
-/*     subr_prf.c      4.24    82/10/31        */
+/*     subr_prf.c      4.25    82/12/17        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -10,6 +10,7 @@
 #include "../h/msgbuf.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/msgbuf.h"
 #include "../h/dir.h"
 #include "../h/user.h"
+#include "../h/proc.h"
 #include "../h/tty.h"
 
 /*
 #include "../h/tty.h"
 
 /*
@@ -176,13 +177,14 @@ panic(s)
 
        if (panicstr)
                bootopt |= RB_NOSYNC;
 
        if (panicstr)
                bootopt |= RB_NOSYNC;
-#ifdef sun
        else {
        else {
+               panicstr = s;
+#ifdef sun
                asm("movl a6, a5");
                traceback(a5, a5);
                asm("movl a6, a5");
                traceback(a5, a5);
-       }
+               resume(pcbb(u.u_procp));        /* for adb traceback */
 #endif
 #endif
-       panicstr = s;
+       }
        printf("panic: %s\n", s);
        boot(RB_PANIC, bootopt);
 }
        printf("panic: %s\n", s);
        boot(RB_PANIC, bootopt);
 }
index def3aff..a8a5f05 100644 (file)
@@ -1,4 +1,4 @@
-/*     subr_prof.c     4.2     82/11/13        */
+/*     subr_prof.c     4.3     82/12/17        */
 
 #ifdef GPROF
 #include "../h/crt0.h"
 
 #ifdef GPROF
 #include "../h/crt0.h"
@@ -12,7 +12,12 @@ int  profiling = 3;
 u_short        *froms = 0;
 struct tostruct *tos = 0;
 u_short        tolimit = 0;
 u_short        *froms = 0;
 struct tostruct *tos = 0;
 u_short        tolimit = 0;
+#ifdef vax
 char   *s_lowpc = (char *)0x80000000;
 char   *s_lowpc = (char *)0x80000000;
+#endif
+#ifdef sun
+char   *s_lowpc = (char *)0x4000;
+#endif
 extern char etext;
 char   *s_highpc = &etext;
 u_long s_textsize = 0;
 extern char etext;
 char   *s_highpc = &etext;
 u_long s_textsize = 0;
@@ -69,6 +74,7 @@ kmstartup()
 #endif
 }
 
 #endif
 }
 
+#ifdef vax
 /*
  * This routine is massaged so that it may be jsb'ed to
  */
 /*
  * This routine is massaged so that it may be jsb'ed to
  */
@@ -154,4 +160,5 @@ overflow:
        printf("mcount: tos overflow\n");
        goto out;
 }
        printf("mcount: tos overflow\n");
        goto out;
 }
+#endif
 #endif GPROF
 #endif GPROF
index b1ccbf0..86efb60 100644 (file)
@@ -1,4 +1,6 @@
-/*     subr_xxx.c      4.20    82/10/31        */
+/*     subr_xxx.c      4.21    82/12/17        */
+
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -10,7 +12,6 @@
 #include "../h/proc.h"
 #include "../h/fs.h"
 #include "../h/vm.h"
 #include "../h/proc.h"
 #include "../h/fs.h"
 #include "../h/vm.h"
-#include "../h/pte.h"
 #include "../h/cmap.h"
 #include "../h/uio.h"
 
 #include "../h/cmap.h"
 #include "../h/uio.h"
 
index 3081c26..b688b20 100644 (file)
@@ -1,4 +1,8 @@
-/*     sys_process.c   5.7     82/10/31        */
+/*     sys_process.c   5.8     82/12/17        */
+
+#include "../machine/reg.h"
+#include "../machine/psl.h"
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -6,11 +10,8 @@
 #include "../h/user.h"
 #include "../h/proc.h"
 #include "../h/inode.h"
 #include "../h/user.h"
 #include "../h/proc.h"
 #include "../h/inode.h"
-#include "../h/reg.h"
 #include "../h/text.h"
 #include "../h/seg.h"
 #include "../h/text.h"
 #include "../h/seg.h"
-#include "../h/pte.h"
-#include "../h/psl.h"
 #include "../h/vm.h"
 #include "../h/buf.h"
 #include "../h/acct.h"
 #include "../h/vm.h"
 #include "../h/buf.h"
 #include "../h/acct.h"
@@ -176,6 +177,12 @@ procxmt()
                if (p == &u.u_ar0[PS]) {
                        ipc.ip_data |= PSL_USERSET;
                        ipc.ip_data &=  ~PSL_USERCLR;
                if (p == &u.u_ar0[PS]) {
                        ipc.ip_data |= PSL_USERSET;
                        ipc.ip_data &=  ~PSL_USERCLR;
+#ifdef sun
+                       if (ipc.ip_data & PSL_T)
+                               traceon();
+                       else
+                               traceoff();
+#endif
                        goto ok;
                }
                goto error;
                        goto ok;
                }
                goto error;
@@ -193,8 +200,12 @@ procxmt()
                if ((unsigned)ipc.ip_data > NSIG)
                        goto error;
                u.u_procp->p_cursig = ipc.ip_data;      /* see issig */
                if ((unsigned)ipc.ip_data > NSIG)
                        goto error;
                u.u_procp->p_cursig = ipc.ip_data;      /* see issig */
-               if (i == 9)
+               if (i == 9) 
+#ifdef sun
+                       traceon();
+#else
                        u.u_ar0[PS] |= PSL_T;
                        u.u_ar0[PS] |= PSL_T;
+#endif
                wakeup((caddr_t)&ipc);
                return (1);
 
                wakeup((caddr_t)&ipc);
                return (1);
 
index 2650da8..e543be4 100644 (file)
@@ -1,4 +1,6 @@
-/*     tty.c   4.36    82/12/13        */
+/*     tty.c   4.37    82/12/17        */
+
+#include "../machine/reg.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -9,7 +11,6 @@
 #include "../h/proc.h"
 #include "../h/inode.h"
 #include "../h/file.h"
 #include "../h/proc.h"
 #include "../h/inode.h"
 #include "../h/file.h"
-#include "../h/reg.h"
 #include "../h/conf.h"
 #include "../h/buf.h"
 #include "../h/dk.h"
 #include "../h/conf.h"
 #include "../h/buf.h"
 #include "../h/dk.h"
index 5a4b3ae..bf2fed7 100644 (file)
@@ -1,4 +1,4 @@
-/*     tty_subr.c      4.17    82/11/13        */
+/*     tty_subr.c      4.18    82/12/17        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -54,14 +54,13 @@ register struct clist *p;
        return(c);
 }
 
        return(c);
 }
 
-#if notdef
 /*
  * copy clist to buffer.
  * return number of bytes moved.
  */
 q_to_b(q, cp, cc)
 /*
  * copy clist to buffer.
  * return number of bytes moved.
  */
 q_to_b(q, cp, cc)
-register struct clist *q;
-register char *cp;
+       register struct clist *q;
+       register char *cp;
 {
        register struct cblock *bp;
        register int s;
 {
        register struct cblock *bp;
        register int s;
@@ -110,7 +109,6 @@ register char *cp;
        splx(s);
        return(cp-acp);
 }
        splx(s);
        return(cp-acp);
 }
-#endif
 
 /*
  * Return count of contiguous characters
 
 /*
  * Return count of contiguous characters
@@ -118,10 +116,10 @@ register char *cp;
  * Stop counting if flag&character is non-null.
  */
 ndqb(q, flag)
  * Stop counting if flag&character is non-null.
  */
 ndqb(q, flag)
-register struct clist *q;
+       register struct clist *q;
 {
 {
-register cc;
-int s;
+       register cc;
+       int s;
 
        s = spl5();
        if (q->c_cc <= 0) {
 
        s = spl5();
        if (q->c_cc <= 0) {
@@ -382,36 +380,47 @@ struct clist *from, *to;
                (void) putc(c, to);
 }
 
                (void) putc(c, to);
 }
 
-#include "dmc.h"
-#ifdef NDMC > 0
 /*
 /*
- * integer (2-byte) get/put
+ * Integer (short) get/put
  * using clists
  */
  * using clists
  */
+typedef        short word_t;
+union chword {
+       word_t  word;
+       struct {
+               char    Ch[sizeof (word_t)];
+       } Cha;
+#define        ch      Cha.Ch
+};
+
 getw(p)
        register struct clist *p;
 {
 getw(p)
        register struct clist *p;
 {
-       register int s;
-
-       if (p->c_cc <= 1)
-               return(-1);
-       s = getc(p);
-       return(s | (getc(p)<<8));
+       register int i;
+       union chword x;
+
+       if (p->c_cc < sizeof (word_t))
+               return (-1);
+       for (i = 0; i < sizeof (word_t); i++)
+               x.ch[i] = getc(p);
+       return (x.word);
 }
 
 putw(c, p)
        register struct clist *p;
 {
        register s;
 }
 
 putw(c, p)
        register struct clist *p;
 {
        register s;
+       register int i;
+       union chword x;
 
        s = spl5();
        if (cfreelist==NULL) {
                splx(s);
                return(-1);
        }
 
        s = spl5();
        if (cfreelist==NULL) {
                splx(s);
                return(-1);
        }
-       (void) putc(c, p);
-       (void) putc(c>>8, p);
+       x.word = c;
+       for (i = 0; i < sizeof (word_t); i++)
+               (void) putc(x.ch[i], p);
        splx(s);
        splx(s);
-       return(0);
+       return (0);
 }
 }
-#endif
index a42f5eb..d7b1ffe 100644 (file)
@@ -1,10 +1,11 @@
-/*     uipc_mbuf.c     1.41    82/12/14        */
+/*     uipc_mbuf.c     1.42    82/12/17        */
+
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/proc.h"
 
 #include "../h/param.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/proc.h"
-#include "../h/pte.h"
 #include "../h/cmap.h"
 #include "../h/map.h"
 #include "../h/mbuf.h"
 #include "../h/cmap.h"
 #include "../h/map.h"
 #include "../h/mbuf.h"
@@ -14,9 +15,9 @@
 mbinit()
 {
 
 mbinit()
 {
 
-       if (m_clalloc(4, MPG_MBUFS) == 0)
+       if (m_clalloc(4096/CLBYTES, MPG_MBUFS) == 0)
                goto bad;
                goto bad;
-       if (m_clalloc(32, MPG_CLUSTERS) == 0)
+       if (m_clalloc(8*4096/CLBYTES, MPG_CLUSTERS) == 0)
                goto bad;
        return;
 bad:
                goto bad;
        return;
 bad:
@@ -40,8 +41,12 @@ m_clalloc(ncl, how)
        if (mbx == 0)
                return (0);
        m = cltom(mbx / CLSIZE);
        if (mbx == 0)
                return (0);
        m = cltom(mbx / CLSIZE);
-       if (memall(&Mbmap[mbx], npg, proc, CSYS) == 0)
+       if (memall(&Mbmap[mbx], npg, proc, CSYS) == 0) {
+               s = splimp();
+               rmfree(mbmap, (long)npg, (long)mbx);
+               splx(s);
                return (0);
                return (0);
+       }
        vmaccess(&Mbmap[mbx], (caddr_t)m, npg);
        switch (how) {
 
        vmaccess(&Mbmap[mbx], (caddr_t)m, npg);
        switch (how) {
 
index b67611b..7a2ec09 100644 (file)
@@ -1,4 +1,6 @@
-/*     vfs_bio.c       4.39    82/11/13        */
+/*     vfs_bio.c       4.40    82/12/17        */
+
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -8,7 +10,6 @@
 #include "../h/conf.h"
 #include "../h/proc.h"
 #include "../h/seg.h"
 #include "../h/conf.h"
 #include "../h/proc.h"
 #include "../h/seg.h"
-#include "../h/pte.h"
 #include "../h/vm.h"
 #include "../h/trace.h"
 
 #include "../h/vm.h"
 #include "../h/trace.h"
 
@@ -269,7 +270,7 @@ getblk(dev, blkno, size)
        register struct buf *bp, *dp;
        int s;
 
        register struct buf *bp, *dp;
        int s;
 
-       if ((unsigned)blkno >= 1 << (sizeof(int)*NBBY-PGSHIFT))
+       if ((unsigned)blkno >= 1 << (sizeof(int)*NBBY-PGSHIFT)) /* XXX */
                blkno = 1 << ((sizeof(int)*NBBY-PGSHIFT) + 1);
        /*
         * Search the cache for the block.  If we hit, but
                blkno = 1 << ((sizeof(int)*NBBY-PGSHIFT) + 1);
        /*
         * Search the cache for the block.  If we hit, but
@@ -336,6 +337,7 @@ loop:
 
 /*
  * Allocate space associated with a buffer.
 
 /*
  * Allocate space associated with a buffer.
+ * If can't get space, buffer is released
  */
 brealloc(bp, size)
        register struct buf *bp;
  */
 brealloc(bp, size)
        register struct buf *bp;
@@ -359,14 +361,11 @@ brealloc(bp, size)
                }
                if (bp->b_flags & B_LOCKED)
                        panic("brealloc");
                }
                if (bp->b_flags & B_LOCKED)
                        panic("brealloc");
-               allocbuf(bp, size);
-               return (1);
+               return (allocbuf(bp, size));
        }
        bp->b_flags &= ~B_DONE;
        }
        bp->b_flags &= ~B_DONE;
-       if (bp->b_dev == NODEV) {
-               allocbuf(bp, size);
-               return (1);
-       }
+       if (bp->b_dev == NODEV)
+               return (allocbuf(bp, size));
 
        /*
         * Search cache for any buffers that overlap the one that we
 
        /*
         * Search cache for any buffers that overlap the one that we
@@ -403,12 +402,12 @@ loop:
                ep->b_flags |= B_INVAL;
                brelse(ep);
        }
                ep->b_flags |= B_INVAL;
                brelse(ep);
        }
-       allocbuf(bp, size);
-       return (1);
+       return (allocbuf(bp, size));
 }
 
 /*
  * Expand or contract the actual memory allocated to a buffer.
 }
 
 /*
  * Expand or contract the actual memory allocated to a buffer.
+ * If no memory is available, release buffer and take error exit
  */
 allocbuf(tp, size)
        register struct buf *tp;
  */
 allocbuf(tp, size)
        register struct buf *tp;
@@ -416,13 +415,22 @@ allocbuf(tp, size)
 {
        register struct buf *bp, *ep;
        int sizealloc, take;
 {
        register struct buf *bp, *ep;
        int sizealloc, take;
+#ifdef sun
+       register char *a;
+       int osize;
+#endif
 
 
+#ifndef sun
        sizealloc = roundup(size, CLBYTES);
        sizealloc = roundup(size, CLBYTES);
+#else
+       sizealloc = roundup(size, BUFALLOCSIZE);
+#endif
        /*
         * Buffer size does not change
         */
        if (sizealloc == tp->b_bufsize)
                goto out;
        /*
         * Buffer size does not change
         */
        if (sizealloc == tp->b_bufsize)
                goto out;
+#ifndef sun
        /*
         * Buffer size is shrinking.
         * Place excess space in a buffer header taken from the
        /*
         * Buffer size is shrinking.
         * Place excess space in a buffer header taken from the
@@ -469,8 +477,52 @@ allocbuf(tp, size)
                }
                brelse(bp);
        }
                }
                brelse(bp);
        }
+#else
+       /*
+        * Buffer size is shrinking
+        * Just put the tail end back in the map
+        */
+       if (sizealloc < tp->b_bufsize) {
+               rmfree(buffermap, (long)(tp->b_bufsize - sizealloc),
+                       (long)(tp->b_un.b_addr + sizealloc));
+               tp->b_bufsize = sizealloc;
+               goto out;
+       }
+       /*
+        * Buffer is being expanded or created
+        * If being expanded, attempt to get contiguous
+        * section, otherwise get a new chunk and copy.
+        * If no space, free up a buffer on the AGE list
+        * and try again.
+        */
+       do {
+               if ((osize = tp->b_bufsize)) {
+                       a = (char *)rmget(buffermap, (long)(sizealloc-osize),
+                               (long)(tp->b_un.b_addr + osize));
+                       if (a == 0) {
+                               a = (char *)rmalloc(buffermap, (long)sizealloc);
+                               if (a != 0) {
+                                       bcopy(tp->b_un.b_addr, a, osize);
+                                       rmfree(buffermap, (long)osize,
+                                               (long)tp->b_un.b_addr);
+                                       tp->b_un.b_addr = a;
+                               }
+                       }
+               } else {
+                       a = (char *)rmalloc(buffermap, (long)sizealloc);
+                       if (a != 0)
+                               tp->b_un.b_addr = a;
+               }
+       } while (a == 0 && bfreemem());
+       if (a == 0) {
+               brelse(tp);
+               return (0);
+       }
+       tp->b_bufsize = sizealloc;
+#endif
 out:
        tp->b_bcount = size;
 out:
        tp->b_bcount = size;
+       return (1);
 }
 
 /*
 }
 
 /*
@@ -479,15 +531,55 @@ out:
 bfree(bp)
        struct buf *bp;
 {
 bfree(bp)
        struct buf *bp;
 {
-       /*
-        * This stub is provided to allow the system to reclaim
-        * memory from the buffer pool. Currently we do not migrate
-        * memory between the buffer memory pool and the user memory
-        * pool.
-        */
+#ifdef sun
+       if (bp->b_bufsize) {
+               rmfree(buffermap, (long)bp->b_bufsize, (long)bp->b_un.b_addr);
+               bp->b_bufsize = 0;
+       }
+#endif
        bp->b_bcount = 0;
 }
 
        bp->b_bcount = 0;
 }
 
+#ifdef sun
+/*
+ * Attempt to free up buffer space by flushing
+ * something in the free list.
+ * Don't wait for something, that could cause deadlocks
+ * We start with BQ_AGE because we know BQ_EMPTY take no memory.
+ */
+bfreemem()
+{
+       register struct buf *bp, *dp;
+       int s;
+
+loop:
+       s = spl6();
+       for (dp = &bfreelist[BQ_AGE]; dp > bfreelist; dp--)
+               if (dp->av_forw != dp)
+                       break;
+       splx(s);
+       if (dp == bfreelist) {          /* no free blocks */
+               return (0);
+       }
+       bp = dp->av_forw;
+       notavail(bp);
+       if (bp->b_flags & B_DELWRI) {
+               bp->b_flags |= B_ASYNC;
+               bwrite(bp);
+               goto loop;
+       }
+       trace(TR_BRELSE, bp->b_dev, bp->b_blkno);
+       bp->b_flags = B_BUSY | B_INVAL;
+       bfree(bp);
+       bremhash(bp);
+       binshash(bp, &bfreelist[BQ_EMPTY]);
+       bp->b_dev = (dev_t)NODEV;
+       bp->b_error = 0;
+       brelse(bp);
+       return (1);
+}
+#endif
+
 /*
  * Find a buffer which is available for use.
  * Select something from a free list.
 /*
  * Find a buffer which is available for use.
  * Select something from a free list.
@@ -501,7 +593,11 @@ getnewbuf()
 
 loop:
        s = spl6();
 
 loop:
        s = spl6();
+#ifndef sun
        for (dp = &bfreelist[BQ_AGE]; dp > bfreelist; dp--)
        for (dp = &bfreelist[BQ_AGE]; dp > bfreelist; dp--)
+#else
+       for (dp = &bfreelist[BQ_EMPTY]; dp > bfreelist; dp--)
+#endif
                if (dp->av_forw != dp)
                        break;
        if (dp == bfreelist) {          /* no free blocks */
                if (dp->av_forw != dp)
                        break;
        if (dp == bfreelist) {          /* no free blocks */
@@ -569,6 +665,11 @@ biodone(bp)
                splx(s);
                return;
        }
                splx(s);
                return;
        }
+       if (bp->b_flags & B_CALL) {
+               bp->b_flags &= ~B_CALL;
+               (*bp->b_iodone)(bp);
+               return;
+       }
        if (bp->b_flags&B_ASYNC)
                brelse(bp);
        else {
        if (bp->b_flags&B_ASYNC)
                brelse(bp);
        else {
index 8b3282d..b15092b 100644 (file)
@@ -1,4 +1,6 @@
-/*     vfs_cluster.c   4.39    82/11/13        */
+/*     vfs_cluster.c   4.40    82/12/17        */
+
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -8,7 +10,6 @@
 #include "../h/conf.h"
 #include "../h/proc.h"
 #include "../h/seg.h"
 #include "../h/conf.h"
 #include "../h/proc.h"
 #include "../h/seg.h"
-#include "../h/pte.h"
 #include "../h/vm.h"
 #include "../h/trace.h"
 
 #include "../h/vm.h"
 #include "../h/trace.h"
 
@@ -269,7 +270,7 @@ getblk(dev, blkno, size)
        register struct buf *bp, *dp;
        int s;
 
        register struct buf *bp, *dp;
        int s;
 
-       if ((unsigned)blkno >= 1 << (sizeof(int)*NBBY-PGSHIFT))
+       if ((unsigned)blkno >= 1 << (sizeof(int)*NBBY-PGSHIFT)) /* XXX */
                blkno = 1 << ((sizeof(int)*NBBY-PGSHIFT) + 1);
        /*
         * Search the cache for the block.  If we hit, but
                blkno = 1 << ((sizeof(int)*NBBY-PGSHIFT) + 1);
        /*
         * Search the cache for the block.  If we hit, but
@@ -336,6 +337,7 @@ loop:
 
 /*
  * Allocate space associated with a buffer.
 
 /*
  * Allocate space associated with a buffer.
+ * If can't get space, buffer is released
  */
 brealloc(bp, size)
        register struct buf *bp;
  */
 brealloc(bp, size)
        register struct buf *bp;
@@ -359,14 +361,11 @@ brealloc(bp, size)
                }
                if (bp->b_flags & B_LOCKED)
                        panic("brealloc");
                }
                if (bp->b_flags & B_LOCKED)
                        panic("brealloc");
-               allocbuf(bp, size);
-               return (1);
+               return (allocbuf(bp, size));
        }
        bp->b_flags &= ~B_DONE;
        }
        bp->b_flags &= ~B_DONE;
-       if (bp->b_dev == NODEV) {
-               allocbuf(bp, size);
-               return (1);
-       }
+       if (bp->b_dev == NODEV)
+               return (allocbuf(bp, size));
 
        /*
         * Search cache for any buffers that overlap the one that we
 
        /*
         * Search cache for any buffers that overlap the one that we
@@ -403,12 +402,12 @@ loop:
                ep->b_flags |= B_INVAL;
                brelse(ep);
        }
                ep->b_flags |= B_INVAL;
                brelse(ep);
        }
-       allocbuf(bp, size);
-       return (1);
+       return (allocbuf(bp, size));
 }
 
 /*
  * Expand or contract the actual memory allocated to a buffer.
 }
 
 /*
  * Expand or contract the actual memory allocated to a buffer.
+ * If no memory is available, release buffer and take error exit
  */
 allocbuf(tp, size)
        register struct buf *tp;
  */
 allocbuf(tp, size)
        register struct buf *tp;
@@ -416,13 +415,22 @@ allocbuf(tp, size)
 {
        register struct buf *bp, *ep;
        int sizealloc, take;
 {
        register struct buf *bp, *ep;
        int sizealloc, take;
+#ifdef sun
+       register char *a;
+       int osize;
+#endif
 
 
+#ifndef sun
        sizealloc = roundup(size, CLBYTES);
        sizealloc = roundup(size, CLBYTES);
+#else
+       sizealloc = roundup(size, BUFALLOCSIZE);
+#endif
        /*
         * Buffer size does not change
         */
        if (sizealloc == tp->b_bufsize)
                goto out;
        /*
         * Buffer size does not change
         */
        if (sizealloc == tp->b_bufsize)
                goto out;
+#ifndef sun
        /*
         * Buffer size is shrinking.
         * Place excess space in a buffer header taken from the
        /*
         * Buffer size is shrinking.
         * Place excess space in a buffer header taken from the
@@ -469,8 +477,52 @@ allocbuf(tp, size)
                }
                brelse(bp);
        }
                }
                brelse(bp);
        }
+#else
+       /*
+        * Buffer size is shrinking
+        * Just put the tail end back in the map
+        */
+       if (sizealloc < tp->b_bufsize) {
+               rmfree(buffermap, (long)(tp->b_bufsize - sizealloc),
+                       (long)(tp->b_un.b_addr + sizealloc));
+               tp->b_bufsize = sizealloc;
+               goto out;
+       }
+       /*
+        * Buffer is being expanded or created
+        * If being expanded, attempt to get contiguous
+        * section, otherwise get a new chunk and copy.
+        * If no space, free up a buffer on the AGE list
+        * and try again.
+        */
+       do {
+               if ((osize = tp->b_bufsize)) {
+                       a = (char *)rmget(buffermap, (long)(sizealloc-osize),
+                               (long)(tp->b_un.b_addr + osize));
+                       if (a == 0) {
+                               a = (char *)rmalloc(buffermap, (long)sizealloc);
+                               if (a != 0) {
+                                       bcopy(tp->b_un.b_addr, a, osize);
+                                       rmfree(buffermap, (long)osize,
+                                               (long)tp->b_un.b_addr);
+                                       tp->b_un.b_addr = a;
+                               }
+                       }
+               } else {
+                       a = (char *)rmalloc(buffermap, (long)sizealloc);
+                       if (a != 0)
+                               tp->b_un.b_addr = a;
+               }
+       } while (a == 0 && bfreemem());
+       if (a == 0) {
+               brelse(tp);
+               return (0);
+       }
+       tp->b_bufsize = sizealloc;
+#endif
 out:
        tp->b_bcount = size;
 out:
        tp->b_bcount = size;
+       return (1);
 }
 
 /*
 }
 
 /*
@@ -479,15 +531,55 @@ out:
 bfree(bp)
        struct buf *bp;
 {
 bfree(bp)
        struct buf *bp;
 {
-       /*
-        * This stub is provided to allow the system to reclaim
-        * memory from the buffer pool. Currently we do not migrate
-        * memory between the buffer memory pool and the user memory
-        * pool.
-        */
+#ifdef sun
+       if (bp->b_bufsize) {
+               rmfree(buffermap, (long)bp->b_bufsize, (long)bp->b_un.b_addr);
+               bp->b_bufsize = 0;
+       }
+#endif
        bp->b_bcount = 0;
 }
 
        bp->b_bcount = 0;
 }
 
+#ifdef sun
+/*
+ * Attempt to free up buffer space by flushing
+ * something in the free list.
+ * Don't wait for something, that could cause deadlocks
+ * We start with BQ_AGE because we know BQ_EMPTY take no memory.
+ */
+bfreemem()
+{
+       register struct buf *bp, *dp;
+       int s;
+
+loop:
+       s = spl6();
+       for (dp = &bfreelist[BQ_AGE]; dp > bfreelist; dp--)
+               if (dp->av_forw != dp)
+                       break;
+       splx(s);
+       if (dp == bfreelist) {          /* no free blocks */
+               return (0);
+       }
+       bp = dp->av_forw;
+       notavail(bp);
+       if (bp->b_flags & B_DELWRI) {
+               bp->b_flags |= B_ASYNC;
+               bwrite(bp);
+               goto loop;
+       }
+       trace(TR_BRELSE, bp->b_dev, bp->b_blkno);
+       bp->b_flags = B_BUSY | B_INVAL;
+       bfree(bp);
+       bremhash(bp);
+       binshash(bp, &bfreelist[BQ_EMPTY]);
+       bp->b_dev = (dev_t)NODEV;
+       bp->b_error = 0;
+       brelse(bp);
+       return (1);
+}
+#endif
+
 /*
  * Find a buffer which is available for use.
  * Select something from a free list.
 /*
  * Find a buffer which is available for use.
  * Select something from a free list.
@@ -501,7 +593,11 @@ getnewbuf()
 
 loop:
        s = spl6();
 
 loop:
        s = spl6();
+#ifndef sun
        for (dp = &bfreelist[BQ_AGE]; dp > bfreelist; dp--)
        for (dp = &bfreelist[BQ_AGE]; dp > bfreelist; dp--)
+#else
+       for (dp = &bfreelist[BQ_EMPTY]; dp > bfreelist; dp--)
+#endif
                if (dp->av_forw != dp)
                        break;
        if (dp == bfreelist) {          /* no free blocks */
                if (dp->av_forw != dp)
                        break;
        if (dp == bfreelist) {          /* no free blocks */
@@ -569,6 +665,11 @@ biodone(bp)
                splx(s);
                return;
        }
                splx(s);
                return;
        }
+       if (bp->b_flags & B_CALL) {
+               bp->b_flags &= ~B_CALL;
+               (*bp->b_iodone)(bp);
+               return;
+       }
        if (bp->b_flags&B_ASYNC)
                brelse(bp);
        else {
        if (bp->b_flags&B_ASYNC)
                brelse(bp);
        else {
index ec06aa8..b306c61 100644 (file)
@@ -1,4 +1,6 @@
-/*     vfs_vnops.c     4.30    82/11/13        */
+/*     vfs_vnops.c     4.31    82/12/17        */
+
+#include "../machine/reg.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -8,7 +10,6 @@
 #include "../h/file.h"
 #include "../h/conf.h"
 #include "../h/inode.h"
 #include "../h/file.h"
 #include "../h/conf.h"
 #include "../h/inode.h"
-#include "../h/reg.h"
 #include "../h/acct.h"
 #include "../h/mount.h"
 #include "../h/socket.h"
 #include "../h/acct.h"
 #include "../h/mount.h"
 #include "../h/socket.h"
index 6f11375..10a7d77 100644 (file)
@@ -1,4 +1,4 @@
-/*     in.h    4.18    82/11/03        */
+/*     in.h    4.19    82/12/17        */
 
 /*
  * Constants and structures defined by the internet system,
 
 /*
  * Constants and structures defined by the internet system,
@@ -80,13 +80,11 @@ struct in_addr {
                u_long S_addr;
        } S_un;
 #define        s_addr  S_un.S_addr     /* can be used for most tcp & ip code */
                u_long S_addr;
        } S_un;
 #define        s_addr  S_un.S_addr     /* can be used for most tcp & ip code */
-#ifdef vax
 #define        s_host  S_un.S_un_b.s_b2        /* host on imp */
 #define        s_net   S_un.S_un_b.s_b1        /* network */
 #define        s_imp   S_un.S_un_w.s_w2        /* imp */
 #define        s_impno S_un.S_un_b.s_b4        /* imp # */
 #define        s_lh    S_un.S_un_b.s_b3        /* logical host */
 #define        s_host  S_un.S_un_b.s_b2        /* host on imp */
 #define        s_net   S_un.S_un_b.s_b1        /* network */
 #define        s_imp   S_un.S_un_w.s_w2        /* imp */
 #define        s_impno S_un.S_un_b.s_b4        /* imp # */
 #define        s_lh    S_un.S_un_b.s_b3        /* logical host */
-#endif
 };
 
 /*
 };
 
 /*
index 266350a..904e1c1 100644 (file)
@@ -1,4 +1,4 @@
-/*     buf.h   4.18    82/11/13        */
+/*     buf.h   4.19    82/12/17        */
 
 /*
  * The header for buffers in the buffer pool and otherwise used
 
 /*
  * The header for buffers in the buffer pool and otherwise used
@@ -57,6 +57,7 @@ struct buf
 #define        b_errcnt b_resid                /* while i/o in progress: # retries */
 #define        b_pfcent b_resid                /* garbage: don't ask */
        struct  proc *b_proc;           /* proc doing physical or swap I/O */
 #define        b_errcnt b_resid                /* while i/o in progress: # retries */
 #define        b_pfcent b_resid                /* garbage: don't ask */
        struct  proc *b_proc;           /* proc doing physical or swap I/O */
+       int     (*b_iodone)();          /* function called by iodone */
 };
 
 #define        BQUEUES         4               /* number of free buffer queues */
 };
 
 #define        BQUEUES         4               /* number of free buffer queues */
@@ -120,6 +121,7 @@ unsigned minphys();
 #define        B_LOCKED        0x020000        /* locked in core (not reusable) */
 #define        B_HEAD          0x040000        /* a buffer header, not a buffer */
 #define        B_BAD           0x100000        /* bad block revectoring in progress */
 #define        B_LOCKED        0x020000        /* locked in core (not reusable) */
 #define        B_HEAD          0x040000        /* a buffer header, not a buffer */
 #define        B_BAD           0x100000        /* bad block revectoring in progress */
+#define        B_CALL          0x200000        /* call b_iodone from iodone */
 
 /*
  * Insq/Remq for the buffer hash lists.
 
 /*
  * Insq/Remq for the buffer hash lists.
@@ -176,3 +178,22 @@ unsigned minphys();
        blkclr(bp->b_un.b_addr, bp->b_bcount); \
        bp->b_resid = 0; \
 }
        blkclr(bp->b_un.b_addr, bp->b_bcount); \
        bp->b_resid = 0; \
 }
+
+#ifdef sun
+/*
+ * Declarations for buffer space rmaps
+ */
+struct map *buffermap;
+#define BUFMAPSIZE     256
+
+/*
+ * "Average" size of a buffer
+ * nbuf*AVGBSIZE is total amount of buffer data
+ */
+#define        AVGBSIZE        2048
+
+/*
+ * Unit of buffer space allocation
+ */
+#define        BUFALLOCSIZE    1024
+#endif
index 970bc31..bb6de90 100644 (file)
@@ -1,4 +1,4 @@
-/*     ioctl.h 4.25    82/12/13        */
+/*     ioctl.h 4.26    82/12/17        */
 /*
  * Ioctl definitions
  */
 /*
  * Ioctl definitions
  */
@@ -204,10 +204,4 @@ struct ltchars {
 #define        SIOCGPGRP       _IOR(s, 9, int)         /* get process group */
 #define        SIOCADDRT       _IOW(s,10, struct rtentry)/* add route */
 #define        SIOCDELRT       _IOW(s,11, struct rtentry)/* delete route */
 #define        SIOCGPGRP       _IOR(s, 9, int)         /* get process group */
 #define        SIOCADDRT       _IOW(s,10, struct rtentry)/* add route */
 #define        SIOCDELRT       _IOW(s,11, struct rtentry)/* delete route */
-
-#define        KIOCTRANS       _IOW(k,0, int)  /* set keyboard translation */
-
-#define        MIOCGPOS        _IOR(m,0, XXX)  /* get mouse info */
-#define        MIOCGBUFS       _IOR(m,1, int)  /* get mouse buffer size */
-#define        MIOCWBUFS       _IOW(m,1, int)  /* set mouse buffer size */
 #endif
 #endif
index 3c6f0e9..2f6795b 100644 (file)
@@ -1,13 +1,12 @@
-/*     param.h 4.25    82/10/31        */
+/*     param.h 4.26    82/12/17        */
 
 /*
  * Macine type dependent parameters.
  */
 
 /*
  * Macine type dependent parameters.
  */
-#ifdef vax
-#include "../vax/param.h"
-#endif
-#ifdef sun
-#include "../sun/param.h"
+#ifdef KERNEL
+#include "../machine/param.h"
+#else
+#include <machine/param.h>
 #endif
 
 #define        NPTEPG          (NBPG/(sizeof (struct pte)))
 #endif
 
 #define        NPTEPG          (NBPG/(sizeof (struct pte)))
  */
 #define        howmany(x, y)   (((x)+((y)-1))/(y))
 #define        roundup(x, y)   ((((x)+((y)-1))/(y))*(y))
  */
 #define        howmany(x, y)   (((x)+((y)-1))/(y))
 #define        roundup(x, y)   ((((x)+((y)-1))/(y))*(y))
-
-/*
- * Provide about n microseconds of delay.
- */
-#define        DELAY(n)        { register int N = (n); while (--N > 0); }
index a1b6fde..d8d1ed1 100644 (file)
@@ -1,12 +1,12 @@
-/*     user.h  4.23    82/12/09        */
+/*     user.h  4.24    82/12/17        */
 
 
-#ifdef vax
-#include <vax/pcb.h>
-#endif
-#ifdef sun
-#include <sun/pcb.h>
-#endif
+#ifdef KERNEL
+#include "../machine/pcb.h"
+#include "../h/dmap.h"
+#else
+#include <machine/pcb.h>
 #include <sys/dmap.h>
 #include <sys/dmap.h>
+#endif
 #include <time.h>
 #include <resource.h>
 /*
 #include <time.h>
 #include <resource.h>
 /*
index de9b853..1f50a22 100644 (file)
@@ -1,4 +1,4 @@
-/*     dinode.h        4.20    82/11/13        */
+/*     dinode.h        4.21    82/12/17        */
 
 /*
  * The I node is the focus of all file activity in UNIX.
 
 /*
  * The I node is the focus of all file activity in UNIX.
@@ -60,7 +60,13 @@ struct dinode {
 #define        i_nlink         i_ic.ic_nlink
 #define        i_uid           i_ic.ic_uid
 #define        i_gid           i_ic.ic_gid
 #define        i_nlink         i_ic.ic_nlink
 #define        i_uid           i_ic.ic_uid
 #define        i_gid           i_ic.ic_gid
+/* ugh! -- must be fixed */
+#ifdef vax
 #define        i_size          i_ic.ic_size.val[0]
 #define        i_size          i_ic.ic_size.val[0]
+#endif
+#ifdef sun
+#define        i_size          i_ic.ic_size.val[1]
+#endif
 #define        i_db            i_ic.ic_db
 #define        i_ib            i_ic.ic_ib
 #define        i_atime         i_ic.ic_atime
 #define        i_db            i_ic.ic_db
 #define        i_ib            i_ic.ic_ib
 #define        i_atime         i_ic.ic_atime
@@ -79,7 +85,12 @@ struct dinode {
 #define        di_nlink        di_ic.ic_nlink
 #define        di_uid          di_ic.ic_uid
 #define        di_gid          di_ic.ic_gid
 #define        di_nlink        di_ic.ic_nlink
 #define        di_uid          di_ic.ic_uid
 #define        di_gid          di_ic.ic_gid
+#ifdef vax
 #define        di_size         di_ic.ic_size.val[0]
 #define        di_size         di_ic.ic_size.val[0]
+#endif
+#ifdef sun
+#define        di_size         di_ic.ic_size.val[1]
+#endif
 #define        di_db           di_ic.ic_db
 #define        di_ib           di_ic.ic_ib
 #define        di_atime        di_ic.ic_atime
 #define        di_db           di_ic.ic_db
 #define        di_ib           di_ic.ic_ib
 #define        di_atime        di_ic.ic_atime
index 3bbefd1..e5a86e1 100644 (file)
@@ -1,4 +1,4 @@
-/*     ffs_alloc.c     2.19    82/11/13        */
+/*     ffs_alloc.c     2.20    82/12/17        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -508,6 +508,7 @@ alloccg(ip, cg, bpref, size)
                cgp->cg_cs.cs_nffree += i;
                fs->fs_cstotal.cs_nffree += i;
                fs->fs_cs(fs, cg).cs_nffree += i;
                cgp->cg_cs.cs_nffree += i;
                fs->fs_cstotal.cs_nffree += i;
                fs->fs_cs(fs, cg).cs_nffree += i;
+               fs->fs_fmod++;
                cgp->cg_frsum[i]++;
                bdwrite(bp);
                return (bno);
                cgp->cg_frsum[i]++;
                bdwrite(bp);
                return (bno);
@@ -520,6 +521,7 @@ alloccg(ip, cg, bpref, size)
        cgp->cg_cs.cs_nffree -= frags;
        fs->fs_cstotal.cs_nffree -= frags;
        fs->fs_cs(fs, cg).cs_nffree -= frags;
        cgp->cg_cs.cs_nffree -= frags;
        fs->fs_cstotal.cs_nffree -= frags;
        fs->fs_cs(fs, cg).cs_nffree -= frags;
+       fs->fs_fmod++;
        cgp->cg_frsum[allocsiz]--;
        if (frags != allocsiz)
                cgp->cg_frsum[allocsiz - frags]++;
        cgp->cg_frsum[allocsiz]--;
        if (frags != allocsiz)
                cgp->cg_frsum[allocsiz - frags]++;
@@ -876,12 +878,8 @@ mapsearch(fs, cgp, bpref, allocsiz)
                start = 0;
                loc = scanc(len, &cgp->cg_free[start], fragtbl[fs->fs_frag],
                        1 << (allocsiz - 1 + (fs->fs_frag % NBBY)));
                start = 0;
                loc = scanc(len, &cgp->cg_free[start], fragtbl[fs->fs_frag],
                        1 << (allocsiz - 1 + (fs->fs_frag % NBBY)));
-               if (loc == 0) {
-                       printf("start = %d, len = %d, fs = %s\n",
-                           start, len, fs->fs_fsmnt);
-                       panic("alloccg: map corrupted");
+               if (loc == 0)
                        return (-1);
                        return (-1);
-               }
        }
        bno = (start + len - loc) * NBBY;
        cgp->cg_frotor = bno;
        }
        bno = (start + len - loc) * NBBY;
        cgp->cg_frotor = bno;
index 0284376..8f458cb 100644 (file)
@@ -1,4 +1,4 @@
-/*     ffs_subr.c      4.3     82/11/13        */
+/*     ffs_subr.c      4.4     82/12/17        */
 
 #ifdef KERNEL
 #include "../h/param.h"
 
 #ifdef KERNEL
 #include "../h/param.h"
@@ -23,7 +23,6 @@
 #include <sys/dir.h>
 #include <sys/user.h>
 #include <sys/quota.h>
 #include <sys/dir.h>
 #include <sys/user.h>
 #include <sys/quota.h>
-#include <sys/kernel.h>
 #endif
 
 #ifdef KERNEL
 #endif
 
 #ifdef KERNEL
@@ -52,7 +51,7 @@ update()
         * of each file system is still in the buffer cache.
         */
        for (mp = &mount[0]; mp < &mount[NMOUNT]; mp++) {
         * of each file system is still in the buffer cache.
         */
        for (mp = &mount[0]; mp < &mount[NMOUNT]; mp++) {
-               if (mp->m_bufp == NULL)
+               if (mp->m_bufp == NULL || mp->m_dev == NODEV)
                        continue;
                fs = mp->m_bufp->b_un.b_fs;
                if (fs->fs_fmod == 0)
                        continue;
                fs = mp->m_bufp->b_un.b_fs;
                if (fs->fs_fmod == 0)
index 3db82f5..1559a5c 100644 (file)
@@ -1,4 +1,4 @@
-/*     inode.h 4.20    82/11/13        */
+/*     inode.h 4.21    82/12/17        */
 
 /*
  * The I node is the focus of all file activity in UNIX.
 
 /*
  * The I node is the focus of all file activity in UNIX.
@@ -60,7 +60,13 @@ struct dinode {
 #define        i_nlink         i_ic.ic_nlink
 #define        i_uid           i_ic.ic_uid
 #define        i_gid           i_ic.ic_gid
 #define        i_nlink         i_ic.ic_nlink
 #define        i_uid           i_ic.ic_uid
 #define        i_gid           i_ic.ic_gid
+/* ugh! -- must be fixed */
+#ifdef vax
 #define        i_size          i_ic.ic_size.val[0]
 #define        i_size          i_ic.ic_size.val[0]
+#endif
+#ifdef sun
+#define        i_size          i_ic.ic_size.val[1]
+#endif
 #define        i_db            i_ic.ic_db
 #define        i_ib            i_ic.ic_ib
 #define        i_atime         i_ic.ic_atime
 #define        i_db            i_ic.ic_db
 #define        i_ib            i_ic.ic_ib
 #define        i_atime         i_ic.ic_atime
@@ -79,7 +85,12 @@ struct dinode {
 #define        di_nlink        di_ic.ic_nlink
 #define        di_uid          di_ic.ic_uid
 #define        di_gid          di_ic.ic_gid
 #define        di_nlink        di_ic.ic_nlink
 #define        di_uid          di_ic.ic_uid
 #define        di_gid          di_ic.ic_gid
+#ifdef vax
 #define        di_size         di_ic.ic_size.val[0]
 #define        di_size         di_ic.ic_size.val[0]
+#endif
+#ifdef sun
+#define        di_size         di_ic.ic_size.val[1]
+#endif
 #define        di_db           di_ic.ic_db
 #define        di_ib           di_ic.ic_ib
 #define        di_atime        di_ic.ic_atime
 #define        di_db           di_ic.ic_db
 #define        di_ib           di_ic.ic_ib
 #define        di_atime        di_ic.ic_atime
index 59f889a..826891f 100644 (file)
@@ -1,4 +1,4 @@
-/*     lfs_alloc.c     2.19    82/11/13        */
+/*     lfs_alloc.c     2.20    82/12/17        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -508,6 +508,7 @@ alloccg(ip, cg, bpref, size)
                cgp->cg_cs.cs_nffree += i;
                fs->fs_cstotal.cs_nffree += i;
                fs->fs_cs(fs, cg).cs_nffree += i;
                cgp->cg_cs.cs_nffree += i;
                fs->fs_cstotal.cs_nffree += i;
                fs->fs_cs(fs, cg).cs_nffree += i;
+               fs->fs_fmod++;
                cgp->cg_frsum[i]++;
                bdwrite(bp);
                return (bno);
                cgp->cg_frsum[i]++;
                bdwrite(bp);
                return (bno);
@@ -520,6 +521,7 @@ alloccg(ip, cg, bpref, size)
        cgp->cg_cs.cs_nffree -= frags;
        fs->fs_cstotal.cs_nffree -= frags;
        fs->fs_cs(fs, cg).cs_nffree -= frags;
        cgp->cg_cs.cs_nffree -= frags;
        fs->fs_cstotal.cs_nffree -= frags;
        fs->fs_cs(fs, cg).cs_nffree -= frags;
+       fs->fs_fmod++;
        cgp->cg_frsum[allocsiz]--;
        if (frags != allocsiz)
                cgp->cg_frsum[allocsiz - frags]++;
        cgp->cg_frsum[allocsiz]--;
        if (frags != allocsiz)
                cgp->cg_frsum[allocsiz - frags]++;
@@ -876,12 +878,8 @@ mapsearch(fs, cgp, bpref, allocsiz)
                start = 0;
                loc = scanc(len, &cgp->cg_free[start], fragtbl[fs->fs_frag],
                        1 << (allocsiz - 1 + (fs->fs_frag % NBBY)));
                start = 0;
                loc = scanc(len, &cgp->cg_free[start], fragtbl[fs->fs_frag],
                        1 << (allocsiz - 1 + (fs->fs_frag % NBBY)));
-               if (loc == 0) {
-                       printf("start = %d, len = %d, fs = %s\n",
-                           start, len, fs->fs_fsmnt);
-                       panic("alloccg: map corrupted");
+               if (loc == 0)
                        return (-1);
                        return (-1);
-               }
        }
        bno = (start + len - loc) * NBBY;
        cgp->cg_frotor = bno;
        }
        bno = (start + len - loc) * NBBY;
        cgp->cg_frotor = bno;
index de9b853..1f50a22 100644 (file)
@@ -1,4 +1,4 @@
-/*     dinode.h        4.20    82/11/13        */
+/*     dinode.h        4.21    82/12/17        */
 
 /*
  * The I node is the focus of all file activity in UNIX.
 
 /*
  * The I node is the focus of all file activity in UNIX.
@@ -60,7 +60,13 @@ struct dinode {
 #define        i_nlink         i_ic.ic_nlink
 #define        i_uid           i_ic.ic_uid
 #define        i_gid           i_ic.ic_gid
 #define        i_nlink         i_ic.ic_nlink
 #define        i_uid           i_ic.ic_uid
 #define        i_gid           i_ic.ic_gid
+/* ugh! -- must be fixed */
+#ifdef vax
 #define        i_size          i_ic.ic_size.val[0]
 #define        i_size          i_ic.ic_size.val[0]
+#endif
+#ifdef sun
+#define        i_size          i_ic.ic_size.val[1]
+#endif
 #define        i_db            i_ic.ic_db
 #define        i_ib            i_ic.ic_ib
 #define        i_atime         i_ic.ic_atime
 #define        i_db            i_ic.ic_db
 #define        i_ib            i_ic.ic_ib
 #define        i_atime         i_ic.ic_atime
@@ -79,7 +85,12 @@ struct dinode {
 #define        di_nlink        di_ic.ic_nlink
 #define        di_uid          di_ic.ic_uid
 #define        di_gid          di_ic.ic_gid
 #define        di_nlink        di_ic.ic_nlink
 #define        di_uid          di_ic.ic_uid
 #define        di_gid          di_ic.ic_gid
+#ifdef vax
 #define        di_size         di_ic.ic_size.val[0]
 #define        di_size         di_ic.ic_size.val[0]
+#endif
+#ifdef sun
+#define        di_size         di_ic.ic_size.val[1]
+#endif
 #define        di_db           di_ic.ic_db
 #define        di_ib           di_ic.ic_ib
 #define        di_atime        di_ic.ic_atime
 #define        di_db           di_ic.ic_db
 #define        di_ib           di_ic.ic_ib
 #define        di_atime        di_ic.ic_atime
index 3db82f5..1559a5c 100644 (file)
@@ -1,4 +1,4 @@
-/*     inode.h 4.20    82/11/13        */
+/*     inode.h 4.21    82/12/17        */
 
 /*
  * The I node is the focus of all file activity in UNIX.
 
 /*
  * The I node is the focus of all file activity in UNIX.
@@ -60,7 +60,13 @@ struct dinode {
 #define        i_nlink         i_ic.ic_nlink
 #define        i_uid           i_ic.ic_uid
 #define        i_gid           i_ic.ic_gid
 #define        i_nlink         i_ic.ic_nlink
 #define        i_uid           i_ic.ic_uid
 #define        i_gid           i_ic.ic_gid
+/* ugh! -- must be fixed */
+#ifdef vax
 #define        i_size          i_ic.ic_size.val[0]
 #define        i_size          i_ic.ic_size.val[0]
+#endif
+#ifdef sun
+#define        i_size          i_ic.ic_size.val[1]
+#endif
 #define        i_db            i_ic.ic_db
 #define        i_ib            i_ic.ic_ib
 #define        i_atime         i_ic.ic_atime
 #define        i_db            i_ic.ic_db
 #define        i_ib            i_ic.ic_ib
 #define        i_atime         i_ic.ic_atime
@@ -79,7 +85,12 @@ struct dinode {
 #define        di_nlink        di_ic.ic_nlink
 #define        di_uid          di_ic.ic_uid
 #define        di_gid          di_ic.ic_gid
 #define        di_nlink        di_ic.ic_nlink
 #define        di_uid          di_ic.ic_uid
 #define        di_gid          di_ic.ic_gid
+#ifdef vax
 #define        di_size         di_ic.ic_size.val[0]
 #define        di_size         di_ic.ic_size.val[0]
+#endif
+#ifdef sun
+#define        di_size         di_ic.ic_size.val[1]
+#endif
 #define        di_db           di_ic.ic_db
 #define        di_ib           di_ic.ic_ib
 #define        di_atime        di_ic.ic_atime
 #define        di_db           di_ic.ic_db
 #define        di_ib           di_ic.ic_ib
 #define        di_atime        di_ic.ic_atime
index 989dd44..bef1733 100644 (file)
@@ -1,4 +1,4 @@
-#      Makefile.vax    4.3     %G%
+#      Makefile.vax    4.4     %G%
 #
 # Makefile for 4.1c bsd
 #
 #
 # Makefile for 4.1c bsd
 #
@@ -47,7 +47,8 @@ lint: /tmp
            | sed 's/^  //' | sort -u > ../conf/symbols.sort
 
 locore.o: assym.s ${AHEADS} ../vax/scb.s ../vax/locore.s ubglue.s \
            | sed 's/^  //' | sort -u > ../conf/symbols.sort
 
 locore.o: assym.s ${AHEADS} ../vax/scb.s ../vax/locore.s ubglue.s \
-    ../vax/mtpr.h ../vax/trap.h ../h/psl.h ../h/pte.h ../vax/cpu.h mba.h
+    ../vax/mtpr.h ../vax/trap.h ../machine/psl.h ../machine/pte.h \
+    ../vax/cpu.h mba.h
        cat assym.s ../vax/scb.s ../vax/locore.s ubglue.s > locore.c
        cc -E -I. -DLOCORE ${COPTS} locore.c > locore.i
        @echo 'as -o locore.o $${AHEADS} locore.i'
        cat assym.s ../vax/scb.s ../vax/locore.s ubglue.s > locore.c
        cc -E -I. -DLOCORE ${COPTS} locore.c > locore.i
        @echo 'as -o locore.o $${AHEADS} locore.i'
@@ -63,9 +64,9 @@ clock.o machdep.o autoconf.o conf.o cons.o flp.o mba.o uba.o vaxcpu.o : makefile
 # depend on network configuration
 af.o : makefile
 
 # depend on network configuration
 af.o : makefile
 
-assym.s: ../h/param.h ../h/pte.h ../h/buf.h ../h/vmparam.h ../h/vmmeter.h \
-    ../h/dir.h ../h/cmap.h ../h/map.h ../vaxuba/ubavar.h ../h/proc.h \
-    ../h/msgbuf.h
+assym.s: ../h/param.h ../machine/pte.h ../h/buf.h ../h/vmparam.h \
+    ../h/vmmeter.h ../h/dir.h ../h/cmap.h ../h/map.h ../vaxuba/ubavar.h \
+    ../h/proc.h ../h/msgbuf.h
        cc ${IDENT} ../vax/genassym.c; ./a.out >assym.s; rm -f a.out
 
 ../h/param.h: /usr/include/signal.h
        cc ${IDENT} ../vax/genassym.c; ./a.out >assym.s; rm -f a.out
 
 ../h/param.h: /usr/include/signal.h
@@ -120,7 +121,7 @@ print:
        @cd ../sys; pr -f asm.sed Locore.c scb.s locore.s
        @pr -f ${CFILES}
 
        @cd ../sys; pr -f asm.sed Locore.c scb.s locore.s
        @pr -f ${CFILES}
 
-ioconf.o: ioconf.c ../h/param.h ../h/pte.h ../h/buf.h ../h/map.h \
+ioconf.o: ioconf.c ../h/param.h ../machine/pte.h ../h/buf.h ../h/map.h \
     ../vaxmba/mbavar.h ../h/vm.h ../vaxuba/ubavar.h
        ${CC} -I. -c -S ${COPTS} ioconf.c
        ${C2} ioconf.s | sed -f ../vax/asm.sed | ${AS} -o ioconf.o
     ../vaxmba/mbavar.h ../h/vm.h ../vaxuba/ubavar.h
        ${CC} -I. -c -S ${COPTS} ioconf.c
        ${C2} ioconf.s | sed -f ../vax/asm.sed | ${AS} -o ioconf.o
index 3977c41..646d36f 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_acc.c        4.31    82/11/15        */
+/*     if_acc.c        4.32    82/12/17        */
 
 #include "acc.h"
 #ifdef NACC > 0
 
 #include "acc.h"
 #ifdef NACC > 0
@@ -6,11 +6,11 @@
 /*
  * ACC LH/DH ARPAnet IMP interface driver.
  */
 /*
  * ACC LH/DH ARPAnet IMP interface driver.
  */
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
index 3d96612..5497a05 100644 (file)
@@ -1,4 +1,4 @@
-/*      if_css.c     4.5     82/10/24     */
+/*      if_css.c     4.6     82/12/17     */
 
 #include "css.h"
 
 
 #include "css.h"
 
  * If you get it wrong, it will still autoconfig, but will just
  * sit there with RECIEVE IDLE indicated on the front panel.
  */
  * If you get it wrong, it will still autoconfig, but will just
  * sit there with RECIEVE IDLE indicated on the front panel.
  */
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
index 309a339..0fe3036 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_dmc.c        4.21    82/11/13        */
+/*     if_dmc.c        4.22    82/12/17        */
 
 #include "dmc.h"
 #if NDMC > 0
 
 #include "dmc.h"
 #if NDMC > 0
@@ -10,11 +10,11 @@ int dmcdebug = 1;
  * TODO
  *     allow more than one outstanding read or write.
  */
  * TODO
  *     allow more than one outstanding read or write.
  */
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/tty.h"
 #include "../h/protosw.h"
 #include "../h/buf.h"
 #include "../h/tty.h"
 #include "../h/protosw.h"
index 82797b3..b063cd2 100644 (file)
@@ -1,15 +1,15 @@
-/*     if_ec.c 4.31    82/12/16        */
+/*     if_ec.c 4.32    82/12/17        */
 
 #include "ec.h"
 
 /*
  * 3Com Ethernet Controller interface
  */
 
 #include "ec.h"
 
 /*
  * 3Com Ethernet Controller interface
  */
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
index 5f8972e..c860a0f 100644 (file)
@@ -1,15 +1,15 @@
-/*     if_en.c 4.74    82/12/14        */
+/*     if_en.c 4.75    82/12/17        */
 
 #include "en.h"
 
 /*
  * Xerox prototype (3 Mb) Ethernet interface driver.
  */
 
 #include "en.h"
 
 /*
  * Xerox prototype (3 Mb) Ethernet interface driver.
  */
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
index bab8fc1..677401c 100644 (file)
@@ -1,14 +1,15 @@
-/*     if_il.c 4.16    82/12/16        */
+/*     if_il.c 4.17    82/12/17        */
 
 #include "il.h"
 
 /*
  * Interlan Ethernet Communications Controller interface
  */
 
 #include "il.h"
 
 /*
  * Interlan Ethernet Communications Controller interface
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
index 037c8de..e7ce8d6 100644 (file)
@@ -1,10 +1,11 @@
-/*     if_uba.c        4.15    82/12/14        */
+/*     if_uba.c        4.16    82/12/17        */
+
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
 #include "../h/map.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/cmap.h"
 #include "../h/vmmac.h"
 #include "../h/buf.h"
 #include "../h/cmap.h"
 #include "../h/vmmac.h"
index 1937a30..fcbc873 100644 (file)
@@ -1,15 +1,18 @@
-/*     if_vv.c 4.10    82/12/14        */
+/*     if_vv.c 4.11    82/12/17        */
 
 
+#include "vv.h"
+#if NVV > 0
 /*
  * Proteon 10 Meg Ring Driver.
  * This device is called "vv" because its "real name",
  * V2LNI won't work if shortened to the obvious "v2".
  * Hence the subterfuge.
  */
 /*
  * Proteon 10 Meg Ring Driver.
  * This device is called "vv" because its "real name",
  * V2LNI won't work if shortened to the obvious "v2".
  * Hence the subterfuge.
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/mbuf.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
@@ -676,3 +679,4 @@ vvprt_hex(s, l)
                );
        }
 }
                );
        }
 }
+#endif
index f2ae48d..781fe87 100644 (file)
@@ -1,4 +1,4 @@
-/*     hp.c    4.58    82/11/13        */
+/*     hp.c    4.59    82/12/17        */
 
 #ifdef HPDEBUG
 int    hpdebug;
 
 #ifdef HPDEBUG
 int    hpdebug;
@@ -18,6 +18,7 @@ int   hpbdebug;
  *     see if DCLR and/or RELEASE set attention status
  *     print bits of mr && mr2 symbolically
  */
  *     see if DCLR and/or RELEASE set attention status
  *     print bits of mr && mr2 symbolically
  */
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -27,7 +28,6 @@ int   hpbdebug;
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/map.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../vax/mtpr.h"
 #include "../h/vm.h"
 #include "../h/cmap.h"
 #include "../vax/mtpr.h"
 #include "../h/vm.h"
 #include "../h/cmap.h"
index 5d79a25..f8202fe 100644 (file)
@@ -1,4 +1,4 @@
-/*     ht.c    4.34    82/10/20        */
+/*     ht.c    4.35    82/12/17        */
 
 #include "tu.h"
 #if NHT > 0
 
 #include "tu.h"
 #if NHT > 0
@@ -11,6 +11,8 @@
  *     see how many rewind interrups we get if we kick when not at BOT
  *     fixup rle error on block tape code
  */
  *     see how many rewind interrups we get if we kick when not at BOT
  *     fixup rle error on block tape code
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
@@ -19,7 +21,6 @@
 #include "../h/file.h"
 #include "../h/user.h"
 #include "../h/map.h"
 #include "../h/file.h"
 #include "../h/user.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/ioctl.h"
 #include "../h/mtio.h"
 #include "../h/cmap.h"
 #include "../h/ioctl.h"
 #include "../h/mtio.h"
 #include "../h/cmap.h"
index 1bc3d04..812bcee 100644 (file)
@@ -1,10 +1,12 @@
-/*     mba.c   4.29    82/10/10        */
+/*     mba.c   4.30    82/12/17        */
 
 #include "mba.h"
 #if NMBA > 0
 /*
  * Massbus driver, arbitrates a massbus among attached devices.
  */
 
 #include "mba.h"
 #if NMBA > 0
 /*
  * Massbus driver, arbitrates a massbus among attached devices.
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/dk.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/dk.h"
@@ -14,7 +16,6 @@
 #include "../h/user.h"
 #include "../h/proc.h"
 #include "../h/map.h"
 #include "../h/user.h"
 #include "../h/proc.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../vax/mtpr.h"
 #include "../h/vm.h"
 
 #include "../vax/mtpr.h"
 #include "../h/vm.h"
 
index 01ca561..2ea9546 100644 (file)
@@ -1,4 +1,4 @@
-/*     mt.c    4.14    82/10/20        */
+/*     mt.c    4.15    82/12/17        */
 
 #include "mu.h"
 #if NMT > 0
 
 #include "mu.h"
 #if NMT > 0
@@ -12,6 +12,8 @@
  *     add odd byte count kludge from VMS driver
  *     write dump routine
  */
  *     add odd byte count kludge from VMS driver
  *     write dump routine
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
@@ -20,7 +22,6 @@
 #include "../h/file.h"
 #include "../h/user.h"
 #include "../h/map.h"
 #include "../h/file.h"
 #include "../h/user.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/ioctl.h"
 #include "../h/mtio.h"
 #include "../h/cmap.h"
 #include "../h/ioctl.h"
 #include "../h/mtio.h"
 #include "../h/cmap.h"
index 9a0e7d1..1c15887 100644 (file)
@@ -1,17 +1,18 @@
-/*     ad.c    4.6     82/10/17        */
+/*     ad.c    4.7     82/12/17        */
 
 #include "ad.h"
 #if NAD > 0
 /*
  * Data translation AD converter interface -- Bill Reeves
  */
 
 #include "ad.h"
 #if NAD > 0
 /*
  * Data translation AD converter interface -- Bill Reeves
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/buf.h"
 #include "../h/systm.h"
 #include "../h/map.h"
 #include "../h/param.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/buf.h"
 #include "../h/systm.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 
 #include "../vaxuba/ubareg.h"
 #include "../vaxuba/ubavar.h"
 
 #include "../vaxuba/ubareg.h"
 #include "../vaxuba/ubavar.h"
index ac88887..38c60a1 100644 (file)
@@ -1,4 +1,4 @@
-/*     ct.c    4.11    82/10/17        */
+/*     ct.c    4.12    82/12/17        */
 
 #include "ct.h"
 #if NCT > 0
 
 #include "ct.h"
 #if NCT > 0
@@ -8,11 +8,11 @@
  * BUGS:
  *     This driver hasn't been tested in 4.1bsd
  */
  * BUGS:
  *     This driver hasn't been tested in 4.1bsd
  */
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/tty.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/tty.h"
-#include "../h/pte.h"
 #include "../h/map.h"
 #include "../h/buf.h"
 #include "../h/conf.h"
 #include "../h/map.h"
 #include "../h/buf.h"
 #include "../h/conf.h"
index 97eadec..09ed837 100644 (file)
@@ -1,10 +1,12 @@
-/*     dh.c    4.55    82/12/10        */
+/*     dh.c    4.56    82/12/17        */
 
 #include "dh.h"
 #if NDH > 0
 /*
  * DH-11/DM-11 driver
  */
 
 #include "dh.h"
 #if NDH > 0
 /*
  * DH-11/DM-11 driver
  */
+#include "../machine/pte.h"
+
 #include "bk.h"
 #include "../h/param.h"
 #include "../h/conf.h"
 #include "bk.h"
 #include "../h/param.h"
 #include "../h/conf.h"
@@ -14,7 +16,6 @@
 #include "../h/ioctl.h"
 #include "../h/tty.h"
 #include "../h/map.h"
 #include "../h/ioctl.h"
 #include "../h/tty.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/vm.h"
 
 #include "../h/buf.h"
 #include "../h/vm.h"
 
index 63c7283..c66142b 100644 (file)
@@ -1,4 +1,4 @@
-/*     dmf.c   4.15    82/12/05        */
+/*     dmf.c   4.16    82/12/17        */
 
 #include "dmf.h"
 #if NDMF > 0
 
 #include "dmf.h"
 #if NDMF > 0
@@ -15,6 +15,8 @@
  *     optimize for efficient DMA and dynamically
  *       decide between silo and DMA mode
  */
  *     optimize for efficient DMA and dynamically
  *       decide between silo and DMA mode
  */
+#include "../machine/pte.h"
+
 #include "bk.h"
 #include "../h/param.h"
 #include "../h/conf.h"
 #include "bk.h"
 #include "../h/param.h"
 #include "../h/conf.h"
@@ -23,7 +25,6 @@
 #include "../h/ioctl.h"
 #include "../h/tty.h"
 #include "../h/map.h"
 #include "../h/ioctl.h"
 #include "../h/tty.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/vm.h"
 #include "../h/bk.h"
 #include "../h/buf.h"
 #include "../h/vm.h"
 #include "../h/bk.h"
index a341cbe..4e7da0e 100644 (file)
@@ -1,10 +1,11 @@
-/*     dn.c    4.14    82/12/10        */
+/*     dn.c    4.15    82/12/17        */
 
 #include "dn.h"
 #if NDN > 0
 /*
  * DN-11 ACU interface
  */
 
 #include "dn.h"
 #if NDN > 0
 /*
  * DN-11 ACU interface
  */
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -12,7 +13,6 @@
 #include "../h/user.h"
 #include "../h/buf.h"
 #include "../h/map.h"
 #include "../h/user.h"
 #include "../h/buf.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/conf.h"
 #include "../h/uio.h"
 
 #include "../h/conf.h"
 #include "../h/uio.h"
 
index 5b53354..3d76893 100644 (file)
@@ -1,4 +1,4 @@
-/*     dz.c    4.47    82/12/05        */
+/*     dz.c    4.48    82/12/17        */
 
 #include "dz.h"
 #if NDZ > 0
 
 #include "dz.h"
 #if NDZ > 0
@@ -8,6 +8,9 @@
  * This driver mimics dh.c; see it for explanation of common code.
  */
 #include "bk.h"
  * This driver mimics dh.c; see it for explanation of common code.
  */
 #include "bk.h"
+
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/ioctl.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/ioctl.h"
@@ -16,7 +19,6 @@
 #include "../h/user.h"
 #include "../h/proc.h"
 #include "../h/map.h"
 #include "../h/user.h"
 #include "../h/proc.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/vm.h"
 #include "../h/conf.h"
 #include "../h/buf.h"
 #include "../h/vm.h"
 #include "../h/conf.h"
index 64e6c6a..a76be37 100644 (file)
@@ -1,4 +1,4 @@
-/*     idc.c   4.10    82/11/26        */
+/*     idc.c   4.11    82/12/17        */
 
 #include "rb.h"
 #if NIDC > 0
 
 #include "rb.h"
 #if NIDC > 0
@@ -19,13 +19,14 @@ int *trp = idctrb;
  *     ecc
  *     dump
  */
  *     ecc
  *     dump
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
 #include "../h/conf.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
 #include "../h/conf.h"
 #include "../h/dir.h"
 #include "../h/user.h"
-#include "../h/pte.h"
 #include "../h/map.h"
 #include "../h/vm.h"
 #include "../h/dk.h"
 #include "../h/map.h"
 #include "../h/vm.h"
 #include "../h/dk.h"
index 6f19598..cb7e2f5 100644 (file)
@@ -1,4 +1,4 @@
-/*     lp.c    4.30    82/10/17        */
+/*     lp.c    4.31    82/12/17        */
 
 #include "lp.h"
 #if NLP > 0
 
 #include "lp.h"
 #if NLP > 0
@@ -8,6 +8,7 @@
  * This driver has been modified to work on printers where
  * leaving IENABLE set would cause continuous interrupts.
  */
  * This driver has been modified to work on printers where
  * leaving IENABLE set would cause continuous interrupts.
  */
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/dir.h"
 
 #include "../h/param.h"
 #include "../h/dir.h"
@@ -15,7 +16,6 @@
 #include "../h/buf.h"
 #include "../h/systm.h"
 #include "../h/map.h"
 #include "../h/buf.h"
 #include "../h/systm.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 
 #include "../vaxuba/ubavar.h"
 
 
 #include "../vaxuba/ubavar.h"
 
index 0641f10..f82539e 100644 (file)
@@ -1,4 +1,4 @@
-/*     ps.c    4.8     82/12/05        */
+/*     ps.c    4.9     82/12/17        */
 
 /*
  * Evans and Sutherland Picture System 2 driver
 
 /*
  * Evans and Sutherland Picture System 2 driver
 
 #define EXTERNAL_SYNC
 
 
 #define EXTERNAL_SYNC
 
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/ioctl.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/ioctl.h"
-#include "../h/pte.h"
 #include "../h/map.h"
 #include "../h/buf.h"
 #include "../h/conf.h"
 #include "../h/map.h"
 #include "../h/buf.h"
 #include "../h/conf.h"
index 8549fb3..7f17005 100644 (file)
@@ -1,4 +1,4 @@
-/*     rk.c    4.50    82/11/26        */
+/*     rk.c    4.51    82/12/17        */
 
 #include "rk.h"
 #if NHK > 0
 
 #include "rk.h"
 #if NHK > 0
@@ -18,13 +18,14 @@ int rkbdebug;
  * TODO:
  *     Learn why we lose an interrupt sometime when spinning drives down
  */
  * TODO:
  *     Learn why we lose an interrupt sometime when spinning drives down
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
 #include "../h/conf.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
 #include "../h/conf.h"
 #include "../h/dir.h"
 #include "../h/user.h"
-#include "../h/pte.h"
 #include "../h/map.h"
 #include "../h/vm.h"
 #include "../h/dk.h"
 #include "../h/map.h"
 #include "../h/vm.h"
 #include "../h/dk.h"
index 7d05e4f..747cafe 100644 (file)
@@ -1,4 +1,4 @@
-/*     tm.c    4.59    82/11/26        */
+/*     tm.c    4.60    82/12/17        */
 
 #include "te.h"
 #include "ts.h"
 
 #include "te.h"
 #include "ts.h"
@@ -13,6 +13,8 @@
  *     what happens if you offline tape during rewind?
  *     test using file system on tape
  */
  *     what happens if you offline tape during rewind?
  *     test using file system on tape
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
@@ -21,7 +23,6 @@
 #include "../h/user.h"
 #include "../h/file.h"
 #include "../h/map.h"
 #include "../h/user.h"
 #include "../h/file.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/vm.h"
 #include "../h/ioctl.h"
 #include "../h/mtio.h"
 #include "../h/vm.h"
 #include "../h/ioctl.h"
 #include "../h/mtio.h"
index 31b45ea..c88adca 100644 (file)
@@ -1,4 +1,4 @@
-/*     ts.c    4.36    82/11/26        */
+/*     ts.c    4.37    82/12/17        */
 
 #include "ts.h"
 #if NTS > 0
 
 #include "ts.h"
 #if NTS > 0
@@ -8,6 +8,8 @@
  * TODO:
  *     write dump code
  */
  * TODO:
  *     write dump code
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
@@ -16,7 +18,6 @@
 #include "../h/user.h"
 #include "../h/file.h"
 #include "../h/map.h"
 #include "../h/user.h"
 #include "../h/file.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/vm.h"
 #include "../h/ioctl.h"
 #include "../h/mtio.h"
 #include "../h/vm.h"
 #include "../h/ioctl.h"
 #include "../h/mtio.h"
index ff9822a..8e8ff2d 100644 (file)
@@ -1,9 +1,10 @@
-/*     uba.c   4.58    82/11/26        */
+/*     uba.c   4.59    82/12/17        */
+
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/map.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/vm.h"
 #include "../h/dir.h"
 #include "../h/buf.h"
 #include "../h/vm.h"
 #include "../h/dir.h"
index b3d7410..c567341 100644 (file)
@@ -1,4 +1,4 @@
-/*     uda.c   4.15    82/11/13        */
+/*     uda.c   4.16    82/12/17        */
 
 #include "ra.h"
 #if NUDA > 0
 
 #include "ra.h"
 #if NUDA > 0
@@ -12,6 +12,7 @@
  *     write dump code
  *     test on 750
  */
  *     write dump code
  *     test on 750
  */
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -19,7 +20,6 @@
 #include "../h/conf.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/conf.h"
 #include "../h/dir.h"
 #include "../h/user.h"
-#include "../h/pte.h"
 #include "../h/map.h"
 #include "../h/vm.h"
 #include "../h/dk.h"
 #include "../h/map.h"
 #include "../h/vm.h"
 #include "../h/dk.h"
index 0fc27aa..16f3d63 100644 (file)
@@ -1,4 +1,4 @@
-/*     up.c    4.63    82/12/08        */
+/*     up.c    4.64    82/12/17        */
 
 #include "up.h"
 #if NSC > 0
 
 #include "up.h"
 #if NSC > 0
@@ -11,6 +11,7 @@
  * TODO:
  *     Check that offset recovery code works
  */
  * TODO:
  *     Check that offset recovery code works
  */
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -21,7 +22,6 @@
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/map.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/vm.h"
 #include "../h/cmap.h"
 #include "../h/uio.h"
 #include "../h/vm.h"
 #include "../h/cmap.h"
 #include "../h/uio.h"
index 5d95d3f..b7b4606 100644 (file)
@@ -1,4 +1,4 @@
-/*     ut.c    4.24    82/12/05        */
+/*     ut.c    4.25    82/12/17        */
 
 #include "tj.h"
 #if NUT > 0
 
 #include "tj.h"
 #if NUT > 0
@@ -10,6 +10,8 @@
  *     check out attention processing
  *     try reset code and dump code
  */
  *     check out attention processing
  *     try reset code and dump code
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
@@ -18,7 +20,6 @@
 #include "../h/file.h"
 #include "../h/user.h"
 #include "../h/map.h"
 #include "../h/file.h"
 #include "../h/user.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/ioctl.h"
 #include "../h/mtio.h"
 #include "../h/cmap.h"
 #include "../h/ioctl.h"
 #include "../h/mtio.h"
 #include "../h/cmap.h"
index 65208d3..e4d1b47 100644 (file)
@@ -1,17 +1,18 @@
-/*     va.c    4.18    82/11/28        */
+/*     va.c    4.19    82/12/17        */
 
 #include "va.h"
 #if NVA > 0
 /*
  * Varian printer plotter
  */
 
 #include "va.h"
 #if NVA > 0
 /*
  * Varian printer plotter
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/buf.h"
 #include "../h/systm.h"
 #include "../h/map.h"
 #include "../h/param.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/buf.h"
 #include "../h/systm.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/vcmd.h"
 #include "../h/uio.h"
 
 #include "../h/vcmd.h"
 #include "../h/uio.h"
 
index 2968556..22ded22 100644 (file)
@@ -1,4 +1,4 @@
-/*     vp.c    4.21    82/10/17        */
+/*     vp.c    4.22    82/12/17        */
 
 #include "vp.h"
 #if NVP > 0
 
 #include "vp.h"
 #if NVP > 0
  *     Set up both print and plot interrupts to go through the same vector
  *     Give the address of the plcsr register in the config specification
  */
  *     Set up both print and plot interrupts to go through the same vector
  *     Give the address of the plcsr register in the config specification
  */
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/buf.h"
 #include "../h/systm.h"
 #include "../h/map.h"
 #include "../h/param.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/buf.h"
 #include "../h/systm.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/vcmd.h"
 #include "../h/uio.h"
 
 #include "../h/vcmd.h"
 #include "../h/uio.h"
 
index 79b3826..b36c06b 100644 (file)
@@ -1,13 +1,14 @@
-/*     Locore.c        4.22    82/11/13        */
+/*     Locore.c        4.23    82/12/17        */
 
 #include "dz.h"
 #include "mba.h"
 
 
 #include "dz.h"
 #include "mba.h"
 
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/dir.h"
 #include "../h/user.h"
-#include "../h/pte.h"
 #include "../h/vm.h"
 #include "../h/tty.h"
 #include "../h/proc.h"
 #include "../h/vm.h"
 #include "../h/tty.h"
 #include "../h/proc.h"
index f2794e1..f575ceb 100644 (file)
@@ -1,4 +1,4 @@
-/*     autoconf.c      4.44    82/10/31        */
+/*     autoconf.c      4.45    82/12/17        */
 
 /*
  * Setup the system to run on the current machine.
 
 /*
  * Setup the system to run on the current machine.
 
 #include "mba.h"
 
 
 #include "mba.h"
 
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/map.h"
 #include "../h/param.h"
 #include "../h/systm.h"
 #include "../h/map.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/dk.h"
 #include "../h/vm.h"
 #include "../h/buf.h"
 #include "../h/dk.h"
 #include "../h/vm.h"
index 9149567..ca3147e 100644 (file)
@@ -1,7 +1,8 @@
-/*     cpudata.c       4.7     82/10/13        */
+/*     cpudata.c       4.8     82/12/17        */
+
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 
 #include "../h/param.h"
-#include "../h/pte.h"
 
 #include "../vax/cpu.h"
 #include "../vax/nexus.h"
 
 #include "../vax/cpu.h"
 #include "../vax/nexus.h"
index 6b4843b..9b81df5 100644 (file)
@@ -1,8 +1,9 @@
 #define        VAX780  1
 #define        VAX750  1
 
 #define        VAX780  1
 #define        VAX750  1
 
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/param.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/vmmeter.h"
 #include "../h/vmparam.h"
 #include "../h/buf.h"
 #include "../h/vmmeter.h"
 #include "../h/vmparam.h"
index 110a1ce..61a9acc 100644 (file)
@@ -1,14 +1,15 @@
-/*     locore.s        4.74    82/12/09        */
+/*     locore.s        4.75    82/12/17        */
+
+#include "../machine/psl.h"
+#include "../machine/pte.h"
 
 #include "../vax/mtpr.h"
 #include "../vax/trap.h"
 
 #include "../vax/mtpr.h"
 #include "../vax/trap.h"
-#include "../h/psl.h"
-#include "../h/pte.h"
 #include "../vax/cpu.h"
 #include "../vax/nexus.h"
 #include "../vax/cpu.h"
 #include "../vax/nexus.h"
-#include "../vaxuba/ubareg.h"
 #include "../vax/cons.h"
 #include "../vax/clock.h"
 #include "../vax/cons.h"
 #include "../vax/clock.h"
+#include "../vaxuba/ubareg.h"
 
 #include "dz.h"
 #include "mba.h"
 
 #include "dz.h"
 #include "mba.h"
index ef5b524..6f8abd4 100644 (file)
@@ -1,4 +1,8 @@
-/*     machdep.c       4.71    82/11/13        */
+/*     machdep.c       4.72    82/12/17        */
+
+#include "../machine/reg.h"
+#include "../machine/pte.h"
+#include "../machine/psl.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -6,11 +10,8 @@
 #include "../h/user.h"
 #include "../h/kernel.h"
 #include "../h/map.h"
 #include "../h/user.h"
 #include "../h/kernel.h"
 #include "../h/map.h"
-#include "../h/reg.h"
-#include "../h/pte.h"
 #include "../h/vm.h"
 #include "../h/proc.h"
 #include "../h/vm.h"
 #include "../h/proc.h"
-#include "../h/psl.h"
 #include "../h/buf.h"
 #include "../h/reboot.h"
 #include "../h/conf.h"
 #include "../h/buf.h"
 #include "../h/reboot.h"
 #include "../h/conf.h"
index 4010e44..2e47faf 100644 (file)
@@ -1,16 +1,17 @@
-/*     mem.c   4.11    82/12/05        */
+/*     mem.c   4.12    82/12/17        */
 
 /*
  * Memory special file
  */
 
 
 /*
  * Memory special file
  */
 
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/conf.h"
 #include "../h/buf.h"
 #include "../h/systm.h"
 #include "../h/param.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/conf.h"
 #include "../h/buf.h"
 #include "../h/systm.h"
-#include "../h/pte.h"
 #include "../h/vm.h"
 #include "../h/cmap.h"
 #include "../h/uio.h"
 #include "../h/vm.h"
 #include "../h/cmap.h"
 #include "../h/uio.h"
index 3cff0c9..03ccaab 100644 (file)
@@ -1,10 +1,11 @@
-/*     swapgeneric.c   4.4     82/10/17        */
+/*     swapgeneric.c   4.5     82/12/17        */
 
 #include "mba.h"
 
 
 #include "mba.h"
 
+#include "../machine/pte.h"
+
 #include "../h/param.h"
 #include "../h/conf.h"
 #include "../h/param.h"
 #include "../h/conf.h"
-#include "../h/pte.h"
 #include "../h/buf.h"
 #include "../h/vm.h"
 #include "../h/systm.h"
 #include "../h/buf.h"
 #include "../h/vm.h"
 #include "../h/systm.h"
index 09bfff0..59c9a58 100644 (file)
@@ -1,4 +1,8 @@
-/*     trap.c  4.25    82/12/09        */
+/*     trap.c  4.26    82/12/17        */
+
+#include "../machine/psl.h"
+#include "../machine/reg.h"
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -6,11 +10,8 @@
 #include "../h/user.h"
 #include "assym.s"
 #include "../h/proc.h"
 #include "../h/user.h"
 #include "assym.s"
 #include "../h/proc.h"
-#include "../h/reg.h"
 #include "../h/seg.h"
 #include "../vax/trap.h"
 #include "../h/seg.h"
 #include "../vax/trap.h"
-#include "../h/psl.h"
-#include "../h/pte.h"
 #include "../h/acct.h"
 #include "../h/kernel.h"
 #ifdef SYSCALLTRACE
 #include "../h/acct.h"
 #include "../h/kernel.h"
 #ifdef SYSCALLTRACE
index e060cd1..4fc7755 100644 (file)
@@ -1,7 +1,8 @@
-/*     vm_machdep.c    5.2     82/11/13        */
+/*     vm_machdep.c    5.3     82/12/17        */
+
+#include "../machine/pte.h"
 
 #include "../h/param.h"
 
 #include "../h/param.h"
-#include "../h/pte.h"
 #include "../h/systm.h"
 #include "../h/dir.h"
 #include "../h/user.h"
 #include "../h/systm.h"
 #include "../h/dir.h"
 #include "../h/user.h"
@@ -169,3 +170,29 @@ putmemc(addr, val)
        mmap[0] = savemap;
        mtpr(TBIS, vmmap);
 }
        mmap[0] = savemap;
        mtpr(TBIS, vmmap);
 }
+
+/*
+ * Move pages from one kernel virtual address to another.
+ * Both addresses are assumed to reside in the Sysmap,
+ * and size must be a multiple of CLSIZE.
+ */
+pagemove(from, to, size)
+       register caddr_t from, to;
+       int size;
+{
+       register struct pte *fpte, *tpte;
+
+       if (size % CLBYTES)
+               panic("pagemove");
+       fpte = &Sysmap[btop(from - 0x80000000)];
+       tpte = &Sysmap[btop(to - 0x80000000)];
+       while (size > 0) {
+               *tpte++ = *fpte;
+               *(int *)fpte++ = 0;
+               mtpr(TBIS, from);
+               mtpr(TBIS, to);
+               from += NBPG;
+               to += NBPG;
+               size -= NBPG;
+       }
+}