SCCS-vsn: sys/kern/kern_physio.c 3.8
SCCS-vsn: sys/kern/vfs_bio.c 3.8
SCCS-vsn: sys/kern/vfs_cluster.c 3.8
SCCS-vsn: sys/kern/kern_clock.c 3.12
SCCS-vsn: sys/vax/mba/hp.c 3.5
SCCS-vsn: sys/kern/init_main.c 3.6
SCCS-vsn: sys/kern/subr_rmap.c 3.3
SCCS-vsn: sys/kern/subr_rmap.c.sav 3.3
SCCS-vsn: sys/kern/kern_synch.c 3.12
SCCS-vsn: sys/kern/kern_proc.c 3.12
SCCS-vsn: sys/vax/uba/up.c 3.14
-/* init_main.c 3.5 %G% */
+/* init_main.c 3.6 %G% */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
register struct buf *dp;
register int i;
struct bdevsw *bdp;
register struct buf *dp;
register int i;
struct bdevsw *bdp;
bfreelist.b_forw = bfreelist.b_back =
bfreelist.av_forw = bfreelist.av_back = &bfreelist;
bfreelist.b_forw = bfreelist.b_back =
bfreelist.av_forw = bfreelist.av_back = &bfreelist;
+ /*
+ * Count swap devices, and adjust total swap space available.
+ * Some of this space will not be available until a vswapon()
+ * system is issued, usually when the system goes multi-user.
+ */
+ nswdev = 0;
+ for (swp = swdevt; swp->sw_dev; swp++)
+ nswdev++;
+ if (nswdev == 0)
+ panic("binit");
+ nswap *= nswdev;
+ maxpgio *= nswdev;
+ swfree(0);
-/* kern_clock.c 3.11 %G% */
+/* %H% 3.12 kern_clock.c */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
register struct callo *p1, *p2;
register struct proc *pp;
register int s;
register struct callo *p1, *p2;
register struct proc *pp;
register int s;
if (s > u.u_vm.vm_maxrss)
u.u_vm.vm_maxrss = s;
}
if (s > u.u_vm.vm_maxrss)
u.u_vm.vm_maxrss = s;
}
if (USERMODE(ps)) {
u.u_vm.vm_utime++;
if(u.u_procp->p_nice > NZERO)
if (USERMODE(ps)) {
u.u_vm.vm_utime++;
if(u.u_procp->p_nice > NZERO)
+ cpstate = CP_NICE;
+ else
+ cpstate = CP_USER;
else
u.u_vm.vm_stime++;
}
else
u.u_vm.vm_stime++;
}
+ dk_time[cpstate][dk_busy&(DK_NSTATES-1)]++;
if (!noproc) {
pp = u.u_procp;
if(++pp->p_cpu == 0)
if (!noproc) {
pp = u.u_procp;
if(++pp->p_cpu == 0)
-/* kern_physio.c 3.7 %G% */
+/* kern_physio.c 3.8 %G% */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
bp->b_bcount = c;
bp->b_blkno = dblkno;
bp->b_dev = dev;
bp->b_bcount = c;
bp->b_blkno = dblkno;
bp->b_dev = dev;
- if (dev == swapdev)
- bp->b_blkno += swplo;
(*bdevsw[major(dev)].d_strategy)(bp);
if (flag & B_DIRTY) {
if (c < nbytes)
(*bdevsw[major(dev)].d_strategy)(bp);
if (flag & B_DIRTY) {
if (c < nbytes)
-/* kern_proc.c 3.11 %G% */
+/* kern_proc.c 3.12 %G% */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
ne = 0;
nc = 0;
uap = (struct execa *)u.u_ap;
ne = 0;
nc = 0;
uap = (struct execa *)u.u_ap;
- if ((bno = malloc(swapmap, ctod(clrnd((int) btoc(NCARGS))))) == 0) {
+ if ((bno = malloc(argmap, ctod(clrnd((int) btoc(NCARGS))))) == 0) {
swkill(u.u_procp, "exece");
goto bad;
}
swkill(u.u_procp, "exece");
goto bad;
}
if ((nc&BMASK) == 0) {
if (bp)
bdwrite(bp);
if ((nc&BMASK) == 0) {
if (bp)
bdwrite(bp);
- bp = getblk(swapdev,
- (daddr_t)(dbtofsb(swplo+bno)+(nc>>BSHIFT)));
+ bp = getblk(argdev,
+ (daddr_t)(dbtofsb(bno)+(nc>>BSHIFT)));
cp = bp->b_un.b_addr;
}
nc++;
cp = bp->b_un.b_addr;
}
nc++;
if (getxfile(ip, nc) || u.u_error) {
badarg:
for (c = 0; c < nc; c += BSIZE)
if (getxfile(ip, nc) || u.u_error) {
badarg:
for (c = 0; c < nc; c += BSIZE)
- if (bp = baddr(swapdev, dbtofsb(swplo+bno)+(c>>BSHIFT))) {
+ if (bp = baddr(argdev, dbtofsb(bno)+(c>>BSHIFT))) {
bp->b_flags |= B_AGE; /* throw away */
bp->b_flags &= ~B_DELWRI; /* cancel io */
brelse(bp);
bp->b_flags |= B_AGE; /* throw away */
bp->b_flags &= ~B_DELWRI; /* cancel io */
brelse(bp);
if ((nc&BMASK) == 0) {
if (bp)
brelse(bp);
if ((nc&BMASK) == 0) {
if (bp)
brelse(bp);
- bp = bread(swapdev,
- (daddr_t)(dbtofsb(swplo+bno)+(nc>>BSHIFT)));
+ bp = bread(argdev,
+ (daddr_t)(dbtofsb(bno)+(nc>>BSHIFT)));
bp->b_flags |= B_AGE; /* throw away */
bp->b_flags &= ~B_DELWRI; /* cancel io */
cp = bp->b_un.b_addr;
bp->b_flags |= B_AGE; /* throw away */
bp->b_flags &= ~B_DELWRI; /* cancel io */
cp = bp->b_un.b_addr;
if (bp)
brelse(bp);
if (bno)
if (bp)
brelse(bp);
if (bno)
- mfree(swapmap, ctod(clrnd((int) btoc(NCARGS))), bno);
+ mfree(argmap, ctod(clrnd((int) btoc(NCARGS))), bno);
else
p->p_siga1 = 0;
(void) spl0();
else
p->p_siga1 = 0;
(void) spl0();
- rate.v_pgin -= p->p_aveflt;
p->p_aveflt = 0;
for(i=0; i<NSIG; i++)
u.u_signal[i] = SIG_IGN;
p->p_aveflt = 0;
for(i=0; i<NSIG; i++)
u.u_signal[i] = SIG_IGN;
vrelpt(u.u_procp);
vrelu(u.u_procp, 0);
multprog--;
vrelpt(u.u_procp);
vrelu(u.u_procp, 0);
multprog--;
- spl7(); /* clock will get mad because of overlaying */
+/* spl7(); /* clock will get mad because of overlaying */
+ noproc = 1;
p->p_stat = SZOMB;
i = PIDHASH(p->p_pid);
x = p - proc;
p->p_stat = SZOMB;
i = PIDHASH(p->p_pid);
x = p - proc;
* Protect this process from future
* tty signals, and clear TSTP/TTIN/TTOU if pending.
*/
* Protect this process from future
* tty signals, and clear TSTP/TTIN/TTOU if pending.
*/
- q->p_pgrp = q->p_pid;
-#define bit(a) (1<<(a-1))
- q->p_sig &= ~(bit(SIGTSTP)|bit(SIGTTIN)|bit(SIGTTOU));
}
wakeup((caddr_t)p->p_pptr);
psignal(p->p_pptr, SIGCHLD);
}
wakeup((caddr_t)p->p_pptr);
psignal(p->p_pptr, SIGCHLD);
-/* kern_synch.c 3.11 %G% */
+/* kern_synch.c 3.12 %G% */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
rpp->p_wchan = 0;
rpp->p_slptime = 0;
rpp->p_aveflt = rip->p_aveflt;
rpp->p_wchan = 0;
rpp->p_slptime = 0;
rpp->p_aveflt = rip->p_aveflt;
- rate.v_pgin += rip->p_aveflt;
rpp->p_faults = 0;
n = PIDHASH(rpp->p_pid);
p->p_idhash = pidhash[n];
rpp->p_faults = 0;
n = PIDHASH(rpp->p_pid);
p->p_idhash = pidhash[n];
-/* subr_rmap.c 3.2 %G% */
+/* subr_rmap.c 3.3 %G% */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
{
register int a;
register struct map *bp;
{
register int a;
register struct map *bp;
+ if (size <= 0 || mp == swapmap && size > DMMAX)
panic("malloc");
for (bp=mp; bp->m_size; bp++) {
if (bp->m_size >= size) {
panic("malloc");
for (bp=mp; bp->m_size; bp++) {
if (bp->m_size >= size) {
+ if (mp == swapmap &&
+ (first = DMMAX - bp->m_addr%DMMAX) < bp->m_size) {
+ if (bp->m_size - first < size)
+ continue;
+ a = bp->m_addr + first;
+ rest = bp->m_size - first - size;
+ bp->m_size = first;
+ if (rest)
+ mfree(swapmap, rest, a+size);
+ return (a);
+ }
a = bp->m_addr;
bp->m_addr += size;
if ((bp->m_size -= size) == 0) {
a = bp->m_addr;
bp->m_addr += size;
if ((bp->m_size -= size) == 0) {
-/* subr_rmap.c.sav 3.2 %G% */
+/* subr_rmap.c.sav 3.3 %G% */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
{
register int a;
register struct map *bp;
{
register int a;
register struct map *bp;
+ if (size <= 0 || mp == swapmap && size > DMMAX)
panic("malloc");
for (bp=mp; bp->m_size; bp++) {
if (bp->m_size >= size) {
panic("malloc");
for (bp=mp; bp->m_size; bp++) {
if (bp->m_size >= size) {
+ if (mp == swapmap &&
+ (first = DMMAX - bp->m_addr%DMMAX) < bp->m_size) {
+ if (bp->m_size - first < size)
+ continue;
+ a = bp->m_addr + first;
+ rest = bp->m_size - first - size;
+ bp->m_size = first;
+ if (rest)
+ mfree(swapmap, rest, a+size);
+ return (a);
+ }
a = bp->m_addr;
bp->m_addr += size;
if ((bp->m_size -= size) == 0) {
a = bp->m_addr;
bp->m_addr += size;
if ((bp->m_size -= size) == 0) {
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
bp->b_bcount = c;
bp->b_blkno = dblkno;
bp->b_dev = dev;
bp->b_bcount = c;
bp->b_blkno = dblkno;
bp->b_dev = dev;
- if (dev == swapdev)
- bp->b_blkno += swplo;
(*bdevsw[major(dev)].d_strategy)(bp);
if (flag & B_DIRTY) {
if (c < nbytes)
(*bdevsw[major(dev)].d_strategy)(bp);
if (flag & B_DIRTY) {
if (c < nbytes)
-/* vfs_cluster.c 3.7 %G% */
+/* vfs_cluster.c 3.8 %G% */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
bp->b_bcount = c;
bp->b_blkno = dblkno;
bp->b_dev = dev;
bp->b_bcount = c;
bp->b_blkno = dblkno;
bp->b_dev = dev;
- if (dev == swapdev)
- bp->b_blkno += swplo;
(*bdevsw[major(dev)].d_strategy)(bp);
if (flag & B_DIRTY) {
if (c < nbytes)
(*bdevsw[major(dev)].d_strategy)(bp);
if (flag & B_DIRTY) {
if (c < nbytes)
/*
* RP04/RP06/RM03 disk driver
/*
* RP04/RP06/RM03 disk driver
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/buf.h"
#include "../h/conf.h"
#include "../h/dir.h"
#include "../h/buf.h"
#include "../h/conf.h"
#include "../h/dir.h"
#define NTRAC 19
#define NRMSECT 32
#define NRMTRAC 5
#define NTRAC 19
#define NRMSECT 32
#define NRMTRAC 5
-#define SDIST 2
-#define RDIST 6
+
+#define _hpSDIST 3
+#define _hpRDIST 6
+
+int hpSDIST = _hpSDIST;
+int hpRDIST = _hpRDIST;
+int hpseek;
#define PRESET 020
#define RTC 016
#define OFFSET 014
#define PRESET 020
#define RTC 016
#define OFFSET 014
#define SEARCH 030
#define RECAL 06
#define DCLR 010
#define SEARCH 030
#define RECAL 06
#define DCLR 010
cn = bp->b_cylin;
if(hp_type[unit] == RM) {
sn = bn%(NRMSECT*NRMTRAC);
cn = bp->b_cylin;
if(hp_type[unit] == RM) {
sn = bn%(NRMSECT*NRMTRAC);
- sn = (sn+NRMSECT-SDIST)%NRMSECT;
+ sn = (sn+NRMSECT-hpSDIST)%NRMSECT;
} else {
sn = bn%(NSECT*NTRAC);
} else {
sn = bn%(NSECT*NTRAC);
- sn = (sn+NSECT-SDIST)%NSECT;
+ sn = (sn+NSECT-hpSDIST)%NSECT;
}
if(cn - (hpaddr->hpdc & 0xffff))
goto search;
}
if(cn - (hpaddr->hpdc & 0xffff))
goto search;
- csn = ((hpaddr->hpla & 0xffff)>>6) - sn + SDIST - 1;
+ else if (hpseek)
+ goto done;
+ csn = ((hpaddr->hpla & 0xffff)>>6) - sn + 1;
if(csn < 0)
csn += NSECT;
if(csn < 0)
csn += NSECT;
+ if(csn > NSECT-hpRDIST)
goto done;
search:
hpaddr->hpdc = cn;
goto done;
search:
hpaddr->hpdc = cn;
- hpaddr->hpda = sn;
- hpaddr->hpcs1 = SEARCH|GO;
+ if (hpseek)
+ hpaddr->hpcs1 = SEEK|GO;
+ else {
+ hpaddr->hpda = sn;
+ hpaddr->hpcs1 = SEARCH|GO;
+ }
/*
unit += DK_N;
dk_busy |= 1<<unit;
/*
unit += DK_N;
dk_busy |= 1<<unit;
+#define spl5 spl6 /* block clock, for delay loop's sake */
/*
* Emulex UNIBUS disk driver with overlapped seeks and ECC recovery.
*
/*
* Emulex UNIBUS disk driver with overlapped seeks and ECC recovery.
*
* but we have previously experienced problems with it set this way.
* We intend to try this again in the near future.
*
* but we have previously experienced problems with it set this way.
* We intend to try this again in the near future.
*
+ * NB: OUR SYSTEM CURRENTLY GETS UBA ERRORS WHEN RUNNING THIS DRIVER
+ * AND THE BUS OCCASIONALLY HANGS, NECESSITATING THE DEVIE RESET
+ * CODE WHICH RE-INITS THE UNIBUS. YECHHH.
*/
#include "../h/param.h"
#include "../h/systm.h"
*/
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/buf.h"
#include "../h/conf.h"
#include "../h/dir.h"
#include "../h/buf.h"
#include "../h/conf.h"
#include "../h/dir.h"
* If DK_N+NUP > DK_NMAX, then transfer stats are divided per drive.
* If DK_NMAX is yet smaller, some drives are not monitored.
*/
* If DK_N+NUP > DK_NMAX, then transfer stats are divided per drive.
* If DK_NMAX is yet smaller, some drives are not monitored.
*/
-#define DK_N 1
-#define DK_NMAX 2
+#define DK_N 2
+#define DK_NMAX 3
#define ushort unsigned short
#define ushort unsigned short
/*
* Constants controlling on-cylinder SEARCH usage.
*
/*
* Constants controlling on-cylinder SEARCH usage.
*
- * SDIST/2 msec time needed to start transfer
- * IDIST/2 msec slop for interrupt latency
- * RDIST/2 msec tolerable rotational latency when on-cylinder
+ * upSDIST/2 msec time needed to start transfer
+ * upRDIST/2 msec tolerable rotational latency when on-cylinder
- * If we are no closer than SDIST sectors and no further than SDIST+RDIST
+ * If we are no closer than upSDIST sectors and no further than upSDIST+upRDIST
* and in the driver then we take it as it is. Otherwise we do a SEARCH
* and in the driver then we take it as it is. Otherwise we do a SEARCH
- * requesting an interrupt SDIST+IDIST sectors in advance.
+ * requesting an interrupt upSDIST sectors in advance.
-#define _SDIST 6 /* 3.0 msec */
-#define _RDIST 6 /* 2.5 msec */
-#define _IDIST 1 /* 0.5 msec */
+#define _upSDIST 6 /* 3.0 msec */
+#define _upRDIST 6 /* 3.0 msec */
-int SDIST = _SDIST;
-int RDIST = _RDIST;
-int IDIST = _IDIST;
+int upSDIST = _upSDIST;
+int upRDIST = _upRDIST;
/*
* To fill a 300M drive:
/*
* To fill a 300M drive:
* Do enough of the disk address decoding to determine
* which cylinder and sector the request is on.
* If we are on the correct cylinder and the desired sector
* Do enough of the disk address decoding to determine
* which cylinder and sector the request is on.
* If we are on the correct cylinder and the desired sector
- * lies between SDIST and SDIST+RDIST sectors ahead of us, then
+ * lies between upSDIST and upSDIST+upRDIST sectors ahead of us, then
* we don't bother to SEARCH but just begin the transfer asap.
* we don't bother to SEARCH but just begin the transfer asap.
- * Otherwise ask for a interrupt SDIST+IDIST sectors ahead.
+ * Otherwise ask for a interrupt upSDIST sectors ahead.
*/
bn = dkblock(bp);
cn = bp->b_cylin;
sn = bn%(NSECT*NTRAC);
*/
bn = dkblock(bp);
cn = bp->b_cylin;
sn = bn%(NSECT*NTRAC);
- sn = (sn+NSECT-SDIST)%NSECT;
+ sn = (sn+NSECT-upSDIST)%NSECT;
if (cn - upaddr->updc)
goto search; /* Not on-cylinder */
if (cn - upaddr->updc)
goto search; /* Not on-cylinder */
csn = (upaddr->upla>>6) - sn - 1;
if (csn < 0)
csn += NSECT;
csn = (upaddr->upla>>6) - sn - 1;
if (csn < 0)
csn += NSECT;
+ if (csn > NSECT-upRDIST)