From 961945a80c6f995f4567dbce8881af0bbdee211c Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Fri, 17 Dec 1982 20:17:49 -0800 Subject: [PATCH] sun merge 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 --- usr/src/sys/deprecated/netimp/if_imp.c | 5 +- usr/src/sys/kern/init_main.c | 27 +++-- usr/src/sys/kern/kern_clock.c | 26 +++-- usr/src/sys/kern/kern_descrip.c | 4 +- usr/src/sys/kern/kern_physio.c | 11 +- usr/src/sys/kern/kern_proc.c | 14 +-- usr/src/sys/kern/kern_prot.c | 5 +- usr/src/sys/kern/kern_resource.c | 4 +- usr/src/sys/kern/kern_sig.c | 9 +- usr/src/sys/kern/kern_synch.c | 9 +- usr/src/sys/kern/kern_time.c | 5 +- usr/src/sys/kern/subr_prf.c | 10 +- usr/src/sys/kern/subr_prof.c | 9 +- usr/src/sys/kern/subr_xxx.c | 5 +- usr/src/sys/kern/sys_process.c | 21 +++- usr/src/sys/kern/tty.c | 5 +- usr/src/sys/kern/tty_subr.c | 51 ++++++---- usr/src/sys/kern/uipc_mbuf.c | 15 ++- usr/src/sys/kern/vfs_bio.c | 135 +++++++++++++++++++++---- usr/src/sys/kern/vfs_cluster.c | 135 +++++++++++++++++++++---- usr/src/sys/kern/vfs_vnops.c | 5 +- usr/src/sys/netinet/in.h | 4 +- usr/src/sys/sys/buf.h | 23 ++++- usr/src/sys/sys/ioctl.h | 8 +- usr/src/sys/sys/param.h | 16 +-- usr/src/sys/sys/user.h | 14 +-- usr/src/sys/ufs/ffs/dinode.h | 13 ++- usr/src/sys/ufs/ffs/ffs_alloc.c | 10 +- usr/src/sys/ufs/ffs/ffs_subr.c | 5 +- usr/src/sys/ufs/ffs/inode.h | 13 ++- usr/src/sys/ufs/lfs/lfs_alloc.c | 10 +- usr/src/sys/ufs/ufs/dinode.h | 13 ++- usr/src/sys/ufs/ufs/inode.h | 13 ++- usr/src/sys/vax/conf/Makefile.vax | 13 +-- usr/src/sys/vax/if/if_acc.c | 4 +- usr/src/sys/vax/if/if_css.c | 4 +- usr/src/sys/vax/if/if_dmc.c | 4 +- usr/src/sys/vax/if/if_ec.c | 4 +- usr/src/sys/vax/if/if_en.c | 4 +- usr/src/sys/vax/if/if_il.c | 5 +- usr/src/sys/vax/if/if_uba.c | 5 +- usr/src/sys/vax/if/if_vv.c | 8 +- usr/src/sys/vax/mba/hp.c | 4 +- usr/src/sys/vax/mba/ht.c | 5 +- usr/src/sys/vax/mba/mba.c | 5 +- usr/src/sys/vax/mba/mt.c | 5 +- usr/src/sys/vax/uba/ad.c | 5 +- usr/src/sys/vax/uba/ct.c | 4 +- usr/src/sys/vax/uba/dh.c | 5 +- usr/src/sys/vax/uba/dmf.c | 5 +- usr/src/sys/vax/uba/dn.c | 4 +- usr/src/sys/vax/uba/dz.c | 6 +- usr/src/sys/vax/uba/idc.c | 5 +- usr/src/sys/vax/uba/lp.c | 4 +- usr/src/sys/vax/uba/ps.c | 5 +- usr/src/sys/vax/uba/rk.c | 5 +- usr/src/sys/vax/uba/tm.c | 5 +- usr/src/sys/vax/uba/ts.c | 5 +- usr/src/sys/vax/uba/uba.c | 5 +- usr/src/sys/vax/uba/uda.c | 4 +- usr/src/sys/vax/uba/up.c | 4 +- usr/src/sys/vax/uba/ut.c | 5 +- usr/src/sys/vax/uba/va.c | 5 +- usr/src/sys/vax/uba/vp.c | 5 +- usr/src/sys/vax/vax/Locore.c | 5 +- usr/src/sys/vax/vax/autoconf.c | 5 +- usr/src/sys/vax/vax/cpudata.c | 5 +- usr/src/sys/vax/vax/genassym.c | 3 +- usr/src/sys/vax/vax/locore.s | 9 +- usr/src/sys/vax/vax/machdep.c | 9 +- usr/src/sys/vax/vax/mem.c | 5 +- usr/src/sys/vax/vax/swapgeneric.c | 5 +- usr/src/sys/vax/vax/trap.c | 9 +- usr/src/sys/vax/vax/vm_machdep.c | 31 +++++- 74 files changed, 632 insertions(+), 262 deletions(-) diff --git a/usr/src/sys/deprecated/netimp/if_imp.c b/usr/src/sys/deprecated/netimp/if_imp.c index 0767502bb5..7e39b50610 100644 --- a/usr/src/sys/deprecated/netimp/if_imp.c +++ b/usr/src/sys/deprecated/netimp/if_imp.c @@ -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 @@ -8,10 +8,11 @@ * 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/pte.h" #include "../h/buf.h" #include "../h/protosw.h" #include "../h/socket.h" diff --git a/usr/src/sys/kern/init_main.c b/usr/src/sys/kern/init_main.c index 5dc0edb08c..1116446420 100644 --- a/usr/src/sys/kern/init_main.c +++ b/usr/src/sys/kern/init_main.c @@ -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" @@ -13,7 +15,6 @@ #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" @@ -23,6 +24,11 @@ #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. @@ -77,7 +83,7 @@ main(regs) setredzone(p->p_addr, (caddr_t)&u); u.u_procp = p; #ifdef sun - u.u_ar0 = ®s.r0; + u.u_ar0 = ®s.r_r0; #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); + /*NOTREACHED*/ #else pageout(); /*NOTREACHED*/ @@ -204,6 +211,7 @@ main(regs) * 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); @@ -212,6 +220,7 @@ main(regs) * code just copied out. */ return; +#endif } #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 = &bfreelist[BQ_AGE]; 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_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); } diff --git a/usr/src/sys/kern/kern_clock.c b/usr/src/sys/kern/kern_clock.c index 6b3ca91ffd..67698724d1 100644 --- a/usr/src/sys/kern/kern_clock.c +++ b/usr/src/sys/kern/kern_clock.c @@ -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" @@ -8,17 +11,18 @@ #include "../h/user.h" #include "../h/kernel.h" #include "../h/proc.h" -#include "../h/psl.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 vax +#include "../vax/mtpr.h" +#endif + +# /* * Clock handling routines. * @@ -72,6 +76,10 @@ hardclock(regs) register struct proc *p; register int s, cpstate; +#ifdef sun + if (USERMODE(ps)) /* aston needs ar0 */ + u.u_ar0 = ®s.r_r0; +#endif /* * 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 -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 (;;) { diff --git a/usr/src/sys/kern/kern_descrip.c b/usr/src/sys/kern/kern_descrip.c index 4a39ae8b46..469198c0fa 100644 --- a/usr/src/sys/kern/kern_descrip.c +++ b/usr/src/sys/kern/kern_descrip.c @@ -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" @@ -102,10 +102,8 @@ dup2() 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); -#endif closef(u.u_ofile[uap->j], 0, u.u_pofile[uap->j]); if (u.u_error) return; diff --git a/usr/src/sys/kern/kern_physio.c b/usr/src/sys/kern/kern_physio.c index 728f0125c3..7375a2a00d 100644 --- a/usr/src/sys/kern/kern_physio.c +++ b/usr/src/sys/kern/kern_physio.c @@ -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" @@ -8,7 +10,6 @@ #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" @@ -211,12 +212,14 @@ nextiov: 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); - if (error) + /* temp kludge for tape drives */ + if (bp->b_resid || error) return (error); uio->uio_iov++; uio->uio_iovcnt--; diff --git a/usr/src/sys/kern/kern_proc.c b/usr/src/sys/kern/kern_proc.c index 27d5814608..65efbf7357 100644 --- a/usr/src/sys/kern/kern_proc.c +++ b/usr/src/sys/kern/kern_proc.c @@ -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" @@ -8,15 +12,12 @@ #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 -#include "../h/pte.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" @@ -141,6 +142,7 @@ execve() * 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) @@ -504,9 +506,7 @@ setregs() u.u_ofile[i] = NULL; u.u_pofile[i] = 0; } -#ifdef SUNMMAP u.u_pofile[i] &= ~UF_MAPPED; -#endif } /* @@ -674,7 +674,7 @@ panic("exit: m_getclr"); swtch(); } -#include +#include "../h/vtimes.h" owait() { diff --git a/usr/src/sys/kern/kern_prot.c b/usr/src/sys/kern/kern_prot.c index 858462c16c..c5b04c340f 100644 --- a/usr/src/sys/kern/kern_prot.c +++ b/usr/src/sys/kern/kern_prot.c @@ -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 */ +#include "../machine/reg.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" diff --git a/usr/src/sys/kern/kern_resource.c b/usr/src/sys/kern/kern_resource.c index 94901d0d26..9f748f25c2 100644 --- a/usr/src/sys/kern/kern_resource.c +++ b/usr/src/sys/kern/kern_resource.c @@ -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" @@ -279,7 +279,7 @@ scale60(tvp) return (tvp->tv_sec * 60 + tvp->tv_usec / 16667); } -#include +#include "../h/vtimes.h" ovtimes() { diff --git a/usr/src/sys/kern/kern_sig.c b/usr/src/sys/kern/kern_sig.c index 2da158a2ed..d9f91b4855 100644 --- a/usr/src/sys/kern/kern_sig.c +++ b/usr/src/sys/kern/kern_sig.c @@ -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/reg.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/pte.h" -#include "../h/psl.h" #include "../h/vm.h" #include "../h/acct.h" #include "../h/uio.h" diff --git a/usr/src/sys/kern/kern_synch.c b/usr/src/sys/kern/kern_synch.c index 3316273882..18438635cd 100644 --- a/usr/src/sys/kern/kern_synch.c +++ b/usr/src/sys/kern/kern_synch.c @@ -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" @@ -8,15 +10,16 @@ #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" -#include "../vax/mtpr.h" /* XXX */ +#ifdef vax +#include "../vax/mtpr.h" /* XXX */ +#endif /* * Force switch among equal priority processes every 100ms. */ diff --git a/usr/src/sys/kern/kern_time.c b/usr/src/sys/kern/kern_time.c index 731e22092f..b7710b5837 100644 --- a/usr/src/sys/kern/kern_time.c +++ b/usr/src/sys/kern/kern_time.c @@ -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/reg.h" #include "../h/inode.h" #include "../h/proc.h" diff --git a/usr/src/sys/kern/subr_prf.c b/usr/src/sys/kern/subr_prf.c index eddf715964..303db7655c 100644 --- a/usr/src/sys/kern/subr_prf.c +++ b/usr/src/sys/kern/subr_prf.c @@ -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" @@ -10,6 +10,7 @@ #include "../h/msgbuf.h" #include "../h/dir.h" #include "../h/user.h" +#include "../h/proc.h" #include "../h/tty.h" /* @@ -176,13 +177,14 @@ panic(s) if (panicstr) bootopt |= RB_NOSYNC; -#ifdef sun else { + panicstr = s; +#ifdef sun asm("movl a6, a5"); traceback(a5, a5); - } + resume(pcbb(u.u_procp)); /* for adb traceback */ #endif - panicstr = s; + } printf("panic: %s\n", s); boot(RB_PANIC, bootopt); } diff --git a/usr/src/sys/kern/subr_prof.c b/usr/src/sys/kern/subr_prof.c index def3affa33..a8a5f059bf 100644 --- a/usr/src/sys/kern/subr_prof.c +++ b/usr/src/sys/kern/subr_prof.c @@ -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" @@ -12,7 +12,12 @@ int profiling = 3; u_short *froms = 0; struct tostruct *tos = 0; u_short tolimit = 0; +#ifdef vax 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; @@ -69,6 +74,7 @@ kmstartup() #endif } +#ifdef vax /* * This routine is massaged so that it may be jsb'ed to */ @@ -154,4 +160,5 @@ overflow: printf("mcount: tos overflow\n"); goto out; } +#endif #endif GPROF diff --git a/usr/src/sys/kern/subr_xxx.c b/usr/src/sys/kern/subr_xxx.c index b1ccbf01b2..86efb60103 100644 --- a/usr/src/sys/kern/subr_xxx.c +++ b/usr/src/sys/kern/subr_xxx.c @@ -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" @@ -10,7 +12,6 @@ #include "../h/proc.h" #include "../h/fs.h" #include "../h/vm.h" -#include "../h/pte.h" #include "../h/cmap.h" #include "../h/uio.h" diff --git a/usr/src/sys/kern/sys_process.c b/usr/src/sys/kern/sys_process.c index 3081c26a7f..b688b20544 100644 --- a/usr/src/sys/kern/sys_process.c +++ b/usr/src/sys/kern/sys_process.c @@ -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" @@ -6,11 +10,8 @@ #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/pte.h" -#include "../h/psl.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; +#ifdef sun + if (ipc.ip_data & PSL_T) + traceon(); + else + traceoff(); +#endif 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 (i == 9) + if (i == 9) +#ifdef sun + traceon(); +#else u.u_ar0[PS] |= PSL_T; +#endif wakeup((caddr_t)&ipc); return (1); diff --git a/usr/src/sys/kern/tty.c b/usr/src/sys/kern/tty.c index 2650da8e98..e543be4c75 100644 --- a/usr/src/sys/kern/tty.c +++ b/usr/src/sys/kern/tty.c @@ -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" @@ -9,7 +11,6 @@ #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" diff --git a/usr/src/sys/kern/tty_subr.c b/usr/src/sys/kern/tty_subr.c index 5a4b3ae9a5..bf2fed75aa 100644 --- a/usr/src/sys/kern/tty_subr.c +++ b/usr/src/sys/kern/tty_subr.c @@ -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" @@ -54,14 +54,13 @@ register struct clist *p; return(c); } -#if notdef /* * 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; @@ -110,7 +109,6 @@ register char *cp; splx(s); return(cp-acp); } -#endif /* * Return count of contiguous characters @@ -118,10 +116,10 @@ register char *cp; * 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) { @@ -382,36 +380,47 @@ struct clist *from, *to; (void) putc(c, to); } -#include "dmc.h" -#ifdef NDMC > 0 /* - * integer (2-byte) get/put + * Integer (short) get/put * 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; { - 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; + register int i; + union chword x; 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); - return(0); + return (0); } -#endif diff --git a/usr/src/sys/kern/uipc_mbuf.c b/usr/src/sys/kern/uipc_mbuf.c index a42f5eb176..d7b1ffe286 100644 --- a/usr/src/sys/kern/uipc_mbuf.c +++ b/usr/src/sys/kern/uipc_mbuf.c @@ -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/pte.h" #include "../h/cmap.h" #include "../h/map.h" #include "../h/mbuf.h" @@ -14,9 +15,9 @@ mbinit() { - if (m_clalloc(4, MPG_MBUFS) == 0) + if (m_clalloc(4096/CLBYTES, MPG_MBUFS) == 0) goto bad; - if (m_clalloc(32, MPG_CLUSTERS) == 0) + if (m_clalloc(8*4096/CLBYTES, MPG_CLUSTERS) == 0) goto bad; return; bad: @@ -40,8 +41,12 @@ m_clalloc(ncl, how) 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); + } vmaccess(&Mbmap[mbx], (caddr_t)m, npg); switch (how) { diff --git a/usr/src/sys/kern/vfs_bio.c b/usr/src/sys/kern/vfs_bio.c index b67611b212..7a2ec0928d 100644 --- a/usr/src/sys/kern/vfs_bio.c +++ b/usr/src/sys/kern/vfs_bio.c @@ -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" @@ -8,7 +10,6 @@ #include "../h/conf.h" #include "../h/proc.h" #include "../h/seg.h" -#include "../h/pte.h" #include "../h/vm.h" #include "../h/trace.h" @@ -269,7 +270,7 @@ getblk(dev, blkno, size) 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 @@ -336,6 +337,7 @@ loop: /* * Allocate space associated with a buffer. + * If can't get space, buffer is released */ brealloc(bp, size) register struct buf *bp; @@ -359,14 +361,11 @@ brealloc(bp, size) } if (bp->b_flags & B_LOCKED) panic("brealloc"); - allocbuf(bp, size); - return (1); + return (allocbuf(bp, size)); } 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 @@ -403,12 +402,12 @@ loop: 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. + * If no memory is available, release buffer and take error exit */ allocbuf(tp, size) register struct buf *tp; @@ -416,13 +415,22 @@ allocbuf(tp, size) { register struct buf *bp, *ep; int sizealloc, take; +#ifdef sun + register char *a; + int osize; +#endif +#ifndef sun sizealloc = roundup(size, CLBYTES); +#else + sizealloc = roundup(size, BUFALLOCSIZE); +#endif /* * 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 @@ -469,8 +477,52 @@ allocbuf(tp, size) } 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; + return (1); } /* @@ -479,15 +531,55 @@ out: 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; } +#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. @@ -501,7 +593,11 @@ getnewbuf() loop: s = spl6(); +#ifndef sun 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 */ @@ -569,6 +665,11 @@ biodone(bp) 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 { diff --git a/usr/src/sys/kern/vfs_cluster.c b/usr/src/sys/kern/vfs_cluster.c index 8b3282db19..b15092b717 100644 --- a/usr/src/sys/kern/vfs_cluster.c +++ b/usr/src/sys/kern/vfs_cluster.c @@ -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" @@ -8,7 +10,6 @@ #include "../h/conf.h" #include "../h/proc.h" #include "../h/seg.h" -#include "../h/pte.h" #include "../h/vm.h" #include "../h/trace.h" @@ -269,7 +270,7 @@ getblk(dev, blkno, size) 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 @@ -336,6 +337,7 @@ loop: /* * Allocate space associated with a buffer. + * If can't get space, buffer is released */ brealloc(bp, size) register struct buf *bp; @@ -359,14 +361,11 @@ brealloc(bp, size) } if (bp->b_flags & B_LOCKED) panic("brealloc"); - allocbuf(bp, size); - return (1); + return (allocbuf(bp, size)); } 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 @@ -403,12 +402,12 @@ loop: 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. + * If no memory is available, release buffer and take error exit */ allocbuf(tp, size) register struct buf *tp; @@ -416,13 +415,22 @@ allocbuf(tp, size) { register struct buf *bp, *ep; int sizealloc, take; +#ifdef sun + register char *a; + int osize; +#endif +#ifndef sun sizealloc = roundup(size, CLBYTES); +#else + sizealloc = roundup(size, BUFALLOCSIZE); +#endif /* * 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 @@ -469,8 +477,52 @@ allocbuf(tp, size) } 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; + return (1); } /* @@ -479,15 +531,55 @@ out: 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; } +#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. @@ -501,7 +593,11 @@ getnewbuf() loop: s = spl6(); +#ifndef sun 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 */ @@ -569,6 +665,11 @@ biodone(bp) 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 { diff --git a/usr/src/sys/kern/vfs_vnops.c b/usr/src/sys/kern/vfs_vnops.c index ec06aa8906..b306c61283 100644 --- a/usr/src/sys/kern/vfs_vnops.c +++ b/usr/src/sys/kern/vfs_vnops.c @@ -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" @@ -8,7 +10,6 @@ #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" diff --git a/usr/src/sys/netinet/in.h b/usr/src/sys/netinet/in.h index 6f11375308..10a7d7797b 100644 --- a/usr/src/sys/netinet/in.h +++ b/usr/src/sys/netinet/in.h @@ -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, @@ -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 */ -#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 */ -#endif }; /* diff --git a/usr/src/sys/sys/buf.h b/usr/src/sys/sys/buf.h index 266350a43a..904e1c1921 100644 --- a/usr/src/sys/sys/buf.h +++ b/usr/src/sys/sys/buf.h @@ -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 @@ -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 */ + int (*b_iodone)(); /* function called by iodone */ }; #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_CALL 0x200000 /* call b_iodone from iodone */ /* * 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; \ } + +#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 diff --git a/usr/src/sys/sys/ioctl.h b/usr/src/sys/sys/ioctl.h index 970bc313cc..bb6de90495 100644 --- a/usr/src/sys/sys/ioctl.h +++ b/usr/src/sys/sys/ioctl.h @@ -1,4 +1,4 @@ -/* ioctl.h 4.25 82/12/13 */ +/* ioctl.h 4.26 82/12/17 */ /* * 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 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 diff --git a/usr/src/sys/sys/param.h b/usr/src/sys/sys/param.h index 3c6f0e95ac..2f6795b483 100644 --- a/usr/src/sys/sys/param.h +++ b/usr/src/sys/sys/param.h @@ -1,13 +1,12 @@ -/* param.h 4.25 82/10/31 */ +/* param.h 4.26 82/12/17 */ /* * 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 #endif #define NPTEPG (NBPG/(sizeof (struct pte))) @@ -165,8 +164,3 @@ */ #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); } diff --git a/usr/src/sys/sys/user.h b/usr/src/sys/sys/user.h index a1b6fde478..d8d1ed183f 100644 --- a/usr/src/sys/sys/user.h +++ b/usr/src/sys/sys/user.h @@ -1,12 +1,12 @@ -/* user.h 4.23 82/12/09 */ +/* user.h 4.24 82/12/17 */ -#ifdef vax -#include -#endif -#ifdef sun -#include -#endif +#ifdef KERNEL +#include "../machine/pcb.h" +#include "../h/dmap.h" +#else +#include #include +#endif #include #include /* diff --git a/usr/src/sys/ufs/ffs/dinode.h b/usr/src/sys/ufs/ffs/dinode.h index de9b8536c9..1f50a22767 100644 --- a/usr/src/sys/ufs/ffs/dinode.h +++ b/usr/src/sys/ufs/ffs/dinode.h @@ -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. @@ -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 +/* ugh! -- must be fixed */ +#ifdef vax #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 @@ -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 +#ifdef vax #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 diff --git a/usr/src/sys/ufs/ffs/ffs_alloc.c b/usr/src/sys/ufs/ffs/ffs_alloc.c index 3bbefd19da..e5a86e1bdc 100644 --- a/usr/src/sys/ufs/ffs/ffs_alloc.c +++ b/usr/src/sys/ufs/ffs/ffs_alloc.c @@ -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" @@ -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; + fs->fs_fmod++; 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; + fs->fs_fmod++; 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))); - 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); - } } bno = (start + len - loc) * NBBY; cgp->cg_frotor = bno; diff --git a/usr/src/sys/ufs/ffs/ffs_subr.c b/usr/src/sys/ufs/ffs/ffs_subr.c index 0284376f1e..8f458cb31f 100644 --- a/usr/src/sys/ufs/ffs/ffs_subr.c +++ b/usr/src/sys/ufs/ffs/ffs_subr.c @@ -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" @@ -23,7 +23,6 @@ #include #include #include -#include #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++) { - 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) diff --git a/usr/src/sys/ufs/ffs/inode.h b/usr/src/sys/ufs/ffs/inode.h index 3db82f5dfa..1559a5ce62 100644 --- a/usr/src/sys/ufs/ffs/inode.h +++ b/usr/src/sys/ufs/ffs/inode.h @@ -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. @@ -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 +/* ugh! -- must be fixed */ +#ifdef vax #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 @@ -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 +#ifdef vax #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 diff --git a/usr/src/sys/ufs/lfs/lfs_alloc.c b/usr/src/sys/ufs/lfs/lfs_alloc.c index 59f889a4e6..826891f775 100644 --- a/usr/src/sys/ufs/lfs/lfs_alloc.c +++ b/usr/src/sys/ufs/lfs/lfs_alloc.c @@ -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" @@ -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; + fs->fs_fmod++; 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; + fs->fs_fmod++; 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))); - 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); - } } bno = (start + len - loc) * NBBY; cgp->cg_frotor = bno; diff --git a/usr/src/sys/ufs/ufs/dinode.h b/usr/src/sys/ufs/ufs/dinode.h index de9b8536c9..1f50a22767 100644 --- a/usr/src/sys/ufs/ufs/dinode.h +++ b/usr/src/sys/ufs/ufs/dinode.h @@ -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. @@ -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 +/* ugh! -- must be fixed */ +#ifdef vax #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 @@ -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 +#ifdef vax #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 diff --git a/usr/src/sys/ufs/ufs/inode.h b/usr/src/sys/ufs/ufs/inode.h index 3db82f5dfa..1559a5ce62 100644 --- a/usr/src/sys/ufs/ufs/inode.h +++ b/usr/src/sys/ufs/ufs/inode.h @@ -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. @@ -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 +/* ugh! -- must be fixed */ +#ifdef vax #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 @@ -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 +#ifdef vax #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 diff --git a/usr/src/sys/vax/conf/Makefile.vax b/usr/src/sys/vax/conf/Makefile.vax index 989dd44ebd..bef17339a5 100644 --- a/usr/src/sys/vax/conf/Makefile.vax +++ b/usr/src/sys/vax/conf/Makefile.vax @@ -1,4 +1,4 @@ -# Makefile.vax 4.3 %G% +# Makefile.vax 4.4 %G% # # 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 \ - ../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' @@ -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 -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 @@ -120,7 +121,7 @@ print: @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 diff --git a/usr/src/sys/vax/if/if_acc.c b/usr/src/sys/vax/if/if_acc.c index 3977c41600..646d36fa6a 100644 --- a/usr/src/sys/vax/if/if_acc.c +++ b/usr/src/sys/vax/if/if_acc.c @@ -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 @@ -6,11 +6,11 @@ /* * 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/pte.h" #include "../h/buf.h" #include "../h/protosw.h" #include "../h/socket.h" diff --git a/usr/src/sys/vax/if/if_css.c b/usr/src/sys/vax/if/if_css.c index 3d96612a4b..5497a05232 100644 --- a/usr/src/sys/vax/if/if_css.c +++ b/usr/src/sys/vax/if/if_css.c @@ -1,4 +1,4 @@ -/* if_css.c 4.5 82/10/24 */ +/* if_css.c 4.6 82/12/17 */ #include "css.h" @@ -26,11 +26,11 @@ * 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/pte.h" #include "../h/buf.h" #include "../h/protosw.h" #include "../h/socket.h" diff --git a/usr/src/sys/vax/if/if_dmc.c b/usr/src/sys/vax/if/if_dmc.c index 309a339bb6..0fe30363ca 100644 --- a/usr/src/sys/vax/if/if_dmc.c +++ b/usr/src/sys/vax/if/if_dmc.c @@ -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 @@ -10,11 +10,11 @@ int dmcdebug = 1; * 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/pte.h" #include "../h/buf.h" #include "../h/tty.h" #include "../h/protosw.h" diff --git a/usr/src/sys/vax/if/if_ec.c b/usr/src/sys/vax/if/if_ec.c index 82797b3c49..b063cd2ff5 100644 --- a/usr/src/sys/vax/if/if_ec.c +++ b/usr/src/sys/vax/if/if_ec.c @@ -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 "../machine/pte.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" diff --git a/usr/src/sys/vax/if/if_en.c b/usr/src/sys/vax/if/if_en.c index 5f8972e5a4..c860a0fa53 100644 --- a/usr/src/sys/vax/if/if_en.c +++ b/usr/src/sys/vax/if/if_en.c @@ -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 "../machine/pte.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" diff --git a/usr/src/sys/vax/if/if_il.c b/usr/src/sys/vax/if/if_il.c index bab8fc1da0..677401c58f 100644 --- a/usr/src/sys/vax/if/if_il.c +++ b/usr/src/sys/vax/if/if_il.c @@ -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 "../machine/pte.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" diff --git a/usr/src/sys/vax/if/if_uba.c b/usr/src/sys/vax/if/if_uba.c index 037c8de203..e7ce8d67a7 100644 --- a/usr/src/sys/vax/if/if_uba.c +++ b/usr/src/sys/vax/if/if_uba.c @@ -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/pte.h" #include "../h/buf.h" #include "../h/cmap.h" #include "../h/vmmac.h" diff --git a/usr/src/sys/vax/if/if_vv.c b/usr/src/sys/vax/if/if_vv.c index 1937a309bf..fcbc873416 100644 --- a/usr/src/sys/vax/if/if_vv.c +++ b/usr/src/sys/vax/if/if_vv.c @@ -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. */ +#include "../machine/pte.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" @@ -676,3 +679,4 @@ vvprt_hex(s, l) ); } } +#endif diff --git a/usr/src/sys/vax/mba/hp.c b/usr/src/sys/vax/mba/hp.c index f2ae48d244..781fe87a44 100644 --- a/usr/src/sys/vax/mba/hp.c +++ b/usr/src/sys/vax/mba/hp.c @@ -1,4 +1,4 @@ -/* hp.c 4.58 82/11/13 */ +/* hp.c 4.59 82/12/17 */ #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 */ +#include "../machine/pte.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/pte.h" #include "../vax/mtpr.h" #include "../h/vm.h" #include "../h/cmap.h" diff --git a/usr/src/sys/vax/mba/ht.c b/usr/src/sys/vax/mba/ht.c index 5d79a25f6f..f8202fe371 100644 --- a/usr/src/sys/vax/mba/ht.c +++ b/usr/src/sys/vax/mba/ht.c @@ -1,4 +1,4 @@ -/* ht.c 4.34 82/10/20 */ +/* ht.c 4.35 82/12/17 */ #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 */ +#include "../machine/pte.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/pte.h" #include "../h/ioctl.h" #include "../h/mtio.h" #include "../h/cmap.h" diff --git a/usr/src/sys/vax/mba/mba.c b/usr/src/sys/vax/mba/mba.c index 1bc3d049b8..812bceec9f 100644 --- a/usr/src/sys/vax/mba/mba.c +++ b/usr/src/sys/vax/mba/mba.c @@ -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 "../machine/pte.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/pte.h" #include "../vax/mtpr.h" #include "../h/vm.h" diff --git a/usr/src/sys/vax/mba/mt.c b/usr/src/sys/vax/mba/mt.c index 01ca5615fc..2ea9546145 100644 --- a/usr/src/sys/vax/mba/mt.c +++ b/usr/src/sys/vax/mba/mt.c @@ -1,4 +1,4 @@ -/* mt.c 4.14 82/10/20 */ +/* mt.c 4.15 82/12/17 */ #include "mu.h" #if NMT > 0 @@ -12,6 +12,8 @@ * 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" @@ -20,7 +22,6 @@ #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" diff --git a/usr/src/sys/vax/uba/ad.c b/usr/src/sys/vax/uba/ad.c index 9a0e7d1dea..1c158874ed 100644 --- a/usr/src/sys/vax/uba/ad.c +++ b/usr/src/sys/vax/uba/ad.c @@ -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 "../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/pte.h" #include "../vaxuba/ubareg.h" #include "../vaxuba/ubavar.h" diff --git a/usr/src/sys/vax/uba/ct.c b/usr/src/sys/vax/uba/ct.c index ac88887cdb..38c60a1fe3 100644 --- a/usr/src/sys/vax/uba/ct.c +++ b/usr/src/sys/vax/uba/ct.c @@ -1,4 +1,4 @@ -/* ct.c 4.11 82/10/17 */ +/* ct.c 4.12 82/12/17 */ #include "ct.h" #if NCT > 0 @@ -8,11 +8,11 @@ * 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/pte.h" #include "../h/map.h" #include "../h/buf.h" #include "../h/conf.h" diff --git a/usr/src/sys/vax/uba/dh.c b/usr/src/sys/vax/uba/dh.c index 97eadec860..09ed837717 100644 --- a/usr/src/sys/vax/uba/dh.c +++ b/usr/src/sys/vax/uba/dh.c @@ -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 "../machine/pte.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/pte.h" #include "../h/buf.h" #include "../h/vm.h" diff --git a/usr/src/sys/vax/uba/dmf.c b/usr/src/sys/vax/uba/dmf.c index 63c728395d..c66142b613 100644 --- a/usr/src/sys/vax/uba/dmf.c +++ b/usr/src/sys/vax/uba/dmf.c @@ -1,4 +1,4 @@ -/* dmf.c 4.15 82/12/05 */ +/* dmf.c 4.16 82/12/17 */ #include "dmf.h" #if NDMF > 0 @@ -15,6 +15,8 @@ * 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" @@ -23,7 +25,6 @@ #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" diff --git a/usr/src/sys/vax/uba/dn.c b/usr/src/sys/vax/uba/dn.c index a341cbeb08..4e7da0eee8 100644 --- a/usr/src/sys/vax/uba/dn.c +++ b/usr/src/sys/vax/uba/dn.c @@ -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 "../machine/pte.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/pte.h" #include "../h/conf.h" #include "../h/uio.h" diff --git a/usr/src/sys/vax/uba/dz.c b/usr/src/sys/vax/uba/dz.c index 5b533543bb..3d768932fb 100644 --- a/usr/src/sys/vax/uba/dz.c +++ b/usr/src/sys/vax/uba/dz.c @@ -1,4 +1,4 @@ -/* dz.c 4.47 82/12/05 */ +/* dz.c 4.48 82/12/17 */ #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" + +#include "../machine/pte.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/pte.h" #include "../h/buf.h" #include "../h/vm.h" #include "../h/conf.h" diff --git a/usr/src/sys/vax/uba/idc.c b/usr/src/sys/vax/uba/idc.c index 64e6c6a4a4..a76be37b07 100644 --- a/usr/src/sys/vax/uba/idc.c +++ b/usr/src/sys/vax/uba/idc.c @@ -1,4 +1,4 @@ -/* idc.c 4.10 82/11/26 */ +/* idc.c 4.11 82/12/17 */ #include "rb.h" #if NIDC > 0 @@ -19,13 +19,14 @@ int *trp = idctrb; * 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/pte.h" #include "../h/map.h" #include "../h/vm.h" #include "../h/dk.h" diff --git a/usr/src/sys/vax/uba/lp.c b/usr/src/sys/vax/uba/lp.c index 6f1959897c..cb7e2f58fe 100644 --- a/usr/src/sys/vax/uba/lp.c +++ b/usr/src/sys/vax/uba/lp.c @@ -1,4 +1,4 @@ -/* lp.c 4.30 82/10/17 */ +/* lp.c 4.31 82/12/17 */ #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. */ +#include "../machine/pte.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/pte.h" #include "../vaxuba/ubavar.h" diff --git a/usr/src/sys/vax/uba/ps.c b/usr/src/sys/vax/uba/ps.c index 0641f10206..f82539e203 100644 --- a/usr/src/sys/vax/uba/ps.c +++ b/usr/src/sys/vax/uba/ps.c @@ -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 @@ -14,10 +14,11 @@ #define EXTERNAL_SYNC +#include "../machine/pte.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" diff --git a/usr/src/sys/vax/uba/rk.c b/usr/src/sys/vax/uba/rk.c index 8549fb36ab..7f170057ba 100644 --- a/usr/src/sys/vax/uba/rk.c +++ b/usr/src/sys/vax/uba/rk.c @@ -1,4 +1,4 @@ -/* rk.c 4.50 82/11/26 */ +/* rk.c 4.51 82/12/17 */ #include "rk.h" #if NHK > 0 @@ -18,13 +18,14 @@ int rkbdebug; * 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/pte.h" #include "../h/map.h" #include "../h/vm.h" #include "../h/dk.h" diff --git a/usr/src/sys/vax/uba/tm.c b/usr/src/sys/vax/uba/tm.c index 7d05e4fe7e..747cafe3cc 100644 --- a/usr/src/sys/vax/uba/tm.c +++ b/usr/src/sys/vax/uba/tm.c @@ -1,4 +1,4 @@ -/* tm.c 4.59 82/11/26 */ +/* tm.c 4.60 82/12/17 */ #include "te.h" #include "ts.h" @@ -13,6 +13,8 @@ * 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" @@ -21,7 +23,6 @@ #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" diff --git a/usr/src/sys/vax/uba/ts.c b/usr/src/sys/vax/uba/ts.c index 31b45eabda..c88adca9e7 100644 --- a/usr/src/sys/vax/uba/ts.c +++ b/usr/src/sys/vax/uba/ts.c @@ -1,4 +1,4 @@ -/* ts.c 4.36 82/11/26 */ +/* ts.c 4.37 82/12/17 */ #include "ts.h" #if NTS > 0 @@ -8,6 +8,8 @@ * TODO: * write dump code */ +#include "../machine/pte.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/pte.h" #include "../h/vm.h" #include "../h/ioctl.h" #include "../h/mtio.h" diff --git a/usr/src/sys/vax/uba/uba.c b/usr/src/sys/vax/uba/uba.c index ff9822a19c..8e8ff2d590 100644 --- a/usr/src/sys/vax/uba/uba.c +++ b/usr/src/sys/vax/uba/uba.c @@ -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/pte.h" #include "../h/buf.h" #include "../h/vm.h" #include "../h/dir.h" diff --git a/usr/src/sys/vax/uba/uda.c b/usr/src/sys/vax/uba/uda.c index b3d7410d8f..c5673410e6 100644 --- a/usr/src/sys/vax/uba/uda.c +++ b/usr/src/sys/vax/uba/uda.c @@ -1,4 +1,4 @@ -/* uda.c 4.15 82/11/13 */ +/* uda.c 4.16 82/12/17 */ #include "ra.h" #if NUDA > 0 @@ -12,6 +12,7 @@ * write dump code * test on 750 */ +#include "../machine/pte.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/pte.h" #include "../h/map.h" #include "../h/vm.h" #include "../h/dk.h" diff --git a/usr/src/sys/vax/uba/up.c b/usr/src/sys/vax/uba/up.c index 0fc27aaea1..16f3d63a8d 100644 --- a/usr/src/sys/vax/uba/up.c +++ b/usr/src/sys/vax/uba/up.c @@ -1,4 +1,4 @@ -/* up.c 4.63 82/12/08 */ +/* up.c 4.64 82/12/17 */ #include "up.h" #if NSC > 0 @@ -11,6 +11,7 @@ * TODO: * Check that offset recovery code works */ +#include "../machine/pte.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/pte.h" #include "../h/vm.h" #include "../h/cmap.h" #include "../h/uio.h" diff --git a/usr/src/sys/vax/uba/ut.c b/usr/src/sys/vax/uba/ut.c index 5d95d3f9de..b7b4606683 100644 --- a/usr/src/sys/vax/uba/ut.c +++ b/usr/src/sys/vax/uba/ut.c @@ -1,4 +1,4 @@ -/* ut.c 4.24 82/12/05 */ +/* ut.c 4.25 82/12/17 */ #include "tj.h" #if NUT > 0 @@ -10,6 +10,8 @@ * 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" @@ -18,7 +20,6 @@ #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" diff --git a/usr/src/sys/vax/uba/va.c b/usr/src/sys/vax/uba/va.c index 65208d34c3..e4d1b47a0c 100644 --- a/usr/src/sys/vax/uba/va.c +++ b/usr/src/sys/vax/uba/va.c @@ -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 "../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/pte.h" #include "../h/vcmd.h" #include "../h/uio.h" diff --git a/usr/src/sys/vax/uba/vp.c b/usr/src/sys/vax/uba/vp.c index 2968556a56..22ded223bd 100644 --- a/usr/src/sys/vax/uba/vp.c +++ b/usr/src/sys/vax/uba/vp.c @@ -1,4 +1,4 @@ -/* vp.c 4.21 82/10/17 */ +/* vp.c 4.22 82/12/17 */ #include "vp.h" #if NVP > 0 @@ -10,13 +10,14 @@ * 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/pte.h" #include "../h/vcmd.h" #include "../h/uio.h" diff --git a/usr/src/sys/vax/vax/Locore.c b/usr/src/sys/vax/vax/Locore.c index 79b38265bd..b36c06b464 100644 --- a/usr/src/sys/vax/vax/Locore.c +++ b/usr/src/sys/vax/vax/Locore.c @@ -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 "../machine/pte.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" diff --git a/usr/src/sys/vax/vax/autoconf.c b/usr/src/sys/vax/vax/autoconf.c index f2794e139b..f575cebc9c 100644 --- a/usr/src/sys/vax/vax/autoconf.c +++ b/usr/src/sys/vax/vax/autoconf.c @@ -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. @@ -21,10 +21,11 @@ #include "mba.h" +#include "../machine/pte.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" diff --git a/usr/src/sys/vax/vax/cpudata.c b/usr/src/sys/vax/vax/cpudata.c index 914956788b..ca3147eb70 100644 --- a/usr/src/sys/vax/vax/cpudata.c +++ b/usr/src/sys/vax/vax/cpudata.c @@ -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/pte.h" #include "../vax/cpu.h" #include "../vax/nexus.h" diff --git a/usr/src/sys/vax/vax/genassym.c b/usr/src/sys/vax/vax/genassym.c index 6b4843be87..9b81df5d33 100644 --- a/usr/src/sys/vax/vax/genassym.c +++ b/usr/src/sys/vax/vax/genassym.c @@ -1,8 +1,9 @@ #define VAX780 1 #define VAX750 1 +#include "../machine/pte.h" + #include "../h/param.h" -#include "../h/pte.h" #include "../h/buf.h" #include "../h/vmmeter.h" #include "../h/vmparam.h" diff --git a/usr/src/sys/vax/vax/locore.s b/usr/src/sys/vax/vax/locore.s index 110a1ceeea..61a9acc210 100644 --- a/usr/src/sys/vax/vax/locore.s +++ b/usr/src/sys/vax/vax/locore.s @@ -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 "../h/psl.h" -#include "../h/pte.h" #include "../vax/cpu.h" #include "../vax/nexus.h" -#include "../vaxuba/ubareg.h" #include "../vax/cons.h" #include "../vax/clock.h" +#include "../vaxuba/ubareg.h" #include "dz.h" #include "mba.h" diff --git a/usr/src/sys/vax/vax/machdep.c b/usr/src/sys/vax/vax/machdep.c index ef5b524f7c..6f8abd44b7 100644 --- a/usr/src/sys/vax/vax/machdep.c +++ b/usr/src/sys/vax/vax/machdep.c @@ -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" @@ -6,11 +10,8 @@ #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/psl.h" #include "../h/buf.h" #include "../h/reboot.h" #include "../h/conf.h" diff --git a/usr/src/sys/vax/vax/mem.c b/usr/src/sys/vax/vax/mem.c index 4010e44f73..2e47faf25e 100644 --- a/usr/src/sys/vax/vax/mem.c +++ b/usr/src/sys/vax/vax/mem.c @@ -1,16 +1,17 @@ -/* mem.c 4.11 82/12/05 */ +/* mem.c 4.12 82/12/17 */ /* * 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/pte.h" #include "../h/vm.h" #include "../h/cmap.h" #include "../h/uio.h" diff --git a/usr/src/sys/vax/vax/swapgeneric.c b/usr/src/sys/vax/vax/swapgeneric.c index 3cff0c925d..03ccaab46a 100644 --- a/usr/src/sys/vax/vax/swapgeneric.c +++ b/usr/src/sys/vax/vax/swapgeneric.c @@ -1,10 +1,11 @@ -/* swapgeneric.c 4.4 82/10/17 */ +/* swapgeneric.c 4.5 82/12/17 */ #include "mba.h" +#include "../machine/pte.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" diff --git a/usr/src/sys/vax/vax/trap.c b/usr/src/sys/vax/vax/trap.c index 09bfff0061..59c9a581ea 100644 --- a/usr/src/sys/vax/vax/trap.c +++ b/usr/src/sys/vax/vax/trap.c @@ -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" @@ -6,11 +10,8 @@ #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/psl.h" -#include "../h/pte.h" #include "../h/acct.h" #include "../h/kernel.h" #ifdef SYSCALLTRACE diff --git a/usr/src/sys/vax/vax/vm_machdep.c b/usr/src/sys/vax/vax/vm_machdep.c index e060cd1504..4fc77550cb 100644 --- a/usr/src/sys/vax/vax/vm_machdep.c +++ b/usr/src/sys/vax/vax/vm_machdep.c @@ -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/pte.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); } + +/* + * 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; + } +} -- 2.20.1