Commit | Line | Data |
---|---|---|
e78f0c8d BJ |
1 | /* param.h 2.1 1/5/80 */ |
2 | ||
3 | /* | |
4 | * tunable variables | |
5 | * | |
6 | * NB: NBUF is well known in locore.s | |
7 | */ | |
8 | ||
9 | #define NBUF 48 /* size of buffer cache */ | |
10 | #define NINODE 200 /* number of in core inodes */ | |
11 | #define NFILE 175 /* number of in core file structures */ | |
12 | #define NMOUNT 8 /* number of mountable file systems */ | |
13 | #define MAXUPRC 25 /* max processes per user */ | |
14 | #define SSIZE 4 /* initial stack size (*512 bytes) */ | |
15 | #define SINCR 4 /* increment of stack (*512 bytes) */ | |
16 | #define NOFILE 20 /* max open files per process */ | |
17 | #define CANBSIZ 256 /* max size of typewriter line */ | |
18 | #define SMAPSIZ (4*NPROC) /* size of swap allocation area */ | |
19 | #define NCALL 40 /* max simultaneous time callouts */ | |
20 | #define NPROC 125 /* max number of processes */ | |
21 | #define NTEXT 60 /* max number of pure texts */ | |
22 | #define NCLIST 500 /* max total clist size */ | |
23 | #define HZ 60 /* Ticks/second of the clock */ | |
24 | #define TIMEZONE (8*60) /* Minutes westward from Greenwich */ | |
25 | #define DSTFLAG 1 /* Daylight Saving Time applies in this locality */ | |
26 | #define MSGBUFS 128 /* Characters saved from error messages */ | |
27 | #define NCARGS 5120 /* # characters in exec arglist */ | |
28 | /* | |
29 | * priorities | |
30 | * probably should not be | |
31 | * altered too much | |
32 | */ | |
33 | ||
34 | #define PSWP 0 | |
35 | #define PINOD 10 | |
36 | #define PRIBIO 20 | |
37 | #define PRIUBA 24 | |
38 | #define PZERO 25 | |
39 | #define PPIPE 26 | |
40 | #define PWAIT 30 | |
41 | #define PSLEP 40 | |
42 | #define PUSER 50 | |
43 | ||
44 | #define NZERO 20 | |
45 | ||
46 | /* | |
47 | * signals | |
48 | * dont change | |
49 | */ | |
50 | ||
51 | #define NSIG 17 | |
52 | /* | |
53 | * No more than 16 signals (1-16) because they are | |
54 | * stored in bits in a word. | |
55 | */ | |
56 | #define SIGHUP 1 /* hangup */ | |
57 | #define SIGINT 2 /* interrupt (rubout) */ | |
58 | #define SIGQUIT 3 /* quit (FS) */ | |
59 | #define SIGINS 4 /* illegal instruction */ | |
60 | #define SIGTRC 5 /* trace or breakpoint */ | |
61 | #define SIGIOT 6 /* iot */ | |
62 | #define SIGEMT 7 /* emt */ | |
63 | #define SIGFPT 8 /* floating exception */ | |
64 | #define SIGKIL 9 /* kill, uncatchable termination */ | |
65 | #define SIGBUS 10 /* bus error */ | |
66 | #define SIGSEG 11 /* segmentation violation */ | |
67 | #define SIGSYS 12 /* bad system call */ | |
68 | #define SIGPIPE 13 /* end of pipe */ | |
69 | #define SIGCLK 14 /* alarm clock */ | |
70 | #define SIGTRM 15 /* Catchable termination */ | |
71 | ||
72 | /* | |
73 | * fundamental constants of the implementation-- | |
74 | * cannot be changed easily. | |
75 | * note: UPAGES is well known in locore.s | |
76 | */ | |
77 | ||
78 | #define NBPW sizeof(int) /* number of bytes in an integer */ | |
79 | ||
80 | #define UPAGES 6 /* pages of u-area */ | |
81 | #define NULL 0 | |
82 | #define CMASK 0 /* default mask for file creation */ | |
83 | #define NODEV (dev_t)(-1) | |
84 | #define ROOTINO ((ino_t)2) /* i number of all roots */ | |
85 | #define SUPERB ((daddr_t)1) /* block number of the super block */ | |
86 | #define DIRSIZ 14 /* max characters per directory */ | |
87 | ||
88 | /* | |
89 | * Clustering of hardware pages on machines with ridiculously small | |
90 | * page sizes is done here. The paging subsystem deals with units of | |
91 | * CLSIZE pte's describing NBPG (from vm.h) pages each... BSIZE must | |
92 | * be CLSIZE*NBPG in the current implementation, that is the paging subsystem | |
93 | * deals with the same size blocks that the file system uses. | |
94 | * | |
95 | * NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE | |
96 | */ | |
97 | #define CLSIZE 2 | |
98 | ||
99 | /* give the base virtual address (first of CLSIZE) */ | |
100 | #define clbase(i) ((i) &~ (CLSIZE-1)) | |
101 | ||
102 | /* round a number of clicks up to a whole cluster */ | |
103 | #define clrnd(i) (((i) + (CLSIZE-1)) &~ (CLSIZE-1)) | |
104 | ||
105 | #if CLSIZE==1 | |
106 | #define BSIZE 512 /* size of secondary block (bytes) */ | |
107 | #define INOPB 8 /* 8 inodes per block */ | |
108 | #define BMASK 0777 /* BSIZE-1 */ | |
109 | #define BSHIFT 9 /* LOG2(BSIZE) */ | |
110 | #define NMASK 0177 /* NINDIR-1 */ | |
111 | #define NSHIFT 7 /* LOG2(NINDIR) */ | |
112 | #define NICINOD 100 /* number of superblock inodes */ | |
113 | #define NICFREE 50 /* number of superblock free blocks */ | |
114 | ||
115 | #endif | |
116 | ||
117 | #if CLSIZE==2 | |
118 | #define BSIZE 1024 | |
119 | #define INOPB 16 | |
120 | #define BMASK 01777 | |
121 | #define BSHIFT 10 | |
122 | #define NMASK 0377 | |
123 | #define NSHIFT 8 | |
124 | #define NICINOD 100 | |
125 | #define NICFREE 178 | |
126 | #endif | |
127 | ||
128 | #if CLSIZE==4 | |
129 | #define BSIZE 2048 | |
130 | #define INOPB 32 | |
131 | #define BMASK 03777 | |
132 | #define BSHIFT 11 | |
133 | #define NMASK 0777 | |
134 | #define NSHIFT 9 | |
135 | #define NICINOD 100 | |
136 | #define NICFREE 434 | |
137 | #endif | |
138 | ||
139 | /* inumber to disk address and inumber to disk offset */ | |
140 | #define itod(x) ((daddr_t)((((unsigned)(x)+2*INOPB-1)/INOPB))) | |
141 | #define itoo(x) ((int)(((x)+2*INOPB-1)%INOPB)) | |
142 | ||
143 | /* file system blocks to disk blocks and back */ | |
144 | #define fsbtodb(b) ((b)*CLSIZE) | |
145 | #define dbtofsb(b) ((b)/CLSIZE) | |
146 | ||
147 | /* BSLOP can be 0 unless you have a TIU/Spider */ | |
148 | #define BSLOP 0 /* In case some device needs bigger buffers */ | |
149 | #define NINDIR (BSIZE/sizeof(daddr_t)) | |
150 | ||
151 | #define CBSIZE 28 /* number of chars in a clist block */ | |
152 | #define CROUND 0x1F /* clist rounding; sizeof(int *) + CBSIZE -1*/ | |
153 | #define CLKTICK (1000000/(HZ)) /* microseconds in a clock tick */ | |
154 | ||
155 | /* | |
156 | * Some macros for units conversion | |
157 | */ | |
158 | /* Core clicks (512 bytes) to segments and vice versa */ | |
159 | #define ctos(x) (x) | |
160 | #define stoc(x) (x) | |
161 | ||
162 | /* Core clicks (512 bytes) to disk blocks */ | |
163 | #define ctod(x) (x) | |
164 | ||
165 | /* clicks to bytes */ | |
166 | #define ctob(x) ((x)<<9) | |
167 | ||
168 | /* bytes to clicks */ | |
169 | #define btoc(x) ((((unsigned)(x)+511)>>9)) | |
170 | ||
171 | /* major part of a device */ | |
172 | #define major(x) ((int)(((unsigned)(x)>>8)&0377)) | |
173 | ||
174 | /* minor part of a device */ | |
175 | #define minor(x) ((int)((x)&0377)) | |
176 | ||
177 | /* make a device number */ | |
178 | #define makedev(x,y) ((dev_t)(((x)<<8) | (y))) | |
179 | ||
180 | typedef struct { int r[1]; } * physadr; | |
181 | typedef int daddr_t; | |
182 | typedef char * caddr_t; | |
183 | typedef unsigned short ino_t; | |
184 | typedef int swblk_t; | |
185 | typedef int size_t; | |
186 | typedef int time_t; | |
187 | typedef int label_t[10]; | |
188 | typedef short dev_t; | |
189 | typedef int off_t; | |
190 | ||
191 | /* | |
192 | * Machine-dependent bits and macros | |
193 | */ | |
194 | #define UMODE PSL_CURMOD /* usermode bits */ | |
195 | #define USERMODE(ps) (((ps) & UMODE) == UMODE) | |
196 | ||
197 | #define BASEPRI(ps) (((ps) & PSL_IPL) != 0) | |
198 | ||
199 | #ifdef KERNEL | |
200 | #ifdef lint | |
201 | int __void__; | |
202 | #define VOID __void__ = (int) | |
203 | #else | |
204 | #define VOID | |
205 | #endif | |
206 | #endif |