From: Sam Leffler Date: Mon, 13 Jan 1986 07:46:06 +0000 (-0800) Subject: 4.3- plus start of autoconfig X-Git-Tag: BSD-4_3-Snapshot-Development~3615 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/56ad800084c0239bd5d8012463bae82162cb87ad 4.3- plus start of autoconfig SCCS-vsn: sys/tahoe/tahoe/autoconf.c 1.3 SCCS-vsn: sys/tahoe/tahoe/genassym.c 1.3 SCCS-vsn: sys/tahoe/tahoe/locore.s 1.3 SCCS-vsn: sys/tahoe/tahoe/machdep.c 1.3 SCCS-vsn: sys/tahoe/tahoe/scb.h 1.2 SCCS-vsn: sys/tahoe/tahoe/scb.s 1.2 SCCS-vsn: sys/tahoe/tahoe/vm_machdep.c 1.3 SCCS-vsn: sys/tahoe/include/vmparam.h 1.3 SCCS-vsn: sys/tahoe/if/if_ace.c 1.3 --- diff --git a/usr/src/sys/tahoe/if/if_ace.c b/usr/src/sys/tahoe/if/if_ace.c index a11ef74091..9e0d096f8c 100644 --- a/usr/src/sys/tahoe/if/if_ace.c +++ b/usr/src/sys/tahoe/if/if_ace.c @@ -1,4 +1,4 @@ -/* if_ace.c 1.2 86/01/05 */ +/* if_ace.c 1.3 86/01/12 */ /* * ACC VERSAbus Ethernet controller @@ -18,29 +18,31 @@ #include "ioctl.h" #include "errno.h" #include "vmparam.h" +#include "syslog.h" #include "../net/if.h" #include "../net/netisr.h" #include "../net/route.h" +#ifdef INET #include "../netinet/in.h" #include "../netinet/in_systm.h" #include "../netinet/in_var.h" #include "../netinet/ip.h" #include "../netinet/ip_var.h" #include "../netinet/if_ether.h" +#endif +#ifdef NS +#include "../netns/ns.h" +#include "../netns/ns_if.h" +#endif #include "../tahoe/mtpr.h" #include "../tahoeif/if_acereg.h" #include "../tahoevba/vbavar.h" -#define LONET 124 - /* * Configuration table, for 2 units (should be defined by config) */ -#define ACEVECTOR 0x90 -long acestd[] = { 0x0ff0000, 0xff0100 }; /* controller */ - extern char ace0utl[], ace1utl[]; /* dpm */ char *acemap[]= { ace0utl, ace1utl }; extern struct pte ACE0map[], ACE1map[]; @@ -59,6 +61,7 @@ short random_mask_tbl[16] = { int aceprobe(), aceattach(), acerint(), acecint(); struct vba_device *aceinfo[NACE]; +long acestd[] = { 0x0ff0000, 0xff0100, 0 }; struct vba_driver acedriver = { aceprobe, 0,aceattach,0,acestd,"ace",aceinfo,"v/eiu",0 }; @@ -91,22 +94,40 @@ struct ace_softc { struct ace_stats is_stats; /* holds board statistics */ short is_xcnt; /* count xmitted segments to be acked by the controller */ + long is_ivec; /* autoconfig interrupt vector base */ } ace_softc[NACE]; extern struct ifnet loif; -aceprobe(reg) +aceprobe(reg, vi) caddr_t reg; + struct vba_device *vi; { - register struct acedevice *addr = (struct acedevice *)reg; + register br, cvec; /* must be r12, r11 */ + struct acedevice *ap = (struct acedevice *)reg; + struct ace_softc *is = &ace_softc[vi->ui_unit]; #ifdef lint acerint(0); acecint(0); #endif if (badaddr(reg, 2)) - return(0); - movow(&addr->csr, CSR_RESET); + return (0); + movow(&ap->csr, CSR_RESET); DELAY(10000); - return (sizeof (struct acedevice)); +#ifdef notdef + /* + * Select two spaces for the interrupts aligned to an + * eight vector boundary and fitting in 8 bits (as + * required by the controller) -- YECH. The controller + * will be notified later at initialization time. + */ + if ((vi->ui_hd->vh_lastiv -= 2) > 0xff) + vi->ui_hd->vh_lastiv = 0x200; + is->is_ivec = vi->ui_hd->vh_lastiv = vi->ui_hd->vh_lastiv &~ 0x7; +#else + is->is_ivec = 0x90+vi->ui_unit*8; +#endif + br = 0x14, cvec = is->is_ivec; /* XXX */ + return (sizeof (*ap)); } /* @@ -214,12 +235,8 @@ aceinit(unit) movow(&addr->csr, CSR_GO); Csr = addr->csr; if (Csr & CSR_ACTIVE) { - movow(&addr->ivct, ACEVECTOR + unit*8); + movow(&addr->ivct, is->is_ivec); Csr |= CSR_IENA | is->is_promiscuous; -#ifdef notdef - if (ifp->if_net == LONET) - Csr |= CSR_LOOP3; -#endif movow(&addr->csr, Csr); is->is_flags = 0; is->is_xcnt = 0; @@ -298,7 +315,7 @@ acecint(unit) short eostat; if (is->is_xcnt <= 0) { - printf("ace%d: stray xmit interrupt, xcnt %d\n", + log(LOG_ERR, "ace%d: stray xmit interrupt, xcnt %d\n", unit, is->is_xcnt); is->is_xcnt = 0; if (is->is_if.if_snd.ifq_head) @@ -410,12 +427,16 @@ again: * information to be at the front, but we still have to drop * the type and length which are at the front of any trailer data. */ - m = aceget(unit, (u_char *)rxseg->rx_data, len, off); + m = aceget((u_char *)rxseg->rx_data, len, off, &is->is_if); if (m == 0) goto setup; if (off) { + struct ifnet *ifp; + + ifp = *(mtod(m, struct ifnet **)); m->m_off += 2 * sizeof (u_short); m->m_len -= 2 * sizeof (u_short); + *(mtod(m, struct ifnet **)) = ifp; } switch (ace->ether_type) { @@ -424,11 +445,11 @@ again: schednetisr(NETISR_IP); inq = &ipintrq; break; +#endif case ETHERTYPE_ARP: arpinput(&is->is_ac, m); goto setup; -#endif #ifdef NS case ETHERTYPE_NS: schednetisr(NETISR_NS); @@ -473,6 +494,10 @@ aceoutput(ifp, m0, dst) u_char edst[6]; struct in_addr idst; + if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) { + error = ENETDOWN; + goto bad; + } switch (dst->sa_family) { #ifdef INET @@ -512,7 +537,6 @@ aceoutput(ifp, m0, dst) off = 0; goto gottype; #endif - case AF_UNSPEC: ace = (struct ether_header *)dst->sa_data; bcopy((caddr_t)ace->ether_dhost, (caddr_t)edst, sizeof (edst)); @@ -520,7 +544,7 @@ aceoutput(ifp, m0, dst) goto gottype; default: - printf("ace%d: can't handle af%d\n", + log(LOG_ERR, "ace%d: can't handle af%d\n", ifp->if_unit, dst->sa_family); error = EAFNOSUPPORT; goto bad; @@ -620,12 +644,12 @@ aceStart(unit) */ /*ARGSUSED*/ aceput(unit, txbuf, m) - int unit; /* for statistics collection */ + int unit; char *txbuf; struct mbuf *m; { - register u_char *bp, *mcp; /* known to be r12, r11 */ - register short *s1, *s2; /* known to be r10, r9 */ + register u_char *bp, *mcp; + register short *s1, *s2; register u_int len; register struct mbuf *mp; int total; @@ -670,12 +694,12 @@ aceput(unit, txbuf, m) */ /*ARGSUSED*/ struct mbuf * -aceget(unit, rxbuf, totlen, off0) - int unit; /* for statistics collection */ +aceget(rxbuf, totlen, off0, ifp) u_char *rxbuf; int totlen, off0; + struct ifnet *ifp; { - register u_char *cp, *mcp; /* known to be r12, r11 */ + register u_char *cp, *mcp; register int tlen; register struct mbuf *m; struct mbuf *top = 0, **mp = ⊤ @@ -699,6 +723,8 @@ aceget(unit, rxbuf, totlen, off0) #endif } else len = totlen; + if (ifp) + len += sizeof(ifp); if (len >= CLBYTES) { struct mbuf *p; @@ -715,6 +741,15 @@ aceget(unit, rxbuf, totlen, off0) m->m_off = MMINOFF; } mcp = mtod(m, u_char *); + if (ifp) { + /* + * Prepend interface pointer to first mbuf. + */ + *(mtod(m, struct ifnet **)) = ifp; + mcp += sizeof(ifp); + len -= sizeof(ifp); + ifp = (struct ifnet *)0; + } /*bcopy((caddr_t)cp, (caddr_t)mcp, len);*/ /*cp += len; mcp += len;*/ tlen = len; @@ -787,35 +822,58 @@ aceioctl(ifp, cmd, data) caddr_t data; { register struct ifaddr *ifa = (struct ifaddr *)data; + struct acedevice *addr; int s = splimp(), error = 0; switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; - aceinit(ifp->if_unit); - ((struct arpcom *)ifp)->ac_ipaddr = IA_SIN(ifa)->sin_addr; - arpwhohas((struct arpcom *)ifp, &IA_SIN(ifa)->sin_addr); + switch (ifa->ifa_addr.sa_family) { +#ifdef INET + case AF_INET: + aceinit(ifp->if_unit); /* before arpwhohas */ + ((struct arpcom *)ifp)->ac_ipaddr = + IA_SIN(ifa)->sin_addr; + arpwhohas((struct arpcom *)ifp, &IA_SIN(ifa)->sin_addr); + break; +#endif +#ifdef NS + case AF_NS: { + struct ns_addr *ina = &(IA_SNS(ifa)->sns_addr); + + if (!ns_nullhost(*ina)) { + ifp->if_flags &= ~IFF_RUNNING; + sin = (struct sockaddr_in *)&ifr->ifr_addr; + addr = (struct acedevice *) + (aceinfo[ifp->if_unit]->ui_addr); + movow(&addr->csr, CSR_RESET); + DELAY(10000); + /* set station address & copy addr to arp */ + acesetetaddr(ifp->if_unit, addr, + ina->x_host.c_host); + } else + ina->x_host = *(union ns_host *)(es->es_addr); + aceinit(ifp->if_unit); + break; + } +#endif + default: + aceinit(ifp->if_unit); + break; + } break; -#ifdef notdef - case SIOCSETETADDR: { /* set Ethernet station address */ - struct vba_device *ui; - struct acedevice *addr; - struct sockaddr_in *sin; - - ifp->if_flags &= ~IFF_RUNNING | IFF_UP; - sin = (struct sockaddr_in *)&ifr->ifr_addr; - ui = aceinfo[ifp->if_unit]; - addr = (struct acedevice *)ui->ui_addr; - movow(&addr->csr, CSR_RESET); - DELAY(10000); - /* set station address and copy addr to arp struct */ - acesetetaddr(ifp->if_unit, addr, &sin->sin_zero[2]); - aceinit(ifp->if_unit); /* Re-initialize */ + case SIOCSIFFLAGS: + if ((ifp->if_flags&IFF_UP) == 0 && ifp->if_flags&IFF_RUNNING) { + addr = (struct acedevice *) + (aceinfo[ifp->if_unit]->ui_addr); + movow(&addr->csr, CSR_RESET); + ifp->if_flags &= ~IFF_RUNNING; + } else if (ifp->if_flags&IFF_UP && + (ifp->if_flags&IFF_RUNNING) == 0) + aceinit(ifp->if_unit); break; - } -#endif default: error = EINVAL; @@ -833,7 +891,7 @@ aceclean(unit) register short i; register char *pData1; - ioaccess(ACEmap[unit], ACEmapa[unit], ACEBPTE); + vbaaccess(ACEmap[unit], ACEmapa[unit], ACEBPTE); is->is_dpm = acemap[unit]; /* init dpm */ bzero((char *)is->is_dpm, 16384*2); diff --git a/usr/src/sys/tahoe/include/vmparam.h b/usr/src/sys/tahoe/include/vmparam.h index 041be7d1f6..b9050180b8 100644 --- a/usr/src/sys/tahoe/include/vmparam.h +++ b/usr/src/sys/tahoe/include/vmparam.h @@ -1,4 +1,4 @@ -/* vmparam.h 1.2 86/01/05 */ +/* vmparam.h 1.3 86/01/12 */ /* * Machine dependent constants for TAHOE @@ -18,17 +18,17 @@ #define HIGHPAGES UPAGES /* - * Virtual memory related constants, all in clicks + * Virtual memory related constants, all in bytes */ -#define MAXTSIZ (6*CLSIZE*1024) /* max text size */ +#define MAXTSIZ (6*1024*1024) /* max text size */ #ifndef DFLDSIZ -#define DFLDSIZ (6*1024*1024/NBPG) /* initial data size limit */ +#define DFLDSIZ (6*1024*1024) /* initial data size limit */ #endif #ifndef MAXDSIZ -#define MAXDSIZ (19*1024*1024/NBPG) /* max data size */ +#define MAXDSIZ (16*1024*1024) /* max data size */ #endif #ifndef DFLSSIZ -#define DFLSSIZ (512*1024/NBPG) /* initial stack size limit */ +#define DFLSSIZ (512*1024) /* initial stack size limit */ #endif #ifndef MAXSSIZ #define MAXSSIZ MAXDSIZ /* max stack size */ diff --git a/usr/src/sys/tahoe/tahoe/autoconf.c b/usr/src/sys/tahoe/tahoe/autoconf.c index c1eef16bdb..7908e74494 100644 --- a/usr/src/sys/tahoe/tahoe/autoconf.c +++ b/usr/src/sys/tahoe/tahoe/autoconf.c @@ -1,4 +1,4 @@ -/* autoconf.c 1.2 86/01/05 */ +/* autoconf.c 1.3 86/01/12 */ /* * Setup the system to run on the current machine. @@ -7,11 +7,13 @@ * device tables and the memory controller monitoring. Available * devices are determined (from possibilities mentioned in ioconf.c), * and the drivers are initialized. - * */ #include "../tahoe/pte.h" #include "../tahoe/mem.h" #include "../tahoe/mtpr.h" +#include "../tahoe/scb.h" + +#include "vba.h" #include "param.h" #include "systm.h" @@ -30,6 +32,13 @@ * the machine. */ int dkn; /* number of iostat dk numbers assigned so far */ +int cold; /* cold start flag initialized in locore.s */ + +/* + * This allocates the space for the per-uba information, + * such as buffered data path usage. + */ +struct vba_hd vba_hd[NVBA]; /* * Determine mass storage configuration for a machine. @@ -39,8 +48,9 @@ configure() register int *ip; extern caddr_t Sysbase; - printf("vba%d at %x\n", numvba-1, IOBASE); - vbafind(numvba-1, (char *)vmem,(struct pte *)VMEMmap); + printf("vba%d at %x\n", numvba, IOBASE); + vbafind(numvba, (char *)vmem,(struct pte *)VMEMmap); + numvba++; /* * Write protect the scb. It is strange * that this code is here, but this is as soon @@ -54,14 +64,14 @@ configure() setconf(); #endif swapconf(); + cold = 0; } - /* * Make the controllers accessible at physical address phys * by mapping kernel ptes starting at pte. */ -ioaccess(pte, iobase, n) +vbaaccess(pte, iobase, n) register struct pte *pte; caddr_t iobase; register int n; @@ -74,35 +84,67 @@ ioaccess(pte, iobase, n) mtpr(TBIA, 0); } +/* + * Fixctlrmask fixes the masks of the driver ctlr routines + * which otherwise save r11 and r12 where the interrupt and br + * level are passed through. + */ +fixctlrmask() +{ + register struct vba_ctlr *vm; + register struct vba_device *vi; + register struct vba_driver *vd; +#define phys(a,b) ((b)(((int)(a))&~0xc0000000)) + + vm = phys(vbminit, struct vba_ctlr *); + for (; vd = phys(vm->um_driver, struct vba_driver *); vm++) + *phys(vd->ud_probe, short *) &= ~0x1800; + vi = phys(vbdinit, struct vba_device *); + for (; vd = phys(vi->ui_driver, struct vba_driver *); vi++) + *phys(vd->ud_probe, short *) &= ~0x1800; +} /* - * Find devices on the BUS. + * Find devices on the VERSAbus. * Uses per-driver routine to see who is on the bus * and then fills in the tables, with help from a per-driver * slave initialization routine. */ - -int iospace_mapped = 0; - vbafind(vban, vumem, memmap) int vban; char *vumem; struct pte *memmap; { + register int br, cvec; /* must be r12, r11 */ register struct vba_device *ui; register struct vba_ctlr *um; u_short *reg; - long addr; + long addr, *ap; + struct vba_hd *vhp; struct vba_driver *udp; - int i; + int i, (**ivec)(); + extern long cold, catcher[SCB_LASTIV*2]; +#ifdef lint + br = 0; cvec = 0; +#endif + vhp = &vba_hd[vban]; /* * Make the controllers accessible at physical address phys * by mapping kernel ptes starting at pte. */ - ioaccess(memmap, IOBASE, (int)IOSIZE); - iospace_mapped = 1; -#define vbaddr(off) (u_short *)((int)vumem + ((off) & 0x0fffff)) + vbaaccess(memmap, IOBASE, (int)IOSIZE); + /* + * Setup scb device entries to point into catcher array. + */ + for (i = 0; i < SCB_LASTIV; i++) + scb.scb_devint[i] = (int (*)())&catcher[i*2]; + /* + * Set last free interrupt vector for devices with + * programmable interrupt vectors. Use is to decrement + * this number and use result as interrupt vector. + */ + vhp->vh_lastiv = SCB_LASTIV; /* * Check each VERSAbus mass storage controller. @@ -110,20 +152,46 @@ vbafind(vban, vumem, memmap) * see if it is really there, and if it is record it and * then go looking for slaves. */ +#define vbaddr(off) (u_short *)((int)vumem + ((off) & 0x0fffff)) for (um = vbminit; udp = um->um_driver; um++) { if (um->um_vbanum != vban && um->um_vbanum != '?') continue; + /* + * Use the particular address specified first, + * or if it is given as "0", if there is no device + * at that address, try all the standard addresses + * in the driver until we find it. + */ addr = (long)um->um_addr; + for (ap = udp->ud_addr; addr || (addr = *ap++); addr = 0) { +#ifdef notdef + if (vballoc[vbaoff(addr)]) + continue; +#endif reg = vbaddr(addr); - i = (*udp->ud_probe)(reg); + um->um_hd = vhp; + cvec = SCB_LASTIV, cold &= ~0x2; + i = (*udp->ud_probe)(reg, um); + cold |= 0x2; if (i == 0) continue; - printf("%s%d at vba%d csr %x\n", + printf("%s%d at vba%d csr %x ", udp->ud_mname, um->um_ctlr, vban, addr); + if (cvec < 0 && vhp->vh_lastiv == cvec) { + printf("no space for vector(s)\n"); + continue; + } + if (cvec == SCB_LASTIV) { + printf("didn't interrupt\n"); + continue; + } + printf("vec %x, ipl %x\n", cvec, br); um->um_alive = 1; um->um_vbanum = vban; um->um_addr = (caddr_t)reg; udp->ud_minfo[um->um_ctlr] = um; + for (ivec = um->um_intr; *ivec; ivec++) + ((long *)&scb)[cvec++] = *ivec; for (ui = vbdinit; ui->ui_driver; ui++) { if (ui->ui_driver != udp || ui->ui_alive || ui->ui_ctlr != um->um_ctlr && ui->ui_ctlr != '?' || @@ -134,12 +202,14 @@ vbafind(vban, vumem, memmap) ui->ui_ctlr = um->um_ctlr; ui->ui_vbanum = vban; ui->ui_addr = (caddr_t)reg; - ui->ui_physaddr = (caddr_t)IOBASE + (addr&0x0fffff); + ui->ui_physaddr = + (caddr_t)IOBASE + (addr&0x0fffff); if (ui->ui_dk && dkn < DK_NDRIVE) ui->ui_dk = dkn++; else ui->ui_dk = -1; ui->ui_mi = um; + ui->ui_hd = vhp; /* ui_type comes from driver */ udp->ud_dinfo[ui->ui_unit] = ui; printf("%s%d at %s%d slave %d\n", @@ -149,6 +219,8 @@ vbafind(vban, vumem, memmap) (*udp->ud_attach)(ui); } } + break; + } } /* * Now look for non-mass storage peripherals. @@ -158,14 +230,31 @@ vbafind(vban, vumem, memmap) ui->ui_alive || ui->ui_slave != -1) continue; addr = (long)ui->ui_addr; + for (ap = udp->ud_addr; addr || (addr = *ap++); addr = 0) { reg = vbaddr(addr); - if (badaddr((caddr_t)reg, 2)) - continue; - i = (*udp->ud_probe)(reg); + ui->ui_hd = vhp; + cvec = SCB_LASTIV, cold &= ~0x2; + i = (*udp->ud_probe)(reg, ui); + cold |= 0x2; if (i == 0) continue; - printf("%s%d at vba%d csr %x\n", + printf("%s%d at vba%d csr %x ", ui->ui_driver->ud_dname, ui->ui_unit, vban, addr); + if (cvec < 0 && vhp->vh_lastiv == cvec) { + printf("no space for vector(s)\n"); + continue; + } + if (cvec == SCB_LASTIV) { + printf("didn't interrupt\n"); + continue; + } + printf("vec %x, ipl %x\n", cvec, br); +#ifdef notdef + while (--i >= 0) + vballoc[vbaoff(addr+i)] = 1; +#endif + for (ivec = ui->ui_intr; *ivec; ivec++) + ((long *)&scb)[cvec++] = *ivec; ui->ui_alive = 1; ui->ui_vbanum = vban; ui->ui_addr = (caddr_t)reg; @@ -174,11 +263,11 @@ vbafind(vban, vumem, memmap) /* ui_type comes from driver */ udp->ud_dinfo[ui->ui_unit] = ui; (*udp->ud_attach)(ui); + break; + } } } - -#define MAXDUMP (8*1024) /* * Configure swap space and related parameters. */ @@ -187,15 +276,15 @@ swapconf() register struct swdevt *swp; register int nblks; - for (swp = swdevt; swp->sw_dev; swp++) { - if (bdevsw[major(swp->sw_dev)].d_psize) + for (swp = swdevt; swp->sw_dev; swp++) + if (bdevsw[major(swp->sw_dev)].d_psize) { nblks = (*bdevsw[major(swp->sw_dev)].d_psize)(swp->sw_dev); - if (swp->sw_nblks == 0 || swp->sw_nblks > nblks) - swp->sw_nblks = nblks; - } + if (swp->sw_nblks == 0 || swp->sw_nblks > nblks) + swp->sw_nblks = nblks; + } if (dumplo == 0 && bdevsw[major(dumpdev)].d_psize) - dumplo = (*bdevsw[major(dumpdev)].d_psize)(dumpdev) - MAXDUMP; + dumplo = (*bdevsw[major(dumpdev)].d_psize)(dumpdev) - physmem; if (dumplo < 0) dumplo = 0; } diff --git a/usr/src/sys/tahoe/tahoe/genassym.c b/usr/src/sys/tahoe/tahoe/genassym.c index 4788eb76cf..a696e13390 100644 --- a/usr/src/sys/tahoe/tahoe/genassym.c +++ b/usr/src/sys/tahoe/tahoe/genassym.c @@ -1,8 +1,9 @@ #ifndef lint -static char sccsid[] = "@(#)genassym.c 1.2 (Berkeley) %G%"; +static char sccsid[] = "@(#)genassym.c 1.3 (Berkeley) %G%"; #endif #include "../tahoe/pte.h" +#include "../tahoe/scb.h" #include "param.h" #include "vmmeter.h" @@ -23,6 +24,7 @@ main() register struct proc *p = (struct proc *)0; register struct vmmeter *vm = (struct vmmeter *)0; register struct pcb *pcb = (struct pcb *)0; + register struct scb *scb = (struct scb *)0; printf("#ifdef LOCORE\n"); printf("#define\tU_PROCP %d\n", &u->u_procp); @@ -47,6 +49,7 @@ main() printf("#define\tV_TRAP %d\n", &vm->v_trap); printf("#define\tV_SYSCALL %d\n", &vm->v_syscall); printf("#define\tV_INTR %d\n", &vm->v_intr); + printf("#define\tV_SOFT %d\n", &vm->v_soft); printf("#define\tNBPG %d\n", NBPG); printf("#define\tPGSHIFT %d\n", PGSHIFT); printf("#define\tUPAGES %d\n", UPAGES); @@ -92,5 +95,9 @@ main() printf("#define\tPCB_CMAP2 %d\n", &pcb->pcb_cmap2); printf("#define\tPCB_SSWAP %d\n", &pcb->pcb_sswap); printf("#define\tPCB_SIGC %d\n", pcb->pcb_sigc); + printf("#define\tSCB_DOADUMP %d\n", &scb->scb_doadump); + printf("#define\tSCB_BUSERR %d\n", &scb->scb_buserr); +#define SCB_DEVBASE (((int)((struct scb *)0)->scb_devint)/sizeof (int)) + printf("#define\tSCB_DEVBASE %d\n", SCB_DEVBASE); printf("#endif\n"); } diff --git a/usr/src/sys/tahoe/tahoe/locore.s b/usr/src/sys/tahoe/tahoe/locore.s index dab45df0e5..a32cbe9f05 100644 --- a/usr/src/sys/tahoe/tahoe/locore.s +++ b/usr/src/sys/tahoe/tahoe/locore.s @@ -1,4 +1,4 @@ -/* locore.s 1.2 86/01/05 */ +/* locore.s 1.3 86/01/12 */ #include "../tahoe/mtpr.h" #include "../tahoe/trap.h" @@ -13,13 +13,10 @@ #include "syscall.h" #include "cmap.h" - .set HIGH,0x1f # mask for total disable - .set BERVEC,0x80 # offset into scb of the bus error vector - .set RESTVEC,0x8 # offset into scb of the restart vector - - .set NISP,3 # number of interrupt stack pages - .set SYSTEM,0xC0000000 # virtual address of system start - .set PPAGES,0x100000 # Number of possible pages in P0,P1, etc. + .set HIGH,0x1f # mask for total disable + .set NISP,3 # number of interrupt stack pages + .set SYSTEM,0xC0000000 # virtual address of system start + .set PPAGES,0x100000 # possible pages in P0,P1, etc. /* ACBL for non-negative '_add' */ #define ACBL(_limit,_add,_index,_displ) \ @@ -200,7 +197,7 @@ _X/**/name #define MSG(msg) .data; 1: .asciz msg; .text /* * r0-r2 are saved across all faults and interrupts. - * Routines below and those hidden in ubglue.s (device + * Routines below and those hidden in vbglue.s (device * interrupts) invoke the PUSHR/POPR macros to execute * this. Also, certain stack frame offset calculations * (such as in hardclock) understand this, using the @@ -309,25 +306,25 @@ SCBVEC(buserr): SCBVEC(powfail): # We should be on interrupt stack now. SAVEpwfl() # save machine state - moval _Xdoadump-SYSTEM,_scb+RESTVEC + moval _Xdoadump-SYSTEM,_scb+SCB_DOADUMP halt SCBVEC(stray): - PUSHR; PRINTF(0, "stray interrupt\n"); POPR; rei #include "../net/netisr.h" .globl _netisr SCBVEC(netintr): CHECK_SFE(4) - SAVE_FPSTAT(4) - PUSHR - bbc $NETISR_RAW,_netisr,1f - andl2 $~(1< 0 + bbc $NETISR_IMP,_netisr,1f; + andl2 $~(1<scb_devint) / \ + sizeof (((struct scb *)0)->scb_devint[0])) + +#ifdef KERNEL +extern struct scb scb; +#endif diff --git a/usr/src/sys/tahoe/tahoe/scb.s b/usr/src/sys/tahoe/tahoe/scb.s index 4eebcc5e54..e4c9e6c9e7 100644 --- a/usr/src/sys/tahoe/tahoe/scb.s +++ b/usr/src/sys/tahoe/tahoe/scb.s @@ -1,15 +1,10 @@ -/* scb.s 1.1 86/01/05 */ -/* scb.s TAHOE 4.2 version 84/03/1 */ +/* scb.s 1.2 86/01/12 */ /* * System control block */ - - -#define _Xnull 0 #define STRAY .long _Xstray #define STRAY8 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY -#define STRAY15 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY8 #define KS(a) .long _X/**/a #define IS(a) .long _X/**/a @@ -18,10 +13,10 @@ _scb: .globl _scb /* 004 */ STRAY; STRAY; STRAY; IS(hardclock); /* 008 */ STRAY; STRAY; IS(cnrint); IS(cnxint); /* 00c */ IS(rmtrint); IS(rmtxint); STRAY; STRAY; -/* 010 */ IS(soft15); IS(soft14); IS(soft13); IS(netintr); -/* 014 */ IS(soft11); IS(soft10); IS(soft9); IS(softclock); -/* 018 */ IS(soft7); IS(soft6); IS(soft5); IS(soft4); -/* 01c */ IS(soft3); IS(soft2); IS(soft1); STRAY; +/* 010 */ STRAY; STRAY; STRAY; IS(netintr); +/* 014 */ STRAY; STRAY; STRAY; IS(softclock); +/* 018 */ STRAY; STRAY; STRAY; STRAY; +/* 01c */ STRAY; STRAY; STRAY; STRAY; /* 020 */ IS(buserr); STRAY; STRAY; STRAY; /* 024 */ STRAY; STRAY; STRAY; STRAY; /* 028 */ STRAY; STRAY; STRAY; KS(syscall); @@ -30,116 +25,10 @@ _scb: .globl _scb /* 034 */ KS(arithtrap); KS(alignflt); KS(sfexcep); KS(fpm); /* 038 */ STRAY; STRAY; STRAY; STRAY; /* 03c */ STRAY; STRAY; STRAY; STRAY; -#include "vx.h" -#if NVX > 0 -/* 040 */ IS(vackint0); IS(vcmdrsp0); IS(vunsol0); STRAY; -#else -/* 040 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 1 -/* 044 */ IS(vackint1); IS(vcmdrsp1); IS(vunsol1); STRAY; -#else -/* 044 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 2 -/* 048 */ IS(vackint2); IS(vcmdrsp2); IS(vunsol2); STRAY; -#else -/* 048 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 3 -/* 04c */ IS(vackint3); IS(vcmdrsp3); IS(vunsol3); STRAY; -#else -/* 04c */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 4 -/* 050 */ IS(vackint4); IS(vcmdrsp4); IS(vunsol4); STRAY; -#else -/* 050 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 5 -/* 054 */ IS(vackint5); IS(vcmdrsp5); IS(vunsol5); STRAY; -#else -/* 054 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 6 -/* 058 */ IS(vackint6); IS(vcmdrsp6); IS(vunsol6); STRAY; -#else -/* 058 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 7 -/* 05c */ IS(vackint7); IS(vcmdrsp7); IS(vunsol7); STRAY; -#else -/* 05c */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 8 -/* 060 */ IS(vackint8); IS(vcmdrsp8); IS(vunsol8); STRAY; -#else -/* 060 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 9 -/* 064 */ IS(vackint9); IS(vcmdrsp9); IS(vunsol9); STRAY; -#else -/* 064 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 10 -/* 068 */ IS(vackint10); IS(vcmdrsp10); IS(vunsol10); STRAY; -#else -/* 068 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 11 -/* 06c */ IS(vackint11); IS(vcmdrsp11); IS(vunsol11); STRAY; -#else -/* 06c */ STRAY; STRAY; STRAY; STRAY; -#endif -/* 070 */ STRAY; STRAY15; -#include "cy.h" -#if NCY > 0 -/* 080 */ IS(cyintr0); STRAY15; -#else -/* 080 */ STRAY; STRAY15; -#endif -#include "ace.h" -#if NACE > 0 -/* 090 */ IS(acecint0); IS(acerint0); STRAY; STRAY; -#else -/* 090 */ STRAY; STRAY; STRAY; STRAY; -#endif -/* 094 */ STRAY; STRAY; STRAY; STRAY; -#if NACE > 1 -/* 098 */ IS(acecint1); IS(acerint1); STRAY; STRAY; -#else -/* 098 */ STRAY; STRAY; STRAY; STRAY; -#endif -/* 09c */ STRAY; STRAY; STRAY; STRAY; -/* 0a0 */ STRAY; STRAY15; -/* 0b0 */ STRAY; STRAY15; -/* 0c0 */ STRAY; STRAY15; -/* 0d0 */ STRAY; STRAY15; -#include "fsd.h" -#if NVD > 0 -/* 0e0 */ IS(vdintr0); -#else -/* 0e0 */ STRAY; -#endif -#if NVD > 1 -/* 0e4 */ IS(vdintr1); -#else -/* 0e4 */ STRAY; -#endif -#if NVD > 2 -/* 0e8 */ IS(vdintr2); -#else -/* 0e8 */ STRAY; -#endif -#if NVD > 3 -/* 0ec */ IS(vdintr3); -#else -/* 0ec */ STRAY; -#endif - -/* 0e4 */ STRAY; STRAY; STRAY; STRAY; -/* 0e8 */ STRAY8; -/* 0f0 */ STRAY; STRAY; STRAY; STRAY; -/* 0f4 */ STRAY; STRAY; STRAY; STRAY; -/* 0f8 */ STRAY; STRAY; STRAY; STRAY; -/* 0fC */ STRAY; STRAY; STRAY; STRAY; + /* device interrupt vectors */ +/* 040 */ STRAY8; STRAY8; STRAY8; STRAY8; +/* 060 */ STRAY8; STRAY8; STRAY8; STRAY8; +/* 080 */ STRAY8; STRAY8; STRAY8; STRAY8; +/* 0a0 */ STRAY8; STRAY8; STRAY8; STRAY8; +/* 0c0 */ STRAY8; STRAY8; STRAY8; STRAY8; +/* 0e0 */ STRAY8; STRAY8; STRAY8; STRAY8; diff --git a/usr/src/sys/tahoe/tahoe/vm_machdep.c b/usr/src/sys/tahoe/tahoe/vm_machdep.c index 46cf9974b0..b9a5727497 100644 --- a/usr/src/sys/tahoe/tahoe/vm_machdep.c +++ b/usr/src/sys/tahoe/tahoe/vm_machdep.c @@ -1,4 +1,4 @@ -/* vm_machdep.c 1.2 86/01/05 */ +/* vm_machdep.c 1.3 86/01/12 */ #include "../machine/pte.h" @@ -60,12 +60,15 @@ mapout(pte, size) /* * Check for valid program size + * NB - Check data and data growth separately as they may overflow + * when summed together. */ chksize(ts, ids, uds, ss) register unsigned ts, ids, uds, ss; { + extern int maxtsize; - if (ts > maxtsize || + if (ctob(ts) > maxtsize || ctob(ids) > u.u_rlimit[RLIMIT_DATA].rlim_cur || ctob(uds) > u.u_rlimit[RLIMIT_DATA].rlim_cur || ctob(ids + uds) > u.u_rlimit[RLIMIT_DATA].rlim_cur || @@ -223,8 +226,10 @@ vtopte(p, v) if ((v & 0x300000) == 0x300000) return (struct pte *)(mfpr(SBR) + 0xc0000000 + (v&0xfffff)*4); - if (p == 0) + if (p == 0) { + printf("vtopte v %x\n", v); /* XXX */ panic("vtopte (no proc)"); + } if (v < p->p_tsize + p->p_dsize) return (p->p_p0br + v); return (p->p_p0br + (p->p_szpt*NPTEPG + v - (BTOPUSRSTACK + UPAGES)));