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;
never used
BSIZE
defined in line
68; used 4 times
BSLOP
defined in line
55; used 1 times
CMASK
defined in line
87;
never used
MAX
defined in line
169;
never used
MIN
defined in line
167; used 1 times
NBPW
defined in line
53;
never used
NMASK
defined in line
72;
never used
NODEV
defined in line
88;
never used
NULL
defined in line
86; used 13 times
- in /usr/src/sys/conf/c.c line
48,
76,
93,
110,
127,
147,
172,
188,
205,
221,
241,
261,
288
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;
never used
SINCR
defined in line
18; used 1 times
SSIZE
defined in line
17; used 1 times
USIZE
defined in line
84; used 1 times
btoc
defined in line
147; used 2 times
ctob
defined in line
144; used 5 times
ctod
defined in line
112;
never used
ctos
defined in line
108; used 1 times
itod
defined in line
118;
never used
itoo
defined in line
125;
never used
splx
defined in line
164;
never used
stoc
defined in line
109; used 1 times
Usage of this include