|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. ! 3: * All rights reserved. ! 4: * ! 5: * Redistribution is only permitted until one year after the first shipment ! 6: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and ! 7: * binary forms are permitted provided that: (1) source distributions retain ! 8: * this entire copyright notice and comment, and (2) distributions including ! 9: * binaries display the following acknowledgement: This product includes ! 10: * software developed by the University of California, Berkeley and its ! 11: * contributors'' in the documentation or other materials provided with the ! 12: * distribution and in all advertising materials mentioning features or use ! 13: * of this software. Neither the name of the University nor the names of ! 14: * its contributors may be used to endorse or promote products derived from ! 15: * this software without specific prior written permission. ! 16: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 17: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 18: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 19: * ! 20: * @(#)Locore.c 7.1 (Berkeley) 5/8/90 ! 21: */ ! 22: ! 23: #include "pte.h" ! 24: #include "cpu.h" ! 25: ! 26: #include "param.h" ! 27: #include "systm.h" ! 28: #include "user.h" ! 29: #include "vm.h" ! 30: #include "ioctl.h" ! 31: #include "tty.h" ! 32: #include "proc.h" ! 33: #include "buf.h" ! 34: #include "msgbuf.h" ! 35: #include "mbuf.h" ! 36: #include "protosw.h" ! 37: #include "domain.h" ! 38: #include "map.h" ! 39: #include "dkbad.h" ! 40: ! 41: /* ! 42: * Pseudo file for lint to show what is used/defined in locore.s. ! 43: */ ! 44: ! 45: int machineid; ! 46: int mmutype; ! 47: int ectype; ! 48: struct user u; ! 49: int icode[8]; ! 50: int szicode = sizeof (icode); ! 51: u_int lowram; ! 52: u_char ssir; ! 53: int Usrptsize; ! 54: ! 55: /* ! 56: * Variables declared for savecore, or ! 57: * implicitly, such as by config or the loader. ! 58: */ ! 59: char version[] = "4.3 BSD UNIX ...."; ! 60: int etext; ! 61: ! 62: doadump() { dumpsys(); doboot(); } ! 63: ! 64: lowinit() ! 65: { ! 66: #if !defined(GPROF) ! 67: caddr_t cp; ! 68: #endif ! 69: struct frame frame; ! 70: extern int dumpmag; ! 71: extern int rthashsize; ! 72: extern int arptab_size; ! 73: extern int dk_ndrive; ! 74: extern struct domain unixdomain; ! 75: #ifdef INET ! 76: extern struct domain inetdomain; ! 77: #endif ! 78: #include "imp.h" ! 79: #if NIMP > 0 ! 80: extern struct domain impdomain; ! 81: #endif ! 82: #ifdef NS ! 83: extern struct domain nsdomain; ! 84: #endif ! 85: ! 86: /* cpp messes these up for lint so put them here */ ! 87: unixdomain.dom_next = domains; ! 88: domains = &unixdomain; ! 89: #ifdef INET ! 90: inetdomain.dom_next = domains; ! 91: domains = &inetdomain; ! 92: #endif ! 93: #if NIMP > 0 ! 94: impdomain.dom_next = domains; ! 95: domains = &impdomain; ! 96: #endif ! 97: #ifdef NS ! 98: nsdomain.dom_next = domains; ! 99: domains = &nsdomain; ! 100: #endif ! 101: dumpmag = 0; /* used only by savecore */ ! 102: rthashsize = rthashsize; /* used by netstat, etc. */ ! 103: arptab_size = arptab_size; /* used by arp command */ ! 104: dk_ndrive = dk_ndrive; /* used by vmstat, iostat, etc. */ ! 105: ! 106: /* ! 107: * Pseudo-uses of globals. ! 108: */ ! 109: lowinit(); ! 110: machineid = machineid; ! 111: mmutype = mmutype; ! 112: ectype = ectype; ! 113: lowram = lowram; ! 114: ssir = ssir; ! 115: maxmem = physmem = freemem = 0; ! 116: u = u; ! 117: Usrptsize = Usrptsize; ! 118: main(0); ! 119: ! 120: /* ! 121: * Routines called from interrupt vectors. ! 122: */ ! 123: panic("Machine check"); ! 124: printf("Write timeout"); ! 125: hilint(); ! 126: if (dmaintr()) ! 127: return; ! 128: intrhand(0); ! 129: regdump((int *)0, 0); ! 130: hardclock((caddr_t)0, 0); ! 131: nmihand(frame); ! 132: softclock((caddr_t)0, 0); ! 133: trap(0, (unsigned)0, (unsigned)0, frame); ! 134: syscall(0, frame); ! 135: straytrap(0); ! 136: ! 137: /* ! 138: * Miscellaneous routines called from configurable ! 139: * drivers. ! 140: */ ! 141: disksort((struct buf *)0, (struct buf *)0); ! 142: if (vmemall((struct pte *)0, 0, (struct proc *)0, 0)) ! 143: return; /* use value */ ! 144: boothowto = 0; ! 145: /* dumpflag = 0; dumpflag = dumpflag; */ ! 146: #if !defined(GPROF) ! 147: cp = (caddr_t)&etext; ! 148: cp = cp; ! 149: #endif ! 150: } ! 151: ! 152: int cold = 1; ! 153: ! 154: struct pte Sysmap[SYSPTSIZE]; ! 155: struct pte Usrptmap[USRPTSIZE]; ! 156: int Usrptsize; ! 157: struct pte usrpt[USRPTSIZE*NPTEPG]; ! 158: struct pte Forkmap[UPAGES]; ! 159: struct user forkutl; ! 160: struct pte Xswapmap[UPAGES]; ! 161: struct user xswaputl; ! 162: struct pte Xswap2map[UPAGES]; ! 163: struct user xswap2utl; ! 164: struct pte Swapmap[UPAGES]; ! 165: struct user swaputl; ! 166: struct pte Pushmap[UPAGES]; ! 167: struct user pushutl; ! 168: struct pte Vfmap[UPAGES]; ! 169: struct user vfutl; ! 170: struct pte CMAP1; ! 171: char CADDR1[NBPG]; ! 172: struct pte CMAP2; ! 173: char CADDR2[NBPG]; ! 174: struct pte mmap[1]; ! 175: char vmmap[NBPG]; ! 176: struct pte Mbmap[NMBCLUSTERS/CLSIZE]; ! 177: char mbutl[NMBCLUSTERS][MCLBYTES]; ! 178: struct pte msgbufmap[CLSIZE]; ! 179: struct msgbuf msgbuf; ! 180: struct pte kmempt[200], ekmempt[1]; ! 181: int IObase; ! 182: struct pte Usriomap[USRIOSIZE]; ! 183: char usrio[USRIOSIZE*NBPG]; ! 184: struct ste Sysseg[NPTEPG]; ! 185: struct pte Grfmap[1024]; ! 186: char grfregs[1024*NBPG]; ! 187: ! 188: /*ARGSUSED*/ ! 189: ovbcopy(from, to, len) caddr_t from, to; unsigned len; { } ! 190: copyinstr(udaddr, kaddr, maxlength, lencopied) ! 191: caddr_t udaddr, kaddr; u_int maxlength, *lencopied; ! 192: { *kaddr = *udaddr; *lencopied = maxlength; return (0); } ! 193: copyoutstr(kaddr, udaddr, maxlength, lencopied) ! 194: caddr_t kaddr, udaddr; u_int maxlength, *lencopied; ! 195: { *udaddr = *kaddr; *lencopied = maxlength; return (0); } ! 196: copystr(kfaddr, kdaddr, maxlength, lencopied) ! 197: caddr_t kfaddr, kdaddr; u_int maxlength, *lencopied; ! 198: { *kdaddr = *kfaddr; *lencopied = maxlength; return (0); } ! 199: ! 200: /*ARGSUSED*/ ! 201: copyin(udaddr, kaddr, n) caddr_t udaddr, kaddr; u_int n; { return (0); } ! 202: /*ARGSUSED*/ ! 203: copyout(kaddr, udaddr, n) caddr_t kaddr, udaddr; u_int n; { return (0); } ! 204: ! 205: /*ARGSUSED*/ ! 206: longjmp(lp) label_t *lp; { /*NOTREACHED*/ } ! 207: ! 208: /*ARGSUSED*/ ! 209: savectx(lp) label_t *lp; { return (0); } ! 210: ! 211: /*ARGSUSED*/ ! 212: setrq(p) struct proc *p; { } ! 213: ! 214: /*ARGSUSED*/ ! 215: remrq(p) struct proc *p; { } ! 216: ! 217: swtch() { if (whichqs) whichqs = 0; } ! 218: ! 219: /*ARGSUSED*/ ! 220: resume(pcbpf) unsigned pcbpf; { } ! 221: ! 222: /*ARGSUSED*/ ! 223: fubyte(base) caddr_t base; { return (0); } ! 224: #ifdef notdef ! 225: /*ARGSUSED*/ ! 226: fuibyte(base) caddr_t base; { return (0); } ! 227: #endif ! 228: /*ARGSUSED*/ ! 229: subyte(base, i) caddr_t base; { return (0); } ! 230: /*ARGSUSED*/ ! 231: suibyte(base, i) caddr_t base; { return (0); } ! 232: /*ARGSUSED*/ ! 233: fuword(base) caddr_t base; { return (0); } ! 234: /*ARGSUSED*/ ! 235: fuiword(base) caddr_t base; { return (0); } ! 236: /*ARGSUSED*/ ! 237: suword(base, i) caddr_t base; { return (0); } ! 238: /*ARGSUSED*/ ! 239: suiword(base, i) caddr_t base; { return (0); } ! 240: ! 241: /*ARGSUSED*/ ! 242: copyseg(udaddr, pf) ! 243: caddr_t udaddr; unsigned pf; ! 244: { CMAP1 = CMAP1; CADDR1[0] = CADDR1[0]; } ! 245: ! 246: /*ARGSUSED*/ ! 247: clearseg(pf) unsigned pf; { CMAP2 = CMAP2; CADDR2[0] = CADDR2[0]; } ! 248: ! 249: TBIA() { } ! 250: /*ARGSUSED*/ ! 251: TBIS(addr) caddr_t addr; { } ! 252: TBIAS() { } ! 253: TBIAU() { } ! 254: ICIA() { } ! 255: DCIA() { } ! 256: DCIS() { } ! 257: DCIU() { } ! 258: PCIA() { } ! 259: ecacheon() { } ! 260: ecacheoff() { } ! 261: ! 262: getsfc() { return (0); } ! 263: getdfc() { return (0); } ! 264: ! 265: /*ARGSUSED*/ ! 266: loadustp(ustp) int ustp; { } ! 267: /*ARGSUSED*/ ! 268: flushustp(ustp) int ustp; { } ! 269: ! 270: /*ARGSUSED*/ ! 271: ploadw(addr) caddr_t addr; { } ! 272: ! 273: /*ARGSUSED*/ ! 274: addupc(pc, prof, counts) int pc; struct uprof *prof; int counts; { } ! 275: ! 276: spl0() { } ! 277: splsoftclock() { return (0); } ! 278: splnet() { return (0); } ! 279: spl1() { return (0); } ! 280: spl2() { return (0); } ! 281: spl3() { return (0); } ! 282: spl4() { return (0); } ! 283: splimp() { return (0); } ! 284: splbio() { return (0); } ! 285: spltty() { return (0); } ! 286: spl5() { return (0); } ! 287: splclock() { return (0); } ! 288: spl6() { return (0); } ! 289: splhigh() { return (0); } ! 290: spl7() { return (0); } ! 291: ! 292: /*ARGSUSED*/ ! 293: splx(s) int s; { } ! 294: ! 295: /*ARGSUSED*/ ! 296: _insque(p, q) caddr_t p, q; { } ! 297: /*ARGSUSED*/ ! 298: _remque(p) caddr_t p; { } ! 299: ! 300: /*ARGSUSED*/ ! 301: bcopy(from, to, len) caddr_t from, to; unsigned len; { } ! 302: /*ARGSUSED*/ ! 303: bzero(base, count) caddr_t base; unsigned count; { } ! 304: /*ARGSUSED*/ ! 305: blkclr(base, count) caddr_t base; unsigned count; { } ! 306: /*ARGSUSED*/ ! 307: bcmp(str1, str2, count) caddr_t str1, str2; unsigned count; { return (0); } ! 308: ! 309: /*ARGSUSED*/ ! 310: strlen(str) caddr_t str; { return (0); } ! 311: ! 312: /*ARGSUSED*/ ! 313: setjmp(lp) label_t *lp; { return (0); } ! 314: ! 315: /*ARGSUSED*/ ! 316: qsetjmp(lp) label_t *lp; { return (0); } ! 317: ! 318: /*ARGSUSED*/ ! 319: scanc(size, cp, table, mask) ! 320: unsigned size; u_char *cp, table[]; int mask; ! 321: { return (0); } ! 322: ! 323: /*ARGSUSED*/ ! 324: skpc(mask, size, cp) int mask; int size; char *cp; { return (0); } ! 325: ! 326: /*ARGSUSED*/ ! 327: locc(mask, size, cp) int mask; char *cp; unsigned size; { return (0); } ! 328: ! 329: /*ARGSUSED*/ ! 330: ffs(v) long v; { return (0); } ! 331: ! 332: #ifdef FPCOPROC ! 333: /*ARGSUSED*/ ! 334: m68881_save(fpframep) struct fpframe *fpframep; { } ! 335: /*ARGSUSED*/ ! 336: m68881_restore(fpframep) struct fpframe *fpframep; { } ! 337: #endif ! 338: ! 339: doboot() { /*NOTREACHED*/ }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.