1: #ifndef _WHOAMI
2: #include "whoami.h"
3: #endif
4: #ifndef NSIG
5: #include <signal.h>
6: #endif
7: #include <sys/psw.h>
8: #include <sys/types.h>
9: #include <sys/iopage.h>
10:
11: #ifdef UNIBUS_MAP
12: #define MAXMEM (200*16) /* max core per process - first # is Kb */
13: #else
14: #define MAXMEM (128*16) /* max core per process - first # is Kb */
15: #endif
16: #define MAXUPRC 20 /* max processes per user */
17: #define SSIZE 20 /* initial stack size (*64 bytes) */
18: #define SINCR 20 /* increment of stack (*64 bytes) */
19: #define NOFILE 20 /* max open files per process */
20: #define CANBSIZ 256 /* max size of typewriter line */
21: #define MSGBUFS 128 /* Characters saved from error messages */
22: #define NCARGS 5120 /* # characters in exec arglist */
23: #ifdef UCB_METER
24: #define MAXSLP 20 /* max time a process is considered sleeping */
25: #endif
26:
27: /*
28: * priorities
29: * probably should not be
30: * altered too much
31: */
32: #ifdef CGL_RTP
33: #define PRTP 0
34: #define PSWP 5
35: #else
36: #define PSWP 0
37: #endif
38: #define PINOD 10
39: #define PRIBIO 20
40: #define PZERO 25
41: #define PPIPE 26
42: #define PWAIT 30
43: #define PSLEP 40
44: #define PUSER 50
45:
46: #define NZERO 20
47:
48: /*
49: * fundamental constants of the implementation--
50: * cannot be changed easily
51: */
52:
53: #define NBPW sizeof(int) /* number of bytes in an integer */
54:
55: #define BSLOP 0 /* BSLOP can be 0 unless you have a TIU/Spider*/
56:
57: #ifndef UCB_NKB
58: #define BSIZE 512 /* size of secondary block (bytes) */
59: #define NINDIR (BSIZE/sizeof(daddr_t))
60: #define BMASK 0777 /* BSIZE-1 */
61: #define BSHIFT 9 /* LOG2(BSIZE) */
62: #define NMASK 0177 /* NINDIR-1 */
63: #define NSHIFT 7 /* LOG2(NINDIR) */
64: #endif
65:
66: #if UCB_NKB == 1
67: #define CLSIZE 2 /* number of blocks / cluster */
68: #define BSIZE 1024 /* size of secondary block (bytes) */
69: #define NINDIR (BSIZE/sizeof(daddr_t))
70: #define BMASK 01777 /* BSIZE-1 */
71: #define BSHIFT 10 /* LOG2(BSIZE) */
72: #define NMASK 0377 /* NINDIR-1 */
73: #define NSHIFT 8 /* LOG2(NINDIR) */
74: #endif
75:
76: #define UBSIZE 512 /* block size visible to users */
77: #ifdef UCB_QUOTAS
78: #define QCOUNT (BSIZE/UBSIZE) /* BSIZE must always be a multiple of UBSIZE */
79: #endif
80:
81: #ifndef UCB_NET
82: #define USIZE 16 /* size of user block (*64) */
83: #else
84: #define USIZE 32 /* size of user block (*64) */
85: #endif
86: #define NULL 0
87: #define CMASK 0 /* default mask for file creation */
88: #define NODEV (dev_t)(-1)
89: #define ROOTINO ((ino_t)2) /* i number of all roots */
90: #define SUPERB ((daddr_t)1) /* block number of the super block */
91: #define DIRSIZ 14 /* max characters per directory */
92:
93: #define NICINOD 100 /* number of superblock inodes */
94: #define NICFREE 50 /* number of superblock free blocks */
95:
96: #define CBSIZE 14 /* number of chars in a clist block */
97: /* CBSIZE+sizeof(int *) must be a power of 2 */
98: #define CROUND 017 /* clist rounding: sizeof(int *) + CBSIZE - 1*/
99:
100: #define PGSIZE 512 /* bytes per addressable disk sector */
101: #define PGSHIFT 9 /* LOG2(PGSIZE) */
102:
103: /*
104: * Some macros for units conversion
105: */
106:
107: /* Core clicks (64 bytes) to segments and vice versa */
108: #define ctos(x) (((x)+127)/128)
109: #define stoc(x) ((x)*128)
110:
111: /* Core clicks (64 bytes) to disk blocks */
112: #define ctod(x) (((x)+7)>>3)
113:
114: /* I number to disk address */
115: #ifndef UCB_NKB
116: #define itod(x) (daddr_t)((((unsigned)(x)+15)>>3))
117: #else
118: #define itod(x) ((daddr_t)((((unsigned)(x)+2*INOPB-1)/INOPB)))
119: #endif
120:
121: /* I number to disk offset */
122: #ifndef UCB_NKB
123: #define itoo(x) (int)(((x)+15)&07)
124: #else
125: #define itoo(x) ((int)(((x)+2*INOPB-1)%INOPB))
126: #endif
127:
128: #if UCB_NKB == 1
129: /* file system blocks to disk blocks and back */
130: #define fsbtodb(b) ((daddr_t)((daddr_t)(b)<<1))
131: #define dbtofsb(b) ((daddr_t)((daddr_t)(b)>>1))
132: #endif
133: #ifndef UCB_NKB
134: #define fsbtodb(b) ((daddr_t)(b))
135: #define dbtofsb(b) ((daddr_t)(b))
136: #endif
137:
138: #ifdef UCB_NKB
139: /* round a number of clicks up to a whole cluster */
140: #define clrnd(i) (((i) + (CLSIZE-1)) & ~(CLSIZE-1))
141: #endif
142:
143: /* clicks to bytes */
144: #define ctob(x) ((x)<<6)
145:
146: /* bytes to clicks */
147: #define btoc(x) ((((unsigned)(x)+63)>>6))
148:
149: /* low int of a long */
150: #define loint(l) ((int) (l) & 0177777)
151:
152: /* high int of a long */
153: #define hiint(l) ((int) ((l) >> 16))
154:
155: /*
156: * Machine-dependent bits and macros
157: */
158:
159: /*
160: * Treat PS as byte, to allow restoring value from mfps/movb
161: * (see :splfix.*)
162: */
163: #define PS_LOBYTE ((char *) 0177776)
164: #define splx(ops) (*PS_LOBYTE = ((char) (ops)))
165:
166: #ifndef MIN
167: #define MIN(a,b) (((a)<(b))? (a):(b))
168: #endif
169: #define MAX(a,b) (((a)>(b))? (a):(b))
170:
171: #ifdef UCB_NET
172: /*
173: * Return values from tsleep().
174: */
175: #define TS_OK 0 /* normal wakeup */
176: #define TS_TIME 1 /* timed-out wakeup */
177: #define TS_SIG 2 /* asynchronous signal wakeup */
178: #endif
Defined macros
BMASK
defined in line
70; used 7 times
BSIZE
defined in line
68; used 26 times
- in line 59,
69,
78
- in /usr/src/sys/GENERIC/param.c line
115
- in /usr/src/sys/dev/Others/bk.c line
157
- in /usr/src/sys/dev/Others/dmc.c line
28
- in /usr/src/sys/dev/Others/du.c line
145
- in /usr/src/sys/dev/bio.c line
82,
107,
120,
144,
459
- in /usr/src/sys/sys/machdep.c line
615
- in /usr/src/sys/sys/nami.c line
314
- in /usr/src/sys/sys/rdwri.c line
52,
78-83(2),
141,
158,
166
- in /usr/src/sys/sys/sys1.c line
119-122(3),
248-250(3)
BSLOP
defined in line
55; used 1 times
CMASK
defined in line
87; used 1 times
CROUND
defined in line
98; used 16 times
- in /usr/src/sys/sys/prim.c line
58,
64,
115,
121,
158,
221,
245,
286,
347,
382(2),
452,
508-516(4)
MAX
defined in line
169; used 6 times
MIN
defined in line
167; used 13 times
NBPW
defined in line
53; used 33 times
- in /usr/src/sys/dev/dvhp.c line
447,
516
- in /usr/src/sys/dev/hk.c line
608-613(2),
691
- in /usr/src/sys/dev/hp.badsect.c line
526-531(2),
603
- in /usr/src/sys/dev/hp.c line
456,
525
- in /usr/src/sys/dev/rm.badsect.c line
585-590(2),
662
- in /usr/src/sys/dev/rm.c line
490,
559
- in /usr/src/sys/dev/vp.c line
214
- in /usr/src/sys/dev/xp.badsect.c line
683-688(2),
763
- in /usr/src/sys/dev/xp.c line
604,
675
- in /usr/src/sys/sys/rdwri.c line
244
- in /usr/src/sys/sys/sys1.c line
178-183(4),
191-200(5),
231,
920
NMASK
defined in line
72; used 1 times
NODEV
defined in line
88; used 13 times
NULL
defined in line
86; used 505 times
- in /usr/src/sys/GENERIC/c.c line
48,
76,
93,
110,
127,
147,
172,
188,
205,
221,
241,
261,
288
- in /usr/src/sys/dev/Others/dc.c line
93
- in /usr/src/sys/dev/Others/dj.c line
37
- in /usr/src/sys/dev/Others/ft.c line
54,
80,
190
- in /usr/src/sys/dev/Others/ml.c line
114-121(3),
136,
181
- in /usr/src/sys/dev/Others/mx1.c line
59,
68,
81,
106-107(2),
113,
145(3),
159,
194,
201,
216,
223-225(2),
236,
243-247(2),
256,
267,
276,
285,
310,
320,
333,
341-345(2),
361-366(2),
380-382(2),
392,
402,
422-424(2),
433,
441,
472,
478-483(3),
508,
531-548(7),
556,
571,
581
- in /usr/src/sys/dev/Others/mx2.c line
50,
64,
76,
146-150(2),
157,
179,
188,
225(2),
259,
319(2),
340,
657(2),
666,
702-706(3),
738-744(3),
785,
805,
815,
833-834(2),
859-860(2),
896
- in /usr/src/sys/dev/Others/rx.c line
97-99(2),
114,
129,
160-162(2),
621
- in /usr/src/sys/dev/Others/rx2.c line
101,
116-121(2),
132-133(2),
175
- in /usr/src/sys/dev/Others/rx3.c line
238-240(2),
259
- in /usr/src/sys/dev/bio.c line
102,
127,
244,
276,
284,
367,
387
- in /usr/src/sys/dev/cary.c line
78
- in /usr/src/sys/dev/dh.c line
97
- in /usr/src/sys/dev/dn.c line
37
- in /usr/src/sys/dev/dsort.c line
20-29(5),
36-39(2)
- in /usr/src/sys/dev/dvhp.c line
62,
70,
82,
143,
195-196(2),
219-221(2)
- in /usr/src/sys/dev/dz.c line
87
- in /usr/src/sys/dev/hk.c line
134,
190,
238-239(2),
257-259(2)
- in /usr/src/sys/dev/hp.badsect.c line
77,
85,
97,
158,
247-248(2),
271-273(2)
- in /usr/src/sys/dev/hp.c line
62,
70,
82,
143,
207-208(2),
231-233(2)
- in /usr/src/sys/dev/hs.c line
46,
59
- in /usr/src/sys/dev/ht.c line
65,
73,
86,
200-202(2),
221,
301
- in /usr/src/sys/dev/rf.c line
34,
48-55(3),
66,
92,
98
- in /usr/src/sys/dev/rk.c line
40,
54-61(3),
74,
103,
109
- in /usr/src/sys/dev/rl.c line
62,
127-134(3),
144,
167,
227
- in /usr/src/sys/dev/rm.badsect.c line
85,
93,
105,
163,
245-246(2),
272-277(3)
- in /usr/src/sys/dev/rm.c line
74,
82,
94,
152,
209-210(2),
236-241(3)
- in /usr/src/sys/dev/rp.c line
51,
65-74(3),
88,
123,
129
- in /usr/src/sys/dev/sys.c line
19,
30,
42,
61,
72
- in /usr/src/sys/dev/tm.c line
114,
259-261(2),
284,
440
- in /usr/src/sys/dev/ts.c line
100,
211-213(2),
242,
350
- in /usr/src/sys/dev/ttynew.c line
85,
476,
508,
605,
678,
694
- in /usr/src/sys/dev/ttyold.c line
175,
336,
369,
382,
430,
441
- in /usr/src/sys/dev/xp.badsect.c line
219,
305,
397-398(2),
425-427(2)
- in /usr/src/sys/dev/xp.c line
196,
282,
350-351(2),
378-380(2)
- in /usr/src/sys/sys/acct.c line
29-33(2),
46,
67
- in /usr/src/sys/sys/alloc.c line
34,
42-47(2),
53-56(2),
82,
148,
161,
183,
255,
265-266(2),
343,
359,
407,
417,
440
- in /usr/src/sys/sys/clock.c line
103-106(2)
- in /usr/src/sys/sys/fio.c line
32-36(2),
65,
196,
254-255(2),
266,
308,
332-333(2),
343
- in /usr/src/sys/sys/iget.c line
66-70(2),
111-113(2),
142-155(4),
169,
191,
250,
262-263(2),
276,
294,
328,
471-473(2),
487-492(2),
506-508(2)
- in /usr/src/sys/sys/ioctl.c line
57
- in /usr/src/sys/sys/machdep.c line
474,
629
- in /usr/src/sys/sys/malloc.c line
280
- in /usr/src/sys/sys/nami.c line
69,
97,
109,
135,
149,
174,
215-219(2),
226,
237,
248,
275,
288,
302,
351,
388,
402,
415-417(2)
- in /usr/src/sys/sys/pipe.c line
38,
47,
57,
63-65(2)
- in /usr/src/sys/sys/prf.c line
177-179(2),
187,
245
- in /usr/src/sys/sys/prim.c line
53,
59-60(2),
100,
116,
205,
232,
249,
274-275(2),
283-288(2),
297,
338-342(3),
349-353(2),
417,
458,
509,
524
- in /usr/src/sys/sys/sigjcl.c line
549-553(2)
- in /usr/src/sys/sys/signojcl.c line
259-263(2)
- in /usr/src/sys/sys/slp.c line
87,
236,
434,
516,
524,
530,
565-570(2),
672-678(3),
685-691(3),
705,
716,
748,
760-765(3),
809-814(3),
851,
861,
910,
916,
930,
948,
955,
1123-1127(2),
1176-1180(2),
1213
- in /usr/src/sys/sys/subr.c line
51,
99,
135
- in /usr/src/sys/sys/sys1.c line
31,
51-57(3),
101-103(2),
126,
137-144(4),
566,
614-615(2),
633,
777-779(2),
864-866(3),
875-878(2),
890-892(2)
- in /usr/src/sys/sys/sys2.c line
53,
128,
150-154(2),
187,
195,
214,
222,
244,
292,
315,
356-361(2),
398
- in /usr/src/sys/sys/sys3.c line
34,
61,
81,
148,
162,
201-215(5),
270,
292,
315,
340,
391
- in /usr/src/sys/sys/sys4.c line
155,
166,
237,
266-268(2),
292-294(2),
439,
472,
573-575(2),
608,
616
- in /usr/src/sys/sys/syslocal.c line
102,
139,
160,
391,
662
- in /usr/src/sys/sys/text.c line
50,
83,
110,
126,
132,
155-158(3),
184,
201-205(2),
253,
310,
334,
369
- in /usr/src/sys/sys/trap.c line
384,
396
- in /usr/src/sys/sys/ureg.c line
35
NZERO
defined in line
46; used 11 times
PGSIZE
defined in line
100; used 28 times
- in /usr/src/sys/dev/dvhp.c line
448,
467
- in /usr/src/sys/dev/hk.c line
503,
607,
614,
646,
659
- in /usr/src/sys/dev/hp.badsect.c line
525,
532,
564,
650
- in /usr/src/sys/dev/hp.c line
457,
476,
545
- in /usr/src/sys/dev/rm.badsect.c line
584,
591,
623,
710
- in /usr/src/sys/dev/rm.c line
491,
510,
580
- in /usr/src/sys/dev/xp.badsect.c line
682,
689,
723,
810
- in /usr/src/sys/dev/xp.c line
605,
624,
695
PINOD
defined in line
38; used 5 times
PPIPE
defined in line
41; used 2 times
PRIBIO
defined in line
39; used 12 times
PRTP
defined in line
33; used 3 times
PSLEP
defined in line
43; used 1 times
PSWP
defined in line
36; used 7 times
PUSER
defined in line
44; used 6 times
PWAIT
defined in line
42; used 2 times
PZERO
defined in line
40; used 17 times
SINCR
defined in line
18; used 3 times
SSIZE
defined in line
17; used 2 times
USIZE
defined in line
84; used 39 times
- in /usr/src/sys/GENERIC/checksys.c line
202
- in /usr/src/sys/sys/clock.c line
355-357(2),
393-396(2)
- in /usr/src/sys/sys/machdep.c line
106
- in /usr/src/sys/sys/main.c line
54,
99
- in /usr/src/sys/sys/sigjcl.c line
566,
581,
633,
728
- in /usr/src/sys/sys/signojcl.c line
276,
291,
342,
437
- in /usr/src/sys/sys/slp.c line
530,
554-555(2),
845,
854,
883,
983(3),
1192(3)
- in /usr/src/sys/sys/sys1.c line
448-450(3),
657,
964
- in /usr/src/sys/sys/text.c line
50,
64-66(2)
- in /usr/src/sys/sys/ureg.c line
108-113(2),
159
btoc
defined in line
147; used 21 times
- in /usr/src/sys/GENERIC/checksys.c line
212
- in /usr/src/sys/GENERIC/param.c line
83
- in /usr/src/sys/sys/machdep.c line
135-137(2),
149-151(2),
183,
189
- in /usr/src/sys/sys/main.c line
97-101(3)
- in /usr/src/sys/sys/sys1.c line
122,
250,
350,
356-357(2),
384,
400,
941
- in /usr/src/sys/sys/text.c line
196,
203
ctob
defined in line
144; used 36 times
- in /usr/src/sys/GENERIC/checksys.c line
16(3),
202,
212
- in /usr/src/sys/dev/bio.c line
505
- in /usr/src/sys/sys/machdep.c line
127,
154,
238,
363
- in /usr/src/sys/sys/sigjcl.c line
566,
573-578(3),
584,
608-616(6),
728
- in /usr/src/sys/sys/signojcl.c line
276,
283-288(3),
294,
318-325(6),
437
- in /usr/src/sys/sys/text.c line
228-230(2)
ctod
defined in line
112; used 17 times
ctos
defined in line
108; used 25 times
dbtofsb
defined in line
135; used 44 times
- in /usr/src/sys/dev/Others/rx3.c line
225,
273
- in /usr/src/sys/dev/bio.c line
381
- in /usr/src/sys/dev/ht.c line
184,
190,
196,
250-252(2),
273-279(3),
327,
382-390(3),
433
- in /usr/src/sys/dev/tm.c line
350,
358,
370-375(2),
399-404(3),
552,
593,
636
- in /usr/src/sys/dev/ts.c line
275,
283,
292-297(2),
316-322(3),
495,
525-527(2),
533,
540,
598
- in /usr/src/sys/sys/subr.c line
53,
101,
139
- in /usr/src/sys/sys/sys1.c line
165,
216
hiint
defined in line
153; used 24 times
- in /usr/src/sys/dev/Others/dmc.c line
109,
418,
424-425(2)
- in /usr/src/sys/dev/dh.c line
457
- in /usr/src/sys/dev/hk.c line
559,
723
- in /usr/src/sys/dev/hp.badsect.c line
702,
715
- in /usr/src/sys/dev/hp.c line
597,
610
- in /usr/src/sys/dev/rm.badsect.c line
762,
775
- in /usr/src/sys/dev/rm.c line
632,
645
- in /usr/src/sys/dev/xp.badsect.c line
868,
881
- in /usr/src/sys/dev/xp.c line
753,
766
- in /usr/src/sys/sys/machdep.c line
462,
490,
528
- in /usr/src/sys/sys/main.c line
175
- in /usr/src/sys/sys/syslocal.c line
707
itod
defined in line
118; used 5 times
itoo
defined in line
125; used 5 times
loint
defined in line
150; used 21 times
splx
defined in line
164; used 91 times
- in /usr/src/sys/dev/Others/bk.c line
98,
120
- in /usr/src/sys/dev/Others/dc.c line
104
- in /usr/src/sys/dev/Others/dj.c line
146-151(2),
176
- in /usr/src/sys/dev/Others/mx1.c line
63-67(2)
- in /usr/src/sys/dev/Others/mx2.c line
248,
254,
436-439(2),
480,
486,
571,
618,
772,
789,
822,
842
- in /usr/src/sys/dev/Others/rx2.c line
351
- in /usr/src/sys/dev/Others/rx3.c line
247
- in /usr/src/sys/dev/bio.c line
225,
424
- in /usr/src/sys/dev/dh.c line
311,
467,
501,
582,
614
- in /usr/src/sys/dev/dhdm.c line
94
- in /usr/src/sys/dev/dn.c line
76
- in /usr/src/sys/dev/dz.c line
110,
284,
382,
437,
456
- in /usr/src/sys/dev/hk.c line
160
- in /usr/src/sys/dev/hs.c line
84
- in /usr/src/sys/dev/ht.c line
149,
209
- in /usr/src/sys/dev/kl.c line
199
- in /usr/src/sys/dev/rk.c line
63
- in /usr/src/sys/dev/rl.c line
136
- in /usr/src/sys/dev/tm.c line
171,
229,
272,
583
- in /usr/src/sys/dev/ts.c line
181,
224
- in /usr/src/sys/dev/tty.c line
177,
238,
667-670(2)
- in /usr/src/sys/dev/ttynew.c line
342,
764,
823
- in /usr/src/sys/dev/ttyold.c line
103,
342,
348
- in /usr/src/sys/dev/xp.badsect.c line
268
- in /usr/src/sys/dev/xp.c line
245
- in /usr/src/sys/sys/clock.c line
216,
281
- in /usr/src/sys/sys/enable34.c line
120,
136
- in /usr/src/sys/sys/machdep.c line
481,
513
- in /usr/src/sys/sys/prim.c line
75,
101,
132,
184,
255,
279,
292,
306,
365,
418-423(2),
530
- in /usr/src/sys/sys/sigjcl.c line
274
- in /usr/src/sys/sys/slp.c line
139,
173,
216,
245,
276,
307
- in /usr/src/sys/sys/syslocal.c line
474,
614-619(2),
741,
826
stoc
defined in line
109; used 11 times
Usage of this include