1: /*
   2:  * Copyright (c) 1982, 1986 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)Locore.c	7.1 (Berkeley) 6/5/86
   7:  */
   8: 
   9: #include "dz.h"
  10: #include "mba.h"
  11: #include "uba.h"
  12: 
  13: #include "pte.h"
  14: 
  15: #include "param.h"
  16: #include "systm.h"
  17: #include "dir.h"
  18: #include "user.h"
  19: #include "vm.h"
  20: #include "ioctl.h"
  21: #include "tty.h"
  22: #include "proc.h"
  23: #include "buf.h"
  24: #include "msgbuf.h"
  25: #include "mbuf.h"
  26: #include "protosw.h"
  27: #include "domain.h"
  28: #include "map.h"
  29: 
  30: #include "nexus.h"
  31: #include "ioa.h"
  32: #include "ka630.h"
  33: #include "../vaxuba/ubavar.h"
  34: #include "../vaxuba/ubareg.h"
  35: 
  36: /*
  37:  * Pseudo file for lint to show what is used/defined in locore.s.
  38:  */
  39: 
  40: struct  scb scb;
  41: int (*UNIvec[128])();
  42: #if NUBA > 1
  43: int (*UNI1vec[128])();
  44: #endif
  45: struct  rpb rpb;
  46: int dumpflag;
  47: int intstack[3*NBPG];
  48: int masterpaddr;        /* p_addr of current process on master cpu */
  49: struct  user u;
  50: int icode[8];
  51: int szicode = sizeof (icode);
  52: /*
  53:  * Variables declared for savecore, or
  54:  * implicitly, such as by config or the loader.
  55:  */
  56: char    version[] = "4.2 BSD UNIX ....";
  57: int etext;
  58: 
  59: doadump() { dumpsys(); }
  60: 
  61: Xmba3int() { }
  62: Xmba2int() { }
  63: Xmba1int() { }
  64: Xmba0int() { }
  65: 
  66: lowinit()
  67: {
  68: #if !defined(GPROF)
  69:     caddr_t cp;
  70: #endif
  71:     extern int dumpmag;
  72:     extern int rthashsize;
  73:     extern int arptab_size;
  74:     extern int dk_ndrive;
  75:     extern struct domain unixdomain;
  76: #ifdef PUP
  77:     extern struct domain pupdomain;
  78: #endif
  79: #ifdef INET
  80:     extern struct domain inetdomain;
  81: #endif
  82: #include "imp.h"
  83: #if NIMP > 0
  84:     extern struct domain impdomain;
  85: #endif
  86: #ifdef NS
  87:     extern struct domain nsdomain;
  88: #endif
  89: 
  90:     /* cpp messes these up for lint so put them here */
  91:     unixdomain.dom_next = domains;
  92:     domains = &unixdomain;
  93: #ifdef PUP
  94:     pupdomain.dom_next = domains;
  95:     domains = &pupdomain;
  96: #endif
  97: #ifdef INET
  98:     inetdomain.dom_next = domains;
  99:     domains = &inetdomain;
 100: #endif
 101: #if NIMP > 0
 102:     impdomain.dom_next = domains;
 103:     domains = &impdomain;
 104: #endif
 105: #ifdef NS
 106:     nsdomain.dom_next = domains;
 107:     domains = &nsdomain;
 108: #endif
 109:     dumpmag = 0;            /* used only by savecore */
 110:     rthashsize = rthashsize;    /* used by netstat, etc. */
 111:     arptab_size = arptab_size;  /* used by arp command */
 112:     dk_ndrive = dk_ndrive;      /* used by vmstat, iostat, etc. */
 113: 
 114:     /*
 115: 	 * Pseudo-uses of globals.
 116: 	 */
 117:     lowinit();
 118:     intstack[0] = intstack[1];
 119:     rpb = rpb;
 120:     scb = scb;
 121:     maxmem = physmem = freemem = 0;
 122:     u = u;
 123:     fixctlrmask();
 124:     main(0);
 125:     Xustray();
 126: 
 127:     /*
 128: 	 * Routines called from interrupt vectors.
 129: 	 */
 130:     panic("Machine check");
 131:     printf("Write timeout");
 132:     (*UNIvec[0])();
 133: #if NUBA > 1
 134:     (*UNI1vec[0])();
 135: #endif
 136:     ubaerror(0, (struct uba_hd *)0, 0, 0, (struct uba_regs *)0);
 137:     cnrint(0);
 138:     cnxint(0);
 139:     consdin();
 140:     consdout();
 141: #if NDZ > 0
 142:     dzdma();
 143: #endif
 144: #if NMBA > 0
 145:     mbintr(0);
 146: #endif
 147:     hardclock((caddr_t)0, 0);
 148:     softclock((caddr_t)0, 0);
 149:     trap(0, 0, (unsigned)0, 0, 0);
 150:     syscall(0, 0, (unsigned)0, 0, 0);
 151:     rawintr();
 152: #ifdef INET
 153:     ipintr();
 154: #endif
 155: #ifdef NS
 156:     nsintr();
 157: #endif
 158: 
 159:     if (vmemall((struct pte *)0, 0, (struct proc *)0, 0))
 160:         return;     /* use value */
 161:     machinecheck((caddr_t)0);
 162:     memerr();
 163:     boothowto = 0;
 164:     dumpflag = 0; dumpflag = dumpflag;
 165: #if !defined(GPROF)
 166:     cp = (caddr_t)&etext;
 167:     cp = cp;
 168: #endif
 169: }
 170: 
 171: consdin() { }
 172: consdout() { }
 173: #if NDZ > 0
 174: dzdma() { dzxint((struct tty *)0); }
 175: #endif
 176: 
 177: int catcher[256];
 178: int cold = 1;
 179: 
 180: Xustray() { }
 181: 
 182: struct  pte Sysmap[6*NPTEPG];
 183: char    Sysbase[6*NPTEPG*NBPG];
 184: int umbabeg;
 185: struct  pte Nexmap[16][16];
 186: struct  nexus nexus[MAXNNEXUS];
 187: struct  pte Ioamap[MAXNIOA][IOAMAPSIZ/NBPG];
 188: struct  pte UMEMmap[NUBA][512];
 189: char    umem[NUBA][512*NBPG];
 190: int umbaend;
 191: struct  pte Usrptmap[USRPTSIZE];
 192: struct  pte usrpt[USRPTSIZE*NPTEPG];
 193: struct  pte Forkmap[UPAGES];
 194: struct  user forkutl;
 195: struct  pte Xswapmap[UPAGES];
 196: struct  user xswaputl;
 197: struct  pte Xswap2map[UPAGES];
 198: struct  user xswap2utl;
 199: struct  pte Swapmap[UPAGES];
 200: struct  user swaputl;
 201: struct  pte Pushmap[UPAGES];
 202: struct  user pushutl;
 203: struct  pte Vfmap[UPAGES];
 204: struct  user vfutl;
 205: struct  pte CMAP1;
 206: char    CADDR1[NBPG];
 207: struct  pte CMAP2;
 208: char    CADDR2[NBPG];
 209: struct  pte mmap[1];
 210: char    vmmap[NBPG];
 211: struct  pte Mbmap[NMBCLUSTERS/CLSIZE];
 212: struct  mbuf mbutl[NMBCLUSTERS*CLBYTES/sizeof (struct mbuf)];
 213: struct  pte msgbufmap[CLSIZE];
 214: struct  msgbuf msgbuf;
 215: struct  pte camap[32];
 216: #ifdef VAX630
 217: struct  pte Clockmap[1];
 218: struct  cldevice cldevice;
 219: struct  pte Ka630map[1];
 220: struct  ka630cpu ka630cpu;
 221: #endif
 222: int cabase, calimit;
 223: #ifdef unneeded
 224: char    caspace[32*NBPG];
 225: #endif
 226: int calimit;
 227: 
 228: /*ARGSUSED*/
 229: badaddr(addr, len) caddr_t addr; int len; { return (0); }
 230: 
 231: /*ARGSUSED*/
 232: ovbcopy(from, to, len) caddr_t from, to; unsigned len; { }
 233: copyinstr(udaddr, kaddr, maxlength, lencopied)
 234:     caddr_t udaddr, kaddr; u_int maxlength, *lencopied;
 235: { *kaddr = *udaddr; *lencopied = maxlength; return (0); }
 236: copyoutstr(kaddr, udaddr, maxlength, lencopied)
 237:     caddr_t kaddr, udaddr; u_int maxlength, *lencopied;
 238: { *udaddr = *kaddr; *lencopied = maxlength; return (0); }
 239: copystr(kfaddr, kdaddr, maxlength, lencopied)
 240:     caddr_t kfaddr, kdaddr; u_int maxlength, *lencopied;
 241: { *kdaddr = *kfaddr; *lencopied = maxlength; return (0); }
 242: 
 243: /*ARGSUSED*/
 244: copyin(udaddr, kaddr, n) caddr_t udaddr, kaddr; u_int n; { return (0); }
 245: /*ARGSUSED*/
 246: copyout(kaddr, udaddr, n) caddr_t kaddr, udaddr; u_int n; { return (0); }
 247: 
 248: /*ARGSUSED*/
 249: longjmp(lp) label_t *lp; { /*NOTREACHED*/ }
 250: 
 251: /*ARGSUSED*/
 252: savectx(lp) label_t *lp; { return (0); }
 253: 
 254: /*ARGSUSED*/
 255: setrq(p) struct proc *p; { }
 256: 
 257: /*ARGSUSED*/
 258: remrq(p) struct proc *p; { }
 259: 
 260: swtch() { if (whichqs) whichqs = 0; if (masterpaddr) masterpaddr = 0; }
 261: 
 262: /*ARGSUSED*/
 263: resume(pcbpf) unsigned pcbpf; { }
 264: 
 265: /*ARGSUSED*/
 266: fubyte(base) caddr_t base; { return (0); }
 267: #ifdef notdef
 268: /*ARGSUSED*/
 269: fuibyte(base) caddr_t base; { return (0); }
 270: #endif
 271: /*ARGSUSED*/
 272: subyte(base, i) caddr_t base; { return (0); }
 273: /*ARGSUSED*/
 274: suibyte(base, i) caddr_t base; { return (0); }
 275: /*ARGSUSED*/
 276: fuword(base) caddr_t base; { return (0); }
 277: /*ARGSUSED*/
 278: fuiword(base) caddr_t base; { return (0); }
 279: /*ARGSUSED*/
 280: suword(base, i) caddr_t base; { return (0); }
 281: /*ARGSUSED*/
 282: suiword(base, i) caddr_t base; { return (0); }
 283: 
 284: /*ARGSUSED*/
 285: copyseg(udaddr, pf)
 286:     caddr_t udaddr; unsigned pf;
 287: { CMAP1 = CMAP1; CADDR1[0] = CADDR1[0]; }
 288: 
 289: /*ARGSUSED*/
 290: clearseg(pf) unsigned pf; { CMAP2 = CMAP2; CADDR2[0] = CADDR2[0]; }
 291: 
 292: /*ARGSUSED*/
 293: useracc(udaddr, bcnt, rw) caddr_t udaddr; unsigned bcnt; { return (0); }
 294: 
 295: /*ARGSUSED*/
 296: kernacc(addr, bcnt, rw) caddr_t addr; unsigned bcnt; { return (0); }
 297: 
 298: /*ARGSUSED*/
 299: addupc(pc, prof, counts) int pc; struct uprof *prof; int counts; { }
 300: 
 301: /*
 302:  * Routines expanded by inline.
 303:  */
 304: spl0() { }
 305: splsoftclock() { return (0); }
 306: splnet() { return (0); }
 307: spl4() { return (0); }
 308: spl5() { return (0); }
 309: splbio() { return (0); }
 310: spltty() { return (0); }
 311: #ifdef notdef
 312: spl6() { return (0); }      /* not currently used */
 313: #endif
 314: splclock() { return (0); }
 315: spl7() { return (0); }
 316: splhigh() { return (0); }
 317: 
 318: /*ARGSUSED*/
 319: splx(s) int s; { }
 320: 
 321: /*ARGSUSED*/
 322: bcopy(from, to, len) caddr_t from, to; unsigned len; { }
 323: /*ARGSUSED*/
 324: bzero(base, count) caddr_t base; unsigned count; { }
 325: /*ARGSUSED*/
 326: blkclr(base, count) caddr_t base; unsigned count; { }
 327: 
 328: /*ARGSUSED*/
 329: /*VARARGS1*/
 330: mtpr(reg, v) int reg; { }
 331: /*ARGSUSED*/
 332: mfpr(reg) int reg; { return (0); }
 333: 
 334: /*ARGSUSED*/
 335: setjmp(lp) label_t *lp; { return (0); }
 336: 
 337: /*ARGSUSED*/
 338: scanc(size, cp, table, mask)
 339:     unsigned size; char *cp, table[]; int mask;
 340: { return (0); }
 341: 
 342: /*ARGSUSED*/
 343: skpc(mask, size, cp) int mask; int size; char *cp; { return (0); }
 344: 
 345: #ifdef notdef
 346: /*ARGSUSED*/
 347: locc(mask, size, cp) int mask; char *cp; unsigned size; { return (0); }
 348: #endif
 349: 
 350: /*ARGSUSED*/
 351: _insque(p, q) caddr_t p, q; { }
 352: /*ARGSUSED*/
 353: _remque(p) caddr_t p; { }
 354: 
 355: /*ARGSUSED*/
 356: ffs(v) long v; { return (0); }
 357: 
 358: #ifdef notdef
 359: imin(a, b) int a, b; { return (a < b ? a : b); }
 360: imax(a, b) int a, b; { return (a > b ? a : b); }
 361: unsigned min(a, b) u_int a, b; { return (a < b ? a : b); }
 362: unsigned max(a, b) u_int a, b; { return (a > b ? a : b); }
 363: #endif
 364: u_short ntohs(s) u_short s; { return ((u_short)s); }
 365: u_short htons(s) u_short s; { return ((u_short)s); }
 366: u_long ntohl(l) u_long l; { return ((u_long)l); }
 367: u_long htonl(l) u_long l; { return ((u_long)l); }

