|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1988 University of Utah. ! 3: * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. ! 4: * All rights reserved. ! 5: * ! 6: * This code is derived from software contributed to Berkeley by ! 7: * the Systems Programming Group of the University of Utah Computer ! 8: * Science Department. ! 9: * ! 10: * Redistribution and use in source and binary forms, with or without ! 11: * modification, are permitted provided that the following conditions ! 12: * are met: ! 13: * 1. Redistributions of source code must retain the above copyright ! 14: * notice, this list of conditions and the following disclaimer. ! 15: * 2. Redistributions in binary form must reproduce the above copyright ! 16: * notice, this list of conditions and the following disclaimer in the ! 17: * documentation and/or other materials provided with the distribution. ! 18: * 3. All advertising materials mentioning features or use of this software ! 19: * must display the following acknowledgement: ! 20: * This product includes software developed by the University of ! 21: * California, Berkeley and its contributors. ! 22: * 4. Neither the name of the University nor the names of its contributors ! 23: * may be used to endorse or promote products derived from this software ! 24: * without specific prior written permission. ! 25: * ! 26: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ! 27: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ! 28: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ! 29: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ! 30: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ! 31: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ! 32: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! 33: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ! 34: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ! 35: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ! 36: * SUCH DAMAGE. ! 37: * ! 38: * from: Utah $Hdr: machdep.c 1.6 88/05/24$ ! 39: * ! 40: * @(#)machdep.c 7.4 (Berkeley) 5/5/91 ! 41: */ ! 42: ! 43: #include "sys/param.h" ! 44: ! 45: /* ! 46: * Copy bytes within kernel ! 47: */ ! 48: bcopy(from, to, count) ! 49: register caddr_t from, to; ! 50: register unsigned count; ! 51: { ! 52: while (count--) ! 53: *to++ = *from++; ! 54: } ! 55: ! 56: bzero(to, count) ! 57: register caddr_t to; ! 58: register unsigned count; ! 59: { ! 60: while (count--) ! 61: *to++ = 0; ! 62: } ! 63: ! 64: bcmp(s1, s2, len) ! 65: register char *s1, *s2; ! 66: register int len; ! 67: { ! 68: while (len--) ! 69: if (*s1++ != *s2++) ! 70: return (1); ! 71: return (0); ! 72: } ! 73: ! 74: trap(fp) ! 75: struct frame { ! 76: int dregs[8]; ! 77: int aregs[8]; ! 78: int whoknows; ! 79: short sr; ! 80: int pc; ! 81: short frame; ! 82: } *fp; ! 83: { ! 84: static int intrap = 0; ! 85: ! 86: if (intrap) ! 87: return; ! 88: intrap = 1; ! 89: printf("Got unexpected trap, vector = %x, ps = %x, pc = %x\n", ! 90: fp->frame&0xFFF, fp->sr, fp->pc); ! 91: printf("dregs: %x %x %x %x %x %x %x %x\n", ! 92: fp->dregs[0], fp->dregs[1], fp->dregs[2], fp->dregs[3], ! 93: fp->dregs[4], fp->dregs[5], fp->dregs[6], fp->dregs[7]); ! 94: printf("aregs: %x %x %x %x %x %x %x %x\n", ! 95: fp->aregs[0], fp->aregs[1], fp->aregs[2], fp->aregs[3], ! 96: fp->aregs[4], fp->aregs[5], fp->aregs[6], fp->aregs[7]); ! 97: intrap = 0; ! 98: } ! 99: ! 100: #ifdef ROMPRF ! 101: #define ROWS 46 ! 102: #define COLS 128 ! 103: ! 104: romputchar(c) ! 105: register int c; ! 106: { ! 107: static char buf[COLS]; ! 108: static int col = 0, row = 0; ! 109: register int i; ! 110: ! 111: switch (c) { ! 112: case '\0': ! 113: break; ! 114: case '\r': ! 115: case '\n': ! 116: for (i = col; i < COLS-1; i++) ! 117: buf[i] = ' '; ! 118: buf[i] = '\0'; ! 119: romout(row, buf); ! 120: col = 0; ! 121: if (++row == ROWS) ! 122: row = 0; ! 123: break; ! 124: ! 125: case '\t': ! 126: do { ! 127: romputchar(' '); ! 128: } while (col & 7); ! 129: break; ! 130: ! 131: default: ! 132: buf[col] = c; ! 133: if (++col == COLS-1) ! 134: romputchar('\n'); ! 135: break; ! 136: } ! 137: } ! 138: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.