|
|
1.1 root 1: /*
2: * var.c
3: *
4: * Coherent global variables.
5: */
6: #include <sys/coherent.h>
7: #include <sys/buf.h>
8: #include <sys/con.h>
9: #include <sys/inode.h>
10: #include <sys/mount.h>
11: #include <sys/proc.h>
12: #include <sys/ptrace.h>
13: #include <sys/seg.h>
14: #include <sys/timeout.h>
15: #include <sys/systab.h>
16: #include <sys/mmu.h>
17: #include <sys/clist.h>
18:
19:
20: int debflag = 0; /* coherent.h */
21:
22: int batflag; /* coherent.h */
23: int dev_loaded; /* coherent.h */
24: int outflag; /* coherent.h */
25: int ttyflag; /* coherent.h */
26: unsigned utimer; /* coherent.h */
27: long lbolt; /* coherent.h */
28: TIM stimer; /* coherent.h */
29: unsigned asize; /* coherent.h */
30: paddr_t clistp; /* coherent.h */
31: MAKESR(blockp, _blockp); /* coherent.h */
32: MAKESR(allocp, _allocp); /* coherent.h */
33: struct all *allkp; /* coherent.h */
34: #if USE_SLOT
35: int NSLOT = 64; /* coherent.h */
36: int slotsz = 64; /* coherent.h */
37: int * slotp; /* coherent.h */
38: #endif
39: unsigned total_mem; /* coherent.h */
40:
41: unsigned bufseqn; /* buf.h */
42: int bufneed; /* buf.h */
43: BUF swapbuf; /* buf.h */
44: BUF *bufl; /* buf.h */
45:
46: int cltwant; /* clist.h */
47: cmap_t cltfree; /* clist.h */
48:
49: INODE *inodep; /* inode.h */
50: INODE *acctip; /* inode.h */
51:
52: SYSMEM sysmem; /* mmu.h */
53: MOUNT *mountp; /* mount.h */
54:
55: #ifdef TRACER /* mwc_coherent.h */
56: unsigned t_errno = 0;
57: unsigned t_hal = 0;
58: unsigned t_piggy = 0;
59: unsigned t_vlad =0;
60: unsigned t_con =0;
61: unsigned t_msgq =0;
62: #endif /* TRACER */
63:
64: int ISTSIZE = 2048; /* sys/param.h */
65: int quantum; /* proc.h */
66: int disflag; /* proc.h */
67: int intflag; /* proc.h */
68: int cpid; /* proc.h */
69: #if QWAKEUP
70: int ntowake; /* proc.h */
71: #endif
72: GATE pnxgate; /* proc.h */
73: PROC procq; /* proc.h */
74: PROC *iprocp; /* proc.h */
75: PROC *eprocp; /* proc.h */
76: PROC *cprocp = &procq; /* proc.h */
77: PLINK linkq[NHPLINK]; /* proc.h */
78:
79: struct ptrace pts; /* ptrace.h */
80:
81: int sexflag; /* seg.h */
82: GATE seglink; /* seg.h */
83: #if MONITOR
84: int swmflag; /* seg.h */
85: #endif
86: SEG segswap; /* seg.h */
87: SEG segmq; /* seg.h */
88: SEG segdq; /* seg.h */
89: SEG segiom; /* seg.h */
90:
91: extern caddr_t aicodep;
92: extern caddr_t aicodes;
93:
94: char *icodep = (char *)&aicodep; /* coherent.h */
95: int icodes = (int)&aicodes; /* coherent.h */
96:
97: TIM * timq[256]; /* timeout.h */
98:
99: int vtactive;
100:
101: /*
102: * System call functions.
103: */
104: int unone();
105: int unull();
106: int uexit();
107: int ufork();
108: int uread();
109: int uwrite();
110: int uopen();
111: int uclose();
112: int uwait();
113: int ucreat();
114: int ulink();
115: int uunlink();
116: int uexece();
117: int uchdir();
118: int umknod();
119: int uchmod();
120: int uchown();
121: char *ubrk();
122: int ustat();
123: long ulseek();
124: int ugetpid();
125: int umount();
126: int uumount();
127: int usetuid();
128: int ugetuid();
129: int ustime();
130: int uptrace();
131: int ualarm();
132: int ufstat();
133: int upause();
134: int uutime();
135: int ustty();
136: int ugtty();
137: int uaccess();
138: int unice();
139: int usync();
140: int ukill();
141: int udup();
142: int upipe();
143: int utimes();
144: int utime();
145: int uprofil();
146: int usetgid();
147: int ugetgid();
148: int (*usigsys())();
149: int usload();
150: int usuload();
151: int uacct();
152: int ulock();
153: int uioctl();
154: int ugetegid();
155: int uumask();
156: int uchroot();
157: int ufcntl();
158: int usetpgrp();
159: int uulimit();
160: int ufcntl();
161: int upoll();
162: int upgrp();
163: int usysi86();
164: int umsgsys();
165: int ushmsys();
166: int uutssys();
167: int usemsys();
168: int urmdir();
169: int umkdir();
170: int ugetdents();
171: int ustatfs();
172: int ufstatfs();
173: int uadmin();
174: /*
175: * Added by hal 91/10/10.
176: * These are undocumented Xenix/V7 compatibility calls.
177: */
178: int ustty();
179: int ugtty();
180:
181: /*
182: * System call table.
183: */
184: int ucohcall();
185: struct systab cohcall = {
186: 6, INT, ucohcall
187: };
188: struct systab sysitab[NMICALL] ={
189: 0, INT, unone, /* 0 = ??? */
190: 1, INT, uexit, /* 1 = exit */
191: 0, INT, ufork, /* 2 = fork */
192: 3, INT, uread, /* 3 = read */
193: 3, INT, uwrite, /* 4 = write */
194: 3, INT, uopen, /* 5 = open */
195: 1, INT, uclose, /* 6 = close */
196: 3, INT, uwait, /* 7 = wait */
197: 2, INT, ucreat, /* 8 = creat */
198: 2, INT, ulink, /* 9 = link */
199: 1, INT, uunlink, /* 10 = unlink */
200: 0, INT, unone, /* 11 = exec */
201: 1, INT, uchdir, /* 12 = chdir */
202: 0, INT, utime, /* 13 = utime */
203: 3, INT, umknod, /* 14 = mknod */
204: 2, INT, uchmod, /* 15 = chmod */
205: 3, INT, uchown, /* 16 = chown */
206: 1, INT, ubrk, /* 17 = break */
207: 2, INT, ustat, /* 18 = stat */
208: 3, LONG, ulseek, /* 19 = lseek */
209: 0, INT, ugetpid, /* 20 = getpid */
210: 3, INT, umount, /* 21 = mount */
211: 1, INT, uumount, /* 22 = umount */
212: 1, INT, usetuid, /* 23 = setuid */
213: 0, INT, ugetuid, /* 24 = getuid */
214: 1, INT, ustime, /* 25 = stime */
215: 4, INT, uptrace, /* 26 = ptrace */
216: 1, INT, ualarm, /* 27 = alarm */
217: 2, INT, ufstat, /* 28 = fstat */
218: 0, INT, upause, /* 29 = pause */
219: 2, INT, uutime, /* 30 = utime */
220: 2, INT, ustty, /* 31 = ustty */
221: 2, INT, ugtty, /* 32 = ugtty */
222: 2, INT, uaccess, /* 33 = access */
223: 1, INT, unice, /* 34 = nice */
224: 4, INT, ustatfs, /* 35 = statfs */
225: 0, INT, usync, /* 36 = sync */
226: 2, INT, ukill, /* 37 = kill */
227: 4, INT, ufstatfs, /* 38 = ufstatfs */
228: 1, INT, upgrp, /* 39 = pgrp */
229: 0, LONG, unone, /* 40 = ??? */
230: 1, INT, udup, /* 41 = dup */
231: 0, INT, upipe, /* 42 = pipe */
232: 1, INT, utimes, /* 43 = times */
233: 4, INT, uprofil, /* 44 = profil */
234: 1, INT, ulock, /* 45 = lock */
235: 1, INT, usetgid, /* 46 = setgid */
236: 0, INT, ugetgid, /* 47 = getgid */
237: 2, INT, usigsys, /* 48 = signal */
238: 6, LONG, umsgsys, /* 49 = msgsys */
239: 5, LONG, usysi86, /* 50 = sysi86 */
240: 1, INT, uacct, /* 51 = acct */
241: 4, INT, ushmsys, /* 52 = shmsys */
242: 5, INT, usemsys, /* 53 = semsys */
243: 3, INT, uioctl, /* 54 = ioctl */
244: 3, INT, uadmin, /* 55 = uadmin */
245: 0, INT, unone, /* 56 = ??? */
246: 3, INT, uutssys, /* 57 = utssys */
247: 0, INT, unone, /* 58 = ??? */
248: 3, INT, uexece, /* 59 = exec */
249: 1, INT, uumask, /* 60 = umask */
250: 1, INT, uchroot, /* 61 = chroot */
251: 3, INT, ufcntl, /* 62 = fcntl */
252: 2, INT, uulimit, /* 63 = ulimit - n/i */
253: 0, INT, unone, /* 64 = ??? (sload) */
254: 0, INT, unone, /* 65 = ??? (suload */
255: 0, INT, unone, /* 66 = ??? (fcntl) */
256: 0, INT, unone, /* 67 = ??? (poll) */
257: 0, INT, unone, /* 68 = ??? (msgctl) */
258: 0, INT, unone, /* 69 = ??? (msgget) */
259: 0, INT, unone, /* 70 = ??? (msgrcv) */
260: 0, INT, unone, /* 71 = ??? (msgsnd) */
261: 0, LONG, unone, /* 72 = ??? (alarm2) */
262: 0, LONG, unone, /* 73 = tick */
263: 0, INT, unone, /* 74 = ??? */
264: 0, INT, unone, /* 75 = ??? */
265: 0, INT, unone, /* 76 = ??? */
266: 0, INT, unone, /* 77 = ??? */
267: 0, INT, unone, /* 78 = ??? */
268: 1, INT, urmdir, /* 79 = rmdir */
269: 2, INT, umkdir, /* 80 = mkdir */
270: 3, INT, ugetdents, /* 81 = getdents */
271: 0, INT, unone, /* 82 = ??? */
272: 0, INT, unone, /* 83 = ??? */
273: 0, INT, unone, /* 84 = ??? */
274: 0, INT, unone, /* 85 = ??? */
275: 0, INT, unone, /* 86 = ??? */
276: 3, INT, upoll, /* 87 = poll */
277: };
278:
279: /*
280: * System Calls Numbers of the form 0x??28, where 0x?? >= 0x01
281: * Assists the dispatching mechanism in i386/trap.c
282: */
283: int uchsize();
284: int unap();
285: int oftime();
286:
287: struct systab h28itab[] = {
288: 0, INT, unone, /* 0x0128 = locking */
289: 0, INT, unone, /* 0x0228 = creatsem */
290: 0, INT, unone, /* 0x0328 = opensem */
291: 0, INT, unone, /* 0x0428 = sigsem */
292: 0, INT, unone, /* 0x0528 = waitsem */
293: 0, INT, unone, /* 0x0628 = nbwaitsem */
294: 0, INT, unone, /* 0x0728 = rdchk */
295: 0, INT, unone, /* 0x0828 = ??? */
296: 0, INT, unone, /* 0x0928 = ??? */
297: 2, INT, uchsize, /* 0x0A28 = chsize */
298: 1, INT, oftime, /* 0x0B28 = ftime */
299: 1, INT, unap, /* 0x0C28 = nap */
300: 0, INT, unone, /* 0x0D28 = _sdget */
301: 0, INT, unone, /* 0x0E28 = sdfree */
302: 0, INT, unone, /* 0x0F28 = sdenter */
303: 0, INT, unone, /* 0x1028 = sdleave */
304: 0, INT, unone, /* 0x1128 = sdgetv */
305: 0, INT, unone, /* 0x1228 = sdwaitv */
306: };
307: /*
308: * Also
309: * 0x2028 = proctl
310: * 0x2128 = execseg
311: * 0x2228 = unexecseg
312: */
313:
314: extern CON nlcon;
315: int (*altclk)(); /* hook for polled devices */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.