Defined functions

Xmba0int defined in line 64; used 1 times
Xmba1int defined in line 63; used 1 times
Xmba2int defined in line 62; used 1 times
Xmba3int defined in line 61; used 1 times
Xustray defined in line 180; used 1 times
_insque defined in line 351; used 1 times
_remque defined in line 353; used 1 times
addupc defined in line 299; used 3 times
bcopy defined in line 322; never used
blkclr defined in line 326; used 4 times
consdin defined in line 171; used 1 times
consdout defined in line 172; used 1 times
copyoutstr defined in line 236; used 1 times
copyseg defined in line 285; used 1 times
copystr defined in line 239; used 2 times
doadump defined in line 59; used 1 times
dzdma defined in line 174; used 2 times
ffs defined in line 356; never used
fubyte defined in line 266; used 2 times
fuibyte defined in line 269; used 1 times
fuiword defined in line 278; used 1 times
htonl defined in line 367; never used
htons defined in line 365; never used
imax defined in line 360; never used
imin defined in line 359; never used
kernacc defined in line 296; used 2 times
locc defined in line 347; never used
longjmp defined in line 249; used 1 times
lowinit defined in line 66; used 1 times
max defined in line 362; never used
mfpr defined in line 332; never used
min defined in line 361; never used
mtpr defined in line 330; never used
ntohl defined in line 366; never used
ntohs defined in line 364; never used
ovbcopy defined in line 232; used 4 times
remrq defined in line 258; used 2 times
resume defined in line 263; used 2 times
savectx defined in line 252; used 2 times
scanc defined in line 338; never used
skpc defined in line 343; never used
spl6 defined in line 312; used 2 times
spl7 defined in line 315; used 1 times
splsoftclock defined in line 305; used 1 times
splx defined in line 319; used 444 times
subyte defined in line 272; used 1 times
suibyte defined in line 274; used 1 times
suiword defined in line 282; used 2 times
suword defined in line 280; used 6 times

