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); }