|
|
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: *
1.1.1.2 ! root 40: * from: @(#)machdep.c 7.4 (Berkeley) 5/5/91
! 41: * machdep.c,v 1.2 1993/05/22 07:59:10 cgd Exp
1.1 root 42: */
43:
44: #include "sys/param.h"
45:
46: /*
47: * Copy bytes within kernel
48: */
49: bcopy(from, to, count)
50: register caddr_t from, to;
51: register unsigned count;
52: {
53: while (count--)
54: *to++ = *from++;
55: }
56:
57: bzero(to, count)
58: register caddr_t to;
59: register unsigned count;
60: {
61: while (count--)
62: *to++ = 0;
63: }
64:
65: bcmp(s1, s2, len)
66: register char *s1, *s2;
67: register int len;
68: {
69: while (len--)
70: if (*s1++ != *s2++)
71: return (1);
72: return (0);
73: }
74:
75: trap(fp)
76: struct frame {
77: int dregs[8];
78: int aregs[8];
79: int whoknows;
80: short sr;
81: int pc;
82: short frame;
83: } *fp;
84: {
85: static int intrap = 0;
86:
87: if (intrap)
88: return;
89: intrap = 1;
90: printf("Got unexpected trap, vector = %x, ps = %x, pc = %x\n",
91: fp->frame&0xFFF, fp->sr, fp->pc);
92: printf("dregs: %x %x %x %x %x %x %x %x\n",
93: fp->dregs[0], fp->dregs[1], fp->dregs[2], fp->dregs[3],
94: fp->dregs[4], fp->dregs[5], fp->dregs[6], fp->dregs[7]);
95: printf("aregs: %x %x %x %x %x %x %x %x\n",
96: fp->aregs[0], fp->aregs[1], fp->aregs[2], fp->aregs[3],
97: fp->aregs[4], fp->aregs[5], fp->aregs[6], fp->aregs[7]);
98: intrap = 0;
99: }
100:
101: #ifdef ROMPRF
102: #define ROWS 46
103: #define COLS 128
104:
105: romputchar(c)
106: register int c;
107: {
108: static char buf[COLS];
109: static int col = 0, row = 0;
110: register int i;
111:
112: switch (c) {
113: case '\0':
114: break;
115: case '\r':
116: case '\n':
117: for (i = col; i < COLS-1; i++)
118: buf[i] = ' ';
119: buf[i] = '\0';
120: romout(row, buf);
121: col = 0;
122: if (++row == ROWS)
123: row = 0;
124: break;
125:
126: case '\t':
127: do {
128: romputchar(' ');
129: } while (col & 7);
130: break;
131:
132: default:
133: buf[col] = c;
134: if (++col == COLS-1)
135: romputchar('\n');
136: break;
137: }
138: }
139: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.