|
|
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 is only permitted until one year after the first shipment
11: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and
12: * binary forms are permitted provided that: (1) source distributions retain
13: * this entire copyright notice and comment, and (2) distributions including
14: * binaries display the following acknowledgement: This product includes
15: * software developed by the University of California, Berkeley and its
16: * contributors'' in the documentation or other materials provided with the
17: * distribution and in all advertising materials mentioning features or use
18: * of this software. Neither the name of the University nor the names of
19: * its contributors may be used to endorse or promote products derived from
20: * this software without specific prior written permission.
21: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
22: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
23: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
24: *
25: * from: Utah $Hdr: machdep.c 1.6 88/05/24$
26: *
27: * @(#)machdep.c 7.1 (Berkeley) 5/8/90
28: */
29:
30: #include "param.h"
31:
32: /*
33: * Copy bytes within kernel
34: */
35: bcopy(from, to, count)
36: register caddr_t from, to;
37: register unsigned count;
38: {
39: while (count--)
40: *to++ = *from++;
41: }
42:
43: bzero(to, count)
44: register caddr_t to;
45: register unsigned count;
46: {
47: while (count--)
48: *to++ = 0;
49: }
50:
51: bcmp(s1, s2, len)
52: register char *s1, *s2;
53: register int len;
54: {
55: while (len--)
56: if (*s1++ != *s2++)
57: return (1);
58: return (0);
59: }
60:
61: trap(fp)
62: struct frame {
63: int dregs[8];
64: int aregs[8];
65: int whoknows;
66: short sr;
67: int pc;
68: short frame;
69: } *fp;
70: {
71: static int intrap = 0;
72:
73: if (intrap)
74: return;
75: intrap = 1;
76: romprintf("Got unexpected trap, vector = %x, ps = %x, pc = %x\n",
77: fp->frame&0xFFF, fp->sr, fp->pc);
78: romprintf("dregs: %x %x %x %x %x %x %x %x\n",
79: fp->dregs[0], fp->dregs[1], fp->dregs[2], fp->dregs[3],
80: fp->dregs[4], fp->dregs[5], fp->dregs[6], fp->dregs[7]);
81: romprintf("aregs: %x %x %x %x %x %x %x %x\n",
82: fp->aregs[0], fp->aregs[1], fp->aregs[2], fp->aregs[3],
83: fp->aregs[4], fp->aregs[5], fp->aregs[6], fp->aregs[7]);
84: intrap = 0;
85: }
86:
87: nodev()
88: {
89: return(0);
90: }
91:
92: #ifdef ROMPRF
93: #define ROWS 46
94: #define COLS 128
95:
96: romputchar(c)
97: register int c;
98: {
99: static char buf[COLS];
100: static int col = 0, row = 0;
101: register int i;
102:
103: switch (c) {
104: case '\0':
105: break;
106: case '\r':
107: case '\n':
108: for (i = col; i < COLS-1; i++)
109: buf[i] = ' ';
110: buf[i] = '\0';
111: romout(row, buf);
112: col = 0;
113: if (++row == ROWS)
114: row = 0;
115: break;
116:
117: case '\t':
118: do {
119: romputchar(' ');
120: } while (col & 7);
121: break;
122:
123: default:
124: buf[col] = c;
125: if (++col == COLS-1)
126: romputchar('\n');
127: break;
128: }
129: }
130: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.