Defined variables

CADDR1 defined in line 206; used 4 times
CADDR2 defined in line 208; used 5 times
CMAP1 defined in line 205; used 3 times
CMAP2 defined in line 207; used 5 times
Clockmap defined in line 217; never used
Forkmap defined in line 193; never used
Ioamap defined in line 187; never used
Ka630map defined in line 219; never used
Mbmap defined in line 211; used 5 times
Nexmap defined in line 185; never used
Pushmap defined in line 201; never used
Swapmap defined in line 199; never used
Sysbase defined in line 183; never used
UMEMmap defined in line 188; never used
Vfmap defined in line 203; never used
Xswap2map defined in line 197; never used
Xswapmap defined in line 195; never used
cabase defined in line 222; never used
calimit defined in line 226; never used
camap defined in line 215; never used
caspace defined in line 224; never used
catcher defined in line 177; never used
cldevice defined in line 218; never used
cold defined in line 178; never used
dumpflag defined in line 46; used 3 times
  • in line 164(3)
etext defined in line 57; used 3 times
forkutl defined in line 194; used 11 times
icode defined in line 50; used 3 times
intstack defined in line 47; used 4 times
ka630cpu defined in line 220; used 1 times
masterpaddr defined in line 48; used 2 times
  • in line 260(2)
mbutl defined in line 212; used 2 times
mmap defined in line 209; used 6 times
msgbuf defined in line 214; never used
msgbufmap defined in line 213; never used
nexus defined in line 186; never used
pushutl defined in line 202; used 3 times
rpb defined in line 45; used 5 times
scb defined in line 40; used 3 times
swaputl defined in line 200; used 4 times
szicode defined in line 51; used 2 times
u defined in line 49; used 1466 times
umbabeg defined in line 184; never used
umbaend defined in line 190; never used
umem defined in line 189; never used
usrpt defined in line 192; used 1 times
version defined in line 56; never used
vfutl defined in line 204; used 2 times
vmmap defined in line 210; used 8 times
xswap2utl defined in line 198; used 1 times
xswaputl defined in line 196; used 1 times
Last modified: 1986-06-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3024
Valid CSS Valid XHTML 1.0 Strict