From 3b1e560f2e1570c5cd3047b4cb0f9258380d64cf Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Sun, 14 Nov 1982 07:01:11 -0800 Subject: [PATCH] merge of 4.1b with 4.1c SCCS-vsn: sys/vax/vax/Locore.c 4.22 SCCS-vsn: sys/vax/vax/machdep.c 4.71 SCCS-vsn: sys/vax/vax/mscp.h 4.3 SCCS-vsn: sys/vax/vax/symbols.raw 4.6 SCCS-vsn: sys/vax/vax/trap.c 4.24 SCCS-vsn: sys/vax/vax/tu.c 4.12 SCCS-vsn: sys/vax/vax/vm_machdep.c 5.2 SCCS-vsn: sys/vax/include/vmparam.h 4.2 SCCS-vsn: sys/vax/uba/uba.c 4.57 SCCS-vsn: sys/vax/uba/ubareg.h 4.31 SCCS-vsn: sys/vax/uba/uda.c 4.15 SCCS-vsn: sys/vax/uba/ut.c 4.22 --- usr/src/sys/vax/include/vmparam.h | 4 +-- usr/src/sys/vax/uba/uba.c | 4 ++- usr/src/sys/vax/uba/ubareg.h | 11 ++++--- usr/src/sys/vax/uba/uda.c | 4 +-- usr/src/sys/vax/uba/ut.c | 9 ++++-- usr/src/sys/vax/vax/Locore.c | 8 ++++- usr/src/sys/vax/vax/machdep.c | 50 ++++++++++++++++++++++--------- usr/src/sys/vax/vax/mscp.h | 7 ++--- usr/src/sys/vax/vax/symbols.raw | 4 +-- usr/src/sys/vax/vax/trap.c | 27 ++++++++++++++++- usr/src/sys/vax/vax/tu.c | 4 +-- usr/src/sys/vax/vax/vm_machdep.c | 7 ++++- 12 files changed, 101 insertions(+), 38 deletions(-) diff --git a/usr/src/sys/vax/include/vmparam.h b/usr/src/sys/vax/include/vmparam.h index bb6ffeb1b7..02a1a6da74 100644 --- a/usr/src/sys/vax/include/vmparam.h +++ b/usr/src/sys/vax/include/vmparam.h @@ -1,4 +1,4 @@ -/* vmparam.h 4.1 82/11/09 */ +/* vmparam.h 4.2 82/11/13 */ /* * Machine dependent constants for VAX @@ -32,7 +32,7 @@ * Sizes of the system and user portions of the system page table. */ /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ -#define SYSPTSIZE (12*NPTEPG) +#define SYSPTSIZE (35*NPTEPG) #define USRPTSIZE (8*NPTEPG) /* diff --git a/usr/src/sys/vax/uba/uba.c b/usr/src/sys/vax/uba/uba.c index 4b0a3f3b99..66f2986be7 100644 --- a/usr/src/sys/vax/uba/uba.c +++ b/usr/src/sys/vax/uba/uba.c @@ -1,4 +1,4 @@ -/* uba.c 4.56 82/10/23 */ +/* uba.c 4.57 82/11/13 */ #include "../h/param.h" #include "../h/systm.h" @@ -465,6 +465,7 @@ ubamem(uban, addr, size, doalloc) return(a); } +#ifdef notdef /* * Map a virtual address into users address space. Actually all we * do is turn on the user mode write protection bits for the particular @@ -483,3 +484,4 @@ unmaptouser(vaddress) Sysmap[(((unsigned)(vaddress))-0x80000000) >> 9].pg_prot = (PG_KW>>27); } +#endif diff --git a/usr/src/sys/vax/uba/ubareg.h b/usr/src/sys/vax/uba/ubareg.h index 5c54c755cd..26d551ddcc 100644 --- a/usr/src/sys/vax/uba/ubareg.h +++ b/usr/src/sys/vax/uba/ubareg.h @@ -1,4 +1,4 @@ -/* ubareg.h 4.30 82/05/26 */ +/* ubareg.h 4.31 82/11/13 */ /* * VAX UNIBUS adapter registers @@ -85,8 +85,11 @@ struct uba_regs #define UBADPR_NXM 0x40000000 /* nxm from memory */ #define UBADPR_UCE 0x20000000 /* uncorrectable error */ #define UBADPR_PURGE 0x00000001 /* purge bdp */ -#define UBA_PURGE750(uba, bdp) \ - ((uba)->uba_dpr[bdp] |= (UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE)) +/* the DELAY is for a hardware problem */ +#define UBA_PURGE750(uba, bdp) { \ + ((uba)->uba_dpr[bdp] |= (UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE)); \ + DELAY(8); \ +} #endif VAX750 /* @@ -113,7 +116,7 @@ struct uba_regs #if !defined(VAX780) && defined(VAX750) #define UBAPURGE(uba, bdp) { \ if (cpu==VAX_750) { \ - UBA_PURGE750((uba), (bdp)); break; \ + UBA_PURGE750((uba), (bdp)); \ } \ } #endif diff --git a/usr/src/sys/vax/uba/uda.c b/usr/src/sys/vax/uba/uda.c index 6438439c89..b3d7410d8f 100644 --- a/usr/src/sys/vax/uba/uda.c +++ b/usr/src/sys/vax/uba/uda.c @@ -1,4 +1,4 @@ -/* uda.c 4.14 82/10/21 */ +/* uda.c 4.15 82/11/13 */ #include "ra.h" #if NUDA > 0 @@ -722,7 +722,7 @@ uderror(um, mp) case M_FM_BUSADDR: printf("host memory access error, event 0%o, addr 0%o\n", - mp->mslg_event, *((long *)&mp->mslg_busaddr[0])); + mp->mslg_event, mp->mslg_busaddr); break; case M_FM_DISKTRN: diff --git a/usr/src/sys/vax/uba/ut.c b/usr/src/sys/vax/uba/ut.c index 577055a872..c507be7a7a 100644 --- a/usr/src/sys/vax/uba/ut.c +++ b/usr/src/sys/vax/uba/ut.c @@ -1,4 +1,4 @@ -/* ut.c 4.21 82/10/17 */ +/* ut.c 4.22 82/11/13 */ #include "tj.h" #if NUT > 0 @@ -136,7 +136,10 @@ utopen(dev, flag) get: utcommand(dev, UT_SENSE, 1); if (sc->sc_dsreg&UTDS_PIP) { - sleep((caddr_t) &lbolt, PZERO+1); +#ifdef notdef + /* this needs to be fixed */ + sleep((caddr_t)&lbolt, PZERO+1); +#endif goto get; } sc->sc_dens = olddens; @@ -737,7 +740,7 @@ utioctl(dev, cmd, data, flag) utcommand(dev, utops[mtop->mt_op], fcount); /* note this depends on the mtop values */ if ((mtop->mt_op >= MTFSF || mtop->mt_op <= MTBSR) && - bp->b_resid) { + bp->b_resid) return (EIO); if ((bp->b_flags&B_ERROR) || (sc->sc_dsreg&UTDS_BOT)) break; diff --git a/usr/src/sys/vax/vax/Locore.c b/usr/src/sys/vax/vax/Locore.c index 112209388b..79b38265bd 100644 --- a/usr/src/sys/vax/vax/Locore.c +++ b/usr/src/sys/vax/vax/Locore.c @@ -1,4 +1,4 @@ -/* Locore.c 4.21 82/10/17 */ +/* Locore.c 4.22 82/11/13 */ #include "dz.h" #include "mba.h" @@ -217,6 +217,12 @@ splx(s) int s; { } /*ARGSUSED*/ bcopy(from, to, count) caddr_t from, to; unsigned count; { ; } +/*ARGSUSED*/ +bzero(base, count) caddr_t base; unsigned count; { ; } + +/*ARGSUSED*/ +bcmp(s1, s2, count) caddr_t s1, s2; unsigned count; { return (0); } + /*ARGSUSED*/ ffs(i) { return (0); } diff --git a/usr/src/sys/vax/vax/machdep.c b/usr/src/sys/vax/vax/machdep.c index cd33d0ca96..ef5b524f7c 100644 --- a/usr/src/sys/vax/vax/machdep.c +++ b/usr/src/sys/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* machdep.c 4.70 82/11/03 */ +/* machdep.c 4.71 82/11/13 */ #include "../h/param.h" #include "../h/systm.h" @@ -47,7 +47,7 @@ int icode[] = }; int szicode = sizeof(icode); -#if MUSH +#ifdef MUSH int mcode[] = { 0x9f19af9f, /* pushab [&"mush",0]; pushab */ @@ -78,6 +78,7 @@ startup(firstaddr) register int unixsize; register unsigned i; register struct pte *pte; + int mapaddr, j; register caddr_t v; /* @@ -96,12 +97,12 @@ startup(firstaddr) printf("real mem = %d\n", ctob(maxmem)); /* - * First determine how many buffers are reasonable. - * Current alg is 16 per megabyte, with min of 16. + * Determine how many buffers to allocate. + * Use 10% of memory, with min of 16. * We allocate 1/2 as many swap buffer headers as file i/o buffers. */ if (nbuf == 0) { - nbuf = (16 * physmem) / btoc(1024*1024); + nbuf = ((physmem * NBPG) / 10) / (2 * CLBYTES); if (nbuf < 16) nbuf = 16; } @@ -113,13 +114,28 @@ startup(firstaddr) /* * Allocate space for system data structures. + * The first available real memory address is in "firstaddr". + * As pages of memory are allocated, "firstaddr" is incremented. + * The first available kernel virtual address is in "v". + * As pages of kernel virtual memory are allocated, "v" is incremented. + * An index into the kernel page table corresponding to the + * virtual memory address maintained in "v" is kept in "mapaddr". */ + mapaddr = firstaddr; v = (caddr_t)(0x80000000 | (firstaddr * NBPG)); #define valloc(name, type, num) \ (name) = (type *)(v); (v) = (caddr_t)((name)+(num)) #define valloclim(name, type, num, lim) \ (name) = (type *)(v); (v) = (caddr_t)((lim) = ((name)+(num))) valloc(buffers, char, MAXBSIZE * nbuf); + for (i = 0; i < nbuf; i++) { + for (j = 0; j < 2 * CLSIZE; j++) { + *(int *)(&Sysmap[mapaddr+j]) = PG_V | PG_KW | firstaddr; + clearseg((unsigned)firstaddr); + firstaddr++; + } + mapaddr += MAXBSIZE / NBPG; + } valloc(buf, struct buf, nbuf); valloc(swbuf, struct buf, nswbuf); valloc(swsize, short, nswbuf); /* note: nswbuf is even */ @@ -134,14 +150,20 @@ startup(firstaddr) valloc(argmap, struct map, ARGMAPSIZE); valloc(kernelmap, struct map, nproc); valloc(mbmap, struct map, nmbclusters/4); -#if QUOTA +#ifdef QUOTA valloclim(quota, struct quota, nquota, quotaNQUOTA); valloclim(dquot, struct dquot, ndquot, dquotNDQUOT); #endif /* * Now allocate space for core map + * Allow space for all of phsical memory minus the amount + * dedicated to the system. The amount of physical memory + * dedicated to the system is the total virtual memory of + * the system minus the space in the buffers which is not + * allocated real memory. */ - ncmap = (physmem*NBPG - ((int)v &~ 0x80000000)) / + ncmap = (physmem*NBPG - ((int)v &~ 0x80000000) + + (nbuf * (MAXBSIZE - 2 * CLBYTES))) / (NBPG*CLSIZE + sizeof (struct cmap)); valloclim(cmap, struct cmap, ncmap, ecmap); if ((((int)(ecmap+1))&~0x80000000) > SYSPTSIZE*NBPG) @@ -152,13 +174,13 @@ startup(firstaddr) * for the space in the kernel map. */ unixsize = btoc((int)(ecmap+1) &~ 0x80000000); - if (unixsize >= physmem - 8*UPAGES) - panic("no memory"); - pte = &Sysmap[firstaddr]; - for (i = firstaddr; i < unixsize; i++) { - *(int *)(&Sysmap[i]) = PG_V | PG_KW | i; - clearseg(i); + for (i = mapaddr; i < unixsize; i++) { + *(int *)(&Sysmap[i]) = PG_V | PG_KW | firstaddr; + clearseg((unsigned)firstaddr); + firstaddr++; } + if (firstaddr >= physmem - 8*UPAGES) + panic("no memory"); mtpr(TBIA, 1); /* @@ -175,7 +197,7 @@ startup(firstaddr) * THE USER PAGE TABLE MAP IS CALLED ``kernelmap'' * WHICH IS A VERY UNDESCRIPTIVE AND INCONSISTENT NAME. */ - meminit(unixsize, maxmem); + meminit(firstaddr, maxmem); maxmem = freemem; printf("avail mem = %d\n", ctob(maxmem)); rminit(kernelmap, (long)USRPTSIZE, (long)1, diff --git a/usr/src/sys/vax/vax/mscp.h b/usr/src/sys/vax/vax/mscp.h index ad6bd23d03..23467221b1 100644 --- a/usr/src/sys/vax/vax/mscp.h +++ b/usr/src/sys/vax/vax/mscp.h @@ -1,4 +1,4 @@ -/* mscp.h 4.2 82/05/26 */ +/* mscp.h 4.3 82/11/13 */ /* * Definitions for the Mass Storage Control Protocol */ @@ -138,9 +138,6 @@ #define M_ST_DRIVE 013 /* Drive error */ #define M_ST_DIAG 037 /* Message from an internal diagnostic */ - -typedef short quad[4]; /* a word-aligned quadword */ - /* * An MSCP packet */ @@ -306,5 +303,5 @@ struct mslg { char mslg_sdistat[12]; /* SDI status information */ }; -#define mslg_busaddr mslg_unitid +#define mslg_busaddr mslg_unitid.val[0] #define mslg_sdecyl mslg_group diff --git a/usr/src/sys/vax/vax/symbols.raw b/usr/src/sys/vax/vax/symbols.raw index f419dbccac..58f72feb08 100644 --- a/usr/src/sys/vax/vax/symbols.raw +++ b/usr/src/sys/vax/vax/symbols.raw @@ -1,4 +1,4 @@ -# symbols.raw 4.5 81/11/07 +# symbols.raw 4.6 82/11/13 _version #dmesg _msgbuf @@ -48,7 +48,7 @@ # _rectime # _pgintime _dk_xfer - _bootime + _boottime #w _proc _swapdev diff --git a/usr/src/sys/vax/vax/trap.c b/usr/src/sys/vax/vax/trap.c index 6a04670a55..d236af1b45 100644 --- a/usr/src/sys/vax/vax/trap.c +++ b/usr/src/sys/vax/vax/trap.c @@ -1,4 +1,4 @@ -/* trap.c 4.23 82/10/31 */ +/* trap.c 4.24 82/11/13 */ #include "../h/param.h" #include "../h/systm.h" @@ -12,6 +12,9 @@ #include "../h/psl.h" #include "../h/pte.h" #include "../h/acct.h" +#ifdef SYSCALLTRACE +#include "../sys/syscalls.c" +#endif #include "../vax/mtpr.h" @@ -148,6 +151,9 @@ out: curpri = p->p_pri; } +#ifdef SYSCALLTRACE +int syscalltrace = 0; +#endif /* * Called from the trap handler when a system call occurs */ @@ -197,6 +203,25 @@ asm("ok:"); /* GROT */ u.u_error = EINTR; } else { u.u_eosys = JUSTRETURN; +#ifdef SYSCALLTRACE + if (syscalltrace) { + register int i; + char *cp; + + if (code >= nsysent) + printf("0x%x", code); + else + printf("%s", syscallnames[code]); + cp = "("; + for (i= 0; i < callp->sy_narg; i++) { + printf("%s%x", cp, u.u_arg[i]); + cp = ", "; + } + if (i) + putchar(')', 0); + putchar('\n', 0); + } +#endif (*(callp->sy_call))(); } locr0[PS] &= ~PSL_C; diff --git a/usr/src/sys/vax/vax/tu.c b/usr/src/sys/vax/vax/tu.c index 8b69740b42..6b0e98a45a 100644 --- a/usr/src/sys/vax/vax/tu.c +++ b/usr/src/sys/vax/vax/tu.c @@ -1,4 +1,4 @@ -/* tu.c 4.11 82/10/20 */ +/* tu.c 4.12 82/11/13 */ #if defined(VAX750) || defined(VAX730) /* @@ -31,7 +31,7 @@ int tudebug; /* printd */ #define NTU ((cpu == VAX_750) ? 1 : 2) #define DNUM 01 /* mask for drive number (should match NTU) */ -#ifndef MRSP +#if !defined(MRSP) || lint #define MRSP (cpu != VAX_750) #endif #define NTUBLK 512 /* number of blocks on a TU58 cassette */ diff --git a/usr/src/sys/vax/vax/vm_machdep.c b/usr/src/sys/vax/vax/vm_machdep.c index edabe5e7bf..e060cd1504 100644 --- a/usr/src/sys/vax/vax/vm_machdep.c +++ b/usr/src/sys/vax/vax/vm_machdep.c @@ -1,4 +1,4 @@ -/* vm_machdep.c 5.1 82/11/06 */ +/* vm_machdep.c 5.2 82/11/13 */ #include "../h/param.h" #include "../h/pte.h" @@ -45,6 +45,7 @@ mapin(pte, v, pfnum, count, prot) } } +#ifdef notdef /*ARGSUSED*/ mapout(pte, size) register struct pte *pte; @@ -53,6 +54,7 @@ mapout(pte, size) panic("mapout"); } +#endif /* * Check that a process will not be too large. @@ -76,6 +78,9 @@ newptes(pte, v, size) { register caddr_t a = ptob(v); +#ifdef lint + pte = pte; +#endif if (size >= 8) { mtpr(TBIA, 0); return; -- 2.20.1