|
|
1.1 root 1: /* param.h 4.12 81/06/11 */
2: /* Tahoe version 1.0 Nov 5 1982 */
3:
4: /*
5: * Tunable variables which do not usually vary per system.
6: *
7: * The sizes of most system tables are configured
8: * into each system description. The file system buffer
9: * cache size is assigned based on available memory.
10: * The tables whose sizes don't vary often are given here.
11: */
12:
13: #define NMOUNT 15 /* number of mountable file systems */
14: #define MSWAPX 15 /* pseudo mount table index for swapdev */
15: #define MAXUPRC 25 /* max processes per user */
16: #define SSIZE 2 /* initial stack size (*1024 bytes) */
17: #define SINCR 2 /* increment of stack (*1024 bytes) */
18: #define NOFILE 20 /* max open files per process */
19: /* NOFILE MUST NOT BE >= 31; SEE pte.h */
20: #define CANBSIZ 256 /* max size of typewriter line */
21: #define NCARGS 10240 /* # characters in exec arglist */
22:
23: /*
24: * priorities
25: * probably should not be
26: * altered too much
27: */
28:
29: #define PSWP 0
30: #define PINOD 10
31: #define PRIBIO 20
32: #define PRIUBA 24
33: #define PZERO 25
34: #define PPIPE 26
35: #define PWAIT 30
36: #define PSLEP 40
37: #define PUSER 50
38:
39: #define NZERO 20
40:
41: /*
42: * signals
43: * dont change
44: */
45:
46: #ifndef NSIG
47: #include <signal.h>
48: #endif
49:
50: /*
51: * Return values from tsleep().
52: */
53: #define TS_OK 0 /* normal wakeup */
54: #define TS_TIME 1 /* timed-out wakeup */
55: #define TS_SIG 2 /* asynchronous signal wakeup */
56:
57: /*
58: * fundamental constants of the implementation--
59: * cannot be changed easily.
60: */
61:
62: #define NBBY 8 /* number of bits in a byte */
63: #define NBPW sizeof(int) /* number of bytes in an integer */
64: #define NBPG 1024
65: #define PGOFSET (NBPG-1) /* byte offset into page */
66: #define PGSHIFT 10 /* LOG2(NBPG) */
67: #define IOBASE 0xfff00000 /* Last Megabyte of 4 giga */
68: /* corresponds to Versabus addresses */
69:
70: /*
71: * The following constant is used to initialize the map of the
72: * system page table i/o entries.
73: * It's value should be the highest i/o address used by all the
74: * controllers handled in the system as specified in ubminit
75: * structure in ioconf.c.
76: */
77: /* #define MAXIOADDR 0xffff4001 /* highest physical io address */
78: #define MAXIOADDR 0xffffb03c /* While we are checking performance ! */
79:
80: /* Number of entries in the system page pable for i/o space */
81: #define IOSIZE (( (MAXIOADDR - IOBASE+ NBPG -1) >> PGSHIFT )+1)
82:
83: #define UPAGES 4 /* pages of u-area */
84: #define NULL 0
85: #define CMASK 0 /* default mask for file creation */
86: #define NODEV (dev_t)(-1)
87: #define ROOTINO ((ino_t)2) /* i number of all roots */
88: #define SUPERB ((daddr_t)1) /* block number of the super block */
89: #define DIRSIZ 14 /* max characters per directory */
90:
91: /*
92: * Clustering of hardware pages on machines with ridiculously small
93: * page sizes is done here. The paging subsystem deals with units of
94: * CLSIZE pte's describing NBPG (from vm.h) pages each... BSIZE must
95: * be CLSIZE*NBPG in the current implementation, that is the paging subsystem
96: * deals with the same size blocks that the file system uses.
97: *
98: * NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE
99: */
100: #define CLSIZE 1
101: #define CLOFSET (CLSIZE*NBPG-1) /* for clusters, like PGOFSET */
102:
103: /* give the base virtual address (first of CLSIZE) */
104: #define clbase(i) ((i) &~ (CLSIZE-1))
105:
106: /* round a number of clicks up to a whole cluster */
107: #define clrnd(i) (((i) + (CLSIZE-1)) &~ (CLSIZE-1))
108:
109: #if CLSIZE==1
110: #define BSIZE 1024
111: #define INOPB 16
112: #define BMASK 01777
113: #define BSHIFT 10
114: #define NMASK 0377
115: #define NSHIFT 8
116: #define NICINOD 100
117: #define NICFREE 178
118: #endif
119:
120: #ifndef INTRLVE
121: /* macros replacing interleaving functions */
122: #define dkblock(bp) ((bp)->b_blkno)
123: #define dkunit(bp) (minor((bp)->b_dev) >> 3)
124: #endif
125:
126: /* inumber to disk address and inumber to disk offset */
127: #define itod(x) ((daddr_t)((((unsigned)(x)+2*INOPB-1)/INOPB)))
128: #define itoo(x) ((int)(((x)+2*INOPB-1)%INOPB))
129:
130: /* file system blocks to disk blocks and back */
131: #define fsbtodb(b) ((b)*CLSIZE)
132: #define dbtofsb(b) ((b)/CLSIZE)
133:
134: #define NINDIR (BSIZE/sizeof(daddr_t)) /* # of pointers in indirect block */
135:
136: #define CBSIZE 28 /* number of chars in a clist block */
137: #define CROUND 0x1F /* clist rounding; sizeof(int *) + CBSIZE -1*/
138:
139: /*
140: * Macros for fast min/max
141: */
142: #define MIN(a,b) (((a)<(b))?(a):(b))
143: #define MAX(a,b) (((a)>(b))?(a):(b))
144:
145: /*
146: * Some macros for units conversion
147: */
148: /* Core clicks (1024 bytes) to segments and vice versa */
149: #define ctos(x) (x)
150: #define stoc(x) (x)
151:
152: /* Core clicks (1024 bytes) to disk blocks */
153: #define ctod(x) (x)
154:
155: /* clicks to bytes */
156: #define ctob(x) ((x) << PGSHIFT)
157:
158: /* bytes to clicks */
159: #define btoc(x) ((((unsigned)(x)+ NBPG -1) >> PGSHIFT))
160:
161: #ifndef KERNEL
162: #include <sys/types.h>
163: #else
164: #include "types.h"
165: #endif
166:
167: /*
168: * Machine-dependent bits and macros
169: */
170: #define UMODE PSL_CURMOD /* usermode bits */
171: #define USERMODE(ps) (((ps) & UMODE) == UMODE)
172:
173: #define BASEPRI(ps) (((ps) & PSL_IPL) != 0)
174:
175: /*
176: * Provide about n microseconds of delay
177: */
178: #define DELAY(n) { register int N = 3*(n); while (--N > 0); }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.