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 2 times
BSIZE
defined in line
68; used 244 times
- in line 59,
69,
78
- in /usr/src/cmd/512dumpdir.c line
10,
37,
88,
219,
236-242(5),
266-268(2),
295(2),
319,
454,
491,
510
- in /usr/src/cmd/512restor.c line
104,
127,
500,
527-530(5),
659-661(2),
667-668(2),
677,
772,
779-780(3),
812-813(3),
888-892(2),
910,
932-934(2),
947,
1010,
1138,
1154-1158(2),
1167-1170(2)
- in /usr/src/cmd/clri.c line
19,
57-62(3),
73-78(2),
87
- in /usr/src/cmd/dcheck.c line
10,
152,
204-207(2)
- in /usr/src/cmd/du.c line
71,
117-118(3)
- in /usr/src/cmd/dump.c line
4,
163,
352-357(3),
370,
420,
441,
450,
490,
635-639(4),
656(2)
- in /usr/src/cmd/dumpdir.c line
50,
181,
198-204(5),
228-230(2),
257(2),
281,
416,
453,
472
- in /usr/src/cmd/find.c line
528,
556-557(3)
- in /usr/src/cmd/fsck.c line
15-16(2),
80,
566-571(3),
693,
1091,
1276-1280(3),
1287-1289(3),
1334-1344(5),
1370-1372(2),
1501-1504(2),
1608,
1622,
1796,
1807,
1946
- in /usr/src/cmd/grep.c line
463
- in /usr/src/cmd/icheck.c line
291,
303,
315,
369,
385,
403,
410,
428,
435,
445-446(3)
- in /usr/src/cmd/mkfs.c line
9-11(3),
37-40(2),
48,
166,
206,
228,
259,
288,
416-418(3),
430-432(3),
509,
661,
669,
682
- in /usr/src/cmd/ncheck.c line
16,
310-313(2)
- in /usr/src/cmd/quot.c line
23,
105,
134(2),
144(2),
179
- in /usr/src/cmd/restor.c line
74,
94-99(2),
477,
496-502(5),
527-533(3),
563(2),
587,
634-636(2),
642-643(2),
652,
749,
756-757(3),
789-790(3),
867-871(2),
889,
912-914(2),
927,
991,
1042,
1089,
1119,
1135-1139(2),
1148-1153(2),
1173
- in /usr/src/cmd/savecore.c line
286
- in /usr/src/cmd/strip.c line
168
- in /usr/src/sys/stand/libsa/SYS.c line
28,
152,
204-211(3),
266,
297,
303,
309-310(2)
- in /usr/src/ucb/dump/src/dump.h line
5
- in /usr/src/ucb/dump/src/dumpitime.c line
218(2),
227(2),
244(2)
- in /usr/src/ucb/dump/src/dumpmain.c line
168
- in /usr/src/ucb/dump/src/dumptape.c line
4,
13,
54
- in /usr/src/ucb/dump/src/dumptraverse.c line
179-184(3),
197,
249
BSLOP
defined in line
55;
never used
CMASK
defined in line
87;
never used
MAX
defined in line
169;
never used
MIN
defined in line
167; used 2 times
NBPW
defined in line
53;
never used
NICFREE
defined in line
94; used 20 times
- in /usr/src/cmd/512restor.c line
914-916(2),
949
- in /usr/src/cmd/df.c line
164,
179
- in /usr/src/cmd/fsck.c line
699,
1739,
1803,
1814
- in /usr/src/cmd/icheck.c line
376,
387,
393,
409-413(2)
- in /usr/src/cmd/mkfs.c line
453,
466-468(2)
- in /usr/src/cmd/restor.c line
893-895(2),
929
NINDIR
defined in line
69; used 35 times
- in /usr/src/cmd/512restor.c line
889-893(2),
969
- in /usr/src/cmd/dcheck.c line
216-221(2)
- in /usr/src/cmd/dump.c line
243-249(3),
256
- in /usr/src/cmd/fsck.c line
82,
869
- in /usr/src/cmd/icheck.c line
244-246(3),
292,
304,
316
- in /usr/src/cmd/mkfs.c line
229,
261,
514,
536,
564,
576,
630,
662,
671
- in /usr/src/cmd/ncheck.c line
321-326(2)
- in /usr/src/cmd/restor.c line
868-872(2),
950
- in /usr/src/ucb/dump/src/dumptraverse.c line
68-74(3),
81
NMASK
defined in line
72; used 3 times
NODEV
defined in line
88; used 7 times
NULL
defined in line
86; used 268 times
- in /usr/src/cmd/512dumpdir.c line
104
- in /usr/src/cmd/512restor.c line
254
- in /usr/src/cmd/dcheck.c line
98
- in /usr/src/cmd/dmesg.c line
81,
99
- in /usr/src/cmd/dump.c line
154,
204
- in /usr/src/cmd/dumpdir.c line
66
- in /usr/src/cmd/fsck.c line
410-415(2),
421,
431,
437,
444,
513,
559,
593,
621,
691-692(2),
866,
980,
1069,
1096,
1105,
1130,
1143,
1175,
1250,
1318,
1330-1331(2),
1346,
1364,
1374,
1380-1383(2),
1497-1501(4),
1509,
1537-1541(4),
1551-1556(2),
1568-1572(4),
1581-1586(2),
1599,
1613,
1682,
1752,
1906,
1922,
1939,
1964
- in /usr/src/cmd/grep.c line
107,
131,
141,
263,
273,
440
- in /usr/src/cmd/icheck.c line
158,
164
- in /usr/src/cmd/mkfs.c line
114-117(2)
- in /usr/src/cmd/restor.c line
227
- in /usr/src/cmd/uucp/4.2/pk1.c line
44-46(3),
54,
60,
66,
72,
81,
191
- in /usr/src/cmd/uucp/LIBNDIR/seekdir.c line
30
- in /usr/src/cmd/uucp/pk0.c line
570,
591
- in /usr/src/cmd/uucp/pk1.c line
47-49(3),
57,
63,
69,
75,
84,
194
- in /usr/src/lib/c/gen/getwd.c line
87,
94
- in /usr/src/lib/libU77/system_.c line
51
- in /usr/src/sys/autoconfig/read_nlist.c line
35,
44-49(2)
- in /usr/src/sys/dev/Others/dv.c line
130
- in /usr/src/sys/dev/Others/pk3.c line
54,
84,
116,
136-137(2)
- in /usr/src/sys/stand/bootstrap/boot.c line
175,
187
- in /usr/src/sys/stand/libsa/SYS.c line
58,
187
- in /usr/src/ucb/berknet/environ.c line
18,
34,
46,
77-79(3),
103,
121
- in /usr/src/ucb/berknet/mach.c line
76-81(2),
93,
118,
127(2),
141,
164-166(2),
209-212(4),
232,
272,
290-294(3),
315,
322,
330-332(2),
351-356(3),
406-413(4),
432,
473,
479-482(2),
557-559(2)
- in /usr/src/ucb/berknet/mmail.c line
53,
130
- in /usr/src/ucb/berknet/mwrite.c line
105,
111,
131
- in /usr/src/ucb/berknet/net.c line
199,
223,
253,
299,
380,
414,
437
- in /usr/src/ucb/berknet/netcp.c line
66
- in /usr/src/ucb/berknet/netdaemon.c line
74,
182,
234,
356,
432-436(3),
550,
732,
878,
960,
975-979(3),
1060
- in /usr/src/ucb/berknet/netlpr.c line
76
- in /usr/src/ucb/berknet/netmail.c line
82
- in /usr/src/ucb/berknet/netq.c line
77,
137
- in /usr/src/ucb/berknet/netrc.c line
153,
159,
170
- in /usr/src/ucb/berknet/netrm.c line
57
- in /usr/src/ucb/berknet/prmail.c line
77,
88,
153,
160-161(2),
170,
212-220(3),
226
- in /usr/src/ucb/berknet/prot.c line
97,
161,
212,
363-369(3),
453
- in /usr/src/ucb/berknet/sendberkmail.c line
111
- in /usr/src/ucb/berknet/setup.c line
214-221(3)
- in /usr/src/ucb/berknet/sub.c line
46,
76,
140,
154,
184
- in /usr/src/ucb/berknet/v6mail.c line
165,
175-181(3),
241,
256,
311,
323-328(2),
348,
371,
435,
500,
509,
533-538(2),
549-557(3),
573,
661
- in /usr/src/ucb/dump/src/dumpitime.c line
29,
116,
171-175(2)
- in /usr/src/ucb/dump/src/dumpmain.c line
155
- in /usr/src/ucb/dump/src/dumpoptr.c line
36,
44,
153,
196
- in /usr/src/ucb/dump/src/dumptraverse.c line
29
- in /usr/src/ucb/libndir/opendir.c line
17-20(3)
- in /usr/src/ucb/libndir/seekdir.c line
28
- in /usr/src/ucb/sendmail/aux/syslog.c line
135,
168,
181,
238,
465,
502,
707,
728,
814,
826-828(2),
836,
885
- in /usr/src/ucb/sendmail/lib/libndir/seekdir.c line
29
- in /usr/src/ucb/w.c line
245,
448,
490,
562
NZERO
defined in line
46;
never used
PINOD
defined in line
38;
never used
PPIPE
defined in line
41;
never used
PRTP
defined in line
33;
never used
PSLEP
defined in line
43;
never used
PSWP
defined in line
36;
never used
PUSER
defined in line
44;
never used
PWAIT
defined in line
42;
never used
PZERO
defined in line
40; used 2 times
SINCR
defined in line
18;
never used
SSIZE
defined in line
17;
never used
USIZE
defined in line
84; used 13 times
btoc
defined in line
147; used 10 times
ctob
defined in line
144; used 35 times
- in /usr/src/cmd/adb/setup.c line
167-172(3),
191,
198,
209,
222
- in /usr/src/cmd/ps/ps.c line
344-347(3),
362-364(3),
371,
378,
898-900(2)
- in /usr/src/cmd/pstat.c line
421
- in /usr/src/cmd/savecore.c line
14
- in /usr/src/sys/autoconfig/read_nlist.c line
83
- in /usr/src/sys/stand/bootstrap/boot.c line
215,
235,
253,
363
- in /usr/src/ucb/checkobj.c line
20
- in /usr/src/ucb/w.c line
473-476(3),
494-496(3),
503,
510-517(3)
ctod
defined in line
112; used 1 times
ctos
defined in line
108; used 6 times
itod
defined in line
118; used 5 times
itoo
defined in line
125; used 4 times
splx
defined in line
164; used 2 times
stoc
defined in line
109; used 7 times
Usage of this include