BSD 4_4 release
[unix-history] / usr / src / sys / vax / vax / Locore.c
index 5be66d0..dd95de5 100644 (file)
@@ -1,47 +1,46 @@
 /*
 /*
- * Copyright (c) 1982 Regents of the University of California.
+ * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)Locore.c    6.10 (Berkeley) %G%
+ *     @(#)Locore.c    7.6 (Berkeley) 12/16/90
  */
 
 #include "dz.h"
 #include "mba.h"
 #include "uba.h"
  */
 
 #include "dz.h"
 #include "mba.h"
 #include "uba.h"
+#include "imp.h"
 
 
-#include "pte.h"
-
-#include "param.h"
-#include "systm.h"
-#include "dir.h"
-#include "user.h"
-#include "vm.h"
-#include "ioctl.h"
-#include "tty.h"
-#include "proc.h"
-#include "buf.h"
-#include "msgbuf.h"
-#include "mbuf.h"
-#include "protosw.h"
-#include "domain.h"
-#include "map.h"
-
+#include "../include/pte.h"
+
+#include "sys/param.h"
+#include "sys/systm.h"
+#include "sys/user.h"
+#include "sys/vm.h"
+#include "sys/ioctl.h"
+#include "sys/tty.h"
+#include "sys/proc.h"
+#include "sys/buf.h"
+#include "sys/msgbuf.h"
+#include "sys/mbuf.h"
+#include "sys/protosw.h"
+#include "sys/domain.h"
+#include "sys/map.h"
+#include "sys/dkbad.h"
+
+#include "scb.h"
 #include "nexus.h"
 #include "ioa.h"
 #include "nexus.h"
 #include "ioa.h"
-#include "ka630.h"
-#include "../vaxuba/ubavar.h"
-#include "../vaxuba/ubareg.h"
+#include "../uba/ubavar.h"
+#include "../uba/ubareg.h"
 
 /*
  * Pseudo file for lint to show what is used/defined in locore.s.
  */
 
 
 /*
  * Pseudo file for lint to show what is used/defined in locore.s.
  */
 
-struct scb scb;
-int    (*UNIvec[128])();
-#if NUBA > 1
-int    (*UNI1vec[128])();
-#endif
+struct scb scb[1];
+int    (*UNIvec[NUBA][128])();         /* unibus vec for ubas */
+int    (*eUNIvec)();                   /* end of unibus vec */
 struct rpb rpb;
 int    dumpflag;
 int    intstack[3*NBPG];
 struct rpb rpb;
 int    dumpflag;
 int    intstack[3*NBPG];
@@ -53,15 +52,17 @@ int szicode = sizeof (icode);
  * Variables declared for savecore, or
  * implicitly, such as by config or the loader.
  */
  * Variables declared for savecore, or
  * implicitly, such as by config or the loader.
  */
-char   version[] = "4.2 BSD UNIX ....";
+char   version[] = "4.3 BSD UNIX ....";
 int    etext;
 
 doadump() { dumpsys(); }
 
 int    etext;
 
 doadump() { dumpsys(); }
 
+#if NMBA > 0
 Xmba3int() { }
 Xmba2int() { }
 Xmba1int() { }
 Xmba0int() { }
 Xmba3int() { }
 Xmba2int() { }
 Xmba1int() { }
 Xmba0int() { }
+#endif
 
 lowinit()
 {
 
 lowinit()
 {
@@ -73,13 +74,9 @@ lowinit()
        extern int arptab_size;
        extern int dk_ndrive;
        extern struct domain unixdomain;
        extern int arptab_size;
        extern int dk_ndrive;
        extern struct domain unixdomain;
-#ifdef PUP
-       extern struct domain pupdomain;
-#endif
 #ifdef INET
        extern struct domain inetdomain;
 #endif
 #ifdef INET
        extern struct domain inetdomain;
 #endif
-#include "imp.h"
 #if NIMP > 0
        extern struct domain impdomain;
 #endif
 #if NIMP > 0
        extern struct domain impdomain;
 #endif
@@ -90,10 +87,6 @@ lowinit()
        /* cpp messes these up for lint so put them here */
        unixdomain.dom_next = domains;
        domains = &unixdomain;
        /* cpp messes these up for lint so put them here */
        unixdomain.dom_next = domains;
        domains = &unixdomain;
-#ifdef PUP
-       pupdomain.dom_next = domains;
-       domains = &pupdomain;
-#endif
 #ifdef INET
        inetdomain.dom_next = domains;
        domains = &inetdomain;
 #ifdef INET
        inetdomain.dom_next = domains;
        domains = &inetdomain;
@@ -117,7 +110,7 @@ lowinit()
        lowinit();
        intstack[0] = intstack[1];
        rpb = rpb;
        lowinit();
        intstack[0] = intstack[1];
        rpb = rpb;
-       scb = scb;
+       scb[0] = scb[0];
        maxmem = physmem = freemem = 0;
        u = u;
        fixctlrmask();
        maxmem = physmem = freemem = 0;
        u = u;
        fixctlrmask();
@@ -129,10 +122,7 @@ lowinit()
         */
        panic("Machine check");
        printf("Write timeout");
         */
        panic("Machine check");
        printf("Write timeout");
-       (*UNIvec[0])();
-#if NUBA > 1
-       (*UNI1vec[0])();
-#endif
+       (*UNIvec[0][0])();
        ubaerror(0, (struct uba_hd *)0, 0, 0, (struct uba_regs *)0);
        cnrint(0);
        cnxint(0);
        ubaerror(0, (struct uba_hd *)0, 0, 0, (struct uba_regs *)0);
        cnrint(0);
        cnxint(0);
@@ -143,6 +133,13 @@ lowinit()
 #endif
 #if NMBA > 0
        mbintr(0);
 #endif
 #if NMBA > 0
        mbintr(0);
+#endif
+#if VAX8200                    /* XXX wrong conditional */
+       bi_buserr(0);
+#endif
+#if VAX8200
+       rxcdintr();
+       rx50intr();
 #endif
        hardclock((caddr_t)0, 0);
        softclock((caddr_t)0, 0);
 #endif
        hardclock((caddr_t)0, 0);
        softclock((caddr_t)0, 0);
@@ -155,13 +152,27 @@ lowinit()
 #ifdef NS
        nsintr();
 #endif
 #ifdef NS
        nsintr();
 #endif
+       machinecheck((caddr_t)0);
+       memerr();
 
 
+       /*
+        * Miscellaneous routines called from configurable
+        * drivers.
+        */
+       ubapurge((struct uba_ctlr *)0);
+       ubattydma(0);
+       (void) ubamem(0, 0, 16, 1);
+       (void) isbad((struct dkbad *)0, 0, 0, 0);
+       disksort((struct buf *)0, (struct buf *)0);
+       (void) uwritec((struct uio *)0);
+       (void) todr();
        if (vmemall((struct pte *)0, 0, (struct proc *)0, 0))
                return;         /* use value */
        if (vmemall((struct pte *)0, 0, (struct proc *)0, 0))
                return;         /* use value */
-       machinecheck((caddr_t)0);
-       memerr();
        boothowto = 0;
        dumpflag = 0; dumpflag = dumpflag;
        boothowto = 0;
        dumpflag = 0; dumpflag = dumpflag;
+#ifdef KADB
+       bootesym = 0; bootesym = bootesym;
+#endif
 #if !defined(GPROF)
        cp = (caddr_t)&etext;
        cp = cp;
 #if !defined(GPROF)
        cp = (caddr_t)&etext;
        cp = cp;
@@ -174,17 +185,21 @@ consdout() { }
 dzdma() { dzxint((struct tty *)0); }
 #endif
 
 dzdma() { dzxint((struct tty *)0); }
 #endif
 
-int    catcher[256];
+quad   catcher[128];
 int    cold = 1;
 
 Xustray() { }
 
 struct pte Sysmap[6*NPTEPG];
 int    cold = 1;
 
 Xustray() { }
 
 struct pte Sysmap[6*NPTEPG];
+#ifdef KADB
 char   Sysbase[6*NPTEPG*NBPG];
 char   Sysbase[6*NPTEPG*NBPG];
+#endif
 int    umbabeg;
 struct pte Nexmap[16][16];
 struct nexus nexus[MAXNNEXUS];
 int    umbabeg;
 struct pte Nexmap[16][16];
 struct nexus nexus[MAXNNEXUS];
+#if VAX8600
 struct pte Ioamap[MAXNIOA][IOAMAPSIZ/NBPG];
 struct pte Ioamap[MAXNIOA][IOAMAPSIZ/NBPG];
+#endif
 struct pte UMEMmap[NUBA][512];
 char   umem[NUBA][512*NBPG];
 int    umbaend;
 struct pte UMEMmap[NUBA][512];
 char   umem[NUBA][512*NBPG];
 int    umbaend;
@@ -212,18 +227,22 @@ struct    pte Mbmap[NMBCLUSTERS/CLSIZE];
 struct mbuf mbutl[NMBCLUSTERS*CLBYTES/sizeof (struct mbuf)];
 struct pte msgbufmap[CLSIZE];
 struct msgbuf msgbuf;
 struct mbuf mbutl[NMBCLUSTERS*CLBYTES/sizeof (struct mbuf)];
 struct pte msgbufmap[CLSIZE];
 struct msgbuf msgbuf;
-struct pte camap[32];
-#ifdef VAX630
-struct pte Clockmap[1];
-struct cldevice cldevice;
+struct pte kmempt[200], ekmempt[1];
+#if VAX8200
+struct pte RX50map[1];
+struct pte Ka820map[1];
+#endif
+#if VAX630
 struct pte Ka630map[1];
 struct pte Ka630map[1];
-struct ka630cpu ka630cpu;
 #endif
 #endif
-int    cabase, calimit;
-#ifdef unneeded
-char   caspace[32*NBPG];
+char   kmembase[100*NBPG];
+#if VAX8200 || VAX630
+struct pte Clockmap[1];
+#endif
+#ifdef NFS
+struct pte Nfsiomap[MAXPHYS/NBPG+1];
+char   nfsiobuf[MAXPHYS+NBPG];
 #endif
 #endif
-int    calimit;
 
 /*ARGSUSED*/
 badaddr(addr, len) caddr_t addr; int len; { return (0); }
 
 /*ARGSUSED*/
 badaddr(addr, len) caddr_t addr; int len; { return (0); }
@@ -334,10 +353,12 @@ mfpr(reg) int reg; { return (0); }
 /*ARGSUSED*/
 setjmp(lp) label_t *lp; { return (0); }
 
 /*ARGSUSED*/
 setjmp(lp) label_t *lp; { return (0); }
 
+#ifndef VAX630
 /*ARGSUSED*/
 scanc(size, cp, table, mask)
     unsigned size; char *cp, table[]; int mask;
 { return (0); }
 /*ARGSUSED*/
 scanc(size, cp, table, mask)
     unsigned size; char *cp, table[]; int mask;
 { return (0); }
+#endif
 
 /*ARGSUSED*/
 skpc(mask, size, cp) int mask; int size; char *cp; { return (0); }
 
 /*ARGSUSED*/
 skpc(mask, size, cp) int mask; int size; char *cp; { return (0); }