|
|
1.1 root 1: #ifdef KERNEL
2: #include "../machine/param.h"
3: #else
4: #include <machine/param.h>
5: #endif
6:
7: #define NPTEPG (NBPG/(sizeof (struct pte)))
8:
9: /*
10: * Tunable variables which do not usually vary per system.
11: *
12: * The sizes of most system tables are configured
13: * into each system description. The file system buffer
14: * cache size is assigned based on available memory.
15: * The tables whose sizes don't vary often are given here.
16: */
17:
18: #define NMOUNT 62 /* number of mountable file systems (cmap.h) */
19: #define MSWAPX 15 /* pseudo mount table index for swapdev */
20: #if MANYPROC
21: #define MAXUPRC 75
22: #else
23: #define MAXUPRC 35 /* max processes per user */
24: #endif
25: #define NOFILE 128 /* max open files per process */
26: #define NSYSFILE 4 /* stdin, stdout, stderr, /dev/tty */
27: #define CANBSIZ 256 /* max size of typewriter line */
28: #define NCARGS (16*1024) /* # characters in exec arglist */
29: #define NGROUPS 32 /* number of simultaneous groups */
30:
31: /*
32: * priorities
33: * probably should not be
34: * altered too much
35: */
36:
37: #define PSWP 0
38: #define PINOD 10
39: #define PRIBIO 20
40: #define PRIUBA 24
41: #define PZERO 25
42: #define PPIPE 26
43: #define PWAIT 30
44: #define PSLEP 40
45: #define PUSER 50
46:
47: #define NZERO 20
48:
49: /*
50: * signals
51: * dont change
52: */
53:
54: #ifndef NSIG
55: #ifdef KERNEL
56: #include "../h/signal.h"
57: #else
58: #include <signal.h>
59: #endif
60: #endif
61:
62: /*
63: * Return values from tsleep().
64: */
65: #define TS_OK 0 /* normal wakeup */
66: #define TS_TIME 1 /* timed-out wakeup */
67: #define TS_SIG 2 /* asynchronous signal wakeup */
68:
69: /*
70: * fundamental constants of the implementation--
71: * cannot be changed easily.
72: */
73:
74: #define NBBY 8 /* number of bits in a byte */
75: #define NBPW sizeof(int) /* number of bytes in an integer */
76:
77: #define NULL 0
78: #define CMASK 0 /* default mask for file creation */
79: #define NODEV (dev_t)(-1)
80: #define ROOTINO ((ino_t)2) /* i number of all roots */
81: #define SUPERB ((daddr_t)1) /* block number of the super block */
82: #define DIRSIZ 14 /* max characters per directory */
83:
84: /*
85: * Clustering of hardware pages on machines with ridiculously small
86: * page sizes is done here. The paging subsystem deals with units of
87: * CLSIZE pte's describing NBPG (from vm.h) pages each... BSIZE must
88: * be CLSIZE*NBPG in the current implementation, that is the paging subsystem
89: * deals with the same size blocks that the file system uses.
90: *
91: * NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE
92: */
93: #define CLBYTES (CLSIZE*NBPG)
94: #define CLOFSET (CLSIZE*NBPG-1) /* for clusters, like PGOFSET */
95:
96: /* give the base virtual address (first of CLSIZE) */
97: #define clbase(i) ((i) &~ (CLSIZE-1))
98:
99: /* round a number of clicks up to a whole cluster */
100: #define clrnd(i) (((i) + (CLSIZE-1)) &~ (CLSIZE-1))
101:
102: #if CLSIZE==1
103: #define BITFS(dev) ((dev) & 64)
104: #define BUFSIZE 8192
105: #define BSIZE(dev) (BUFSIZE)
106: #define INOPB(dev) (128)
107: #define BMASK(dev) (017777)
108: #define BSHIFT(dev) (13)
109: #define NMASK(dev) (03777)
110: #define NSHIFT(dev) (11)
111: #define NICINOD 100
112: #define NICFREE 946
113: #define itod(dev, x) ((daddr_t)((((unsigned)(x)+2*INOPB(dev)-1)/INOPB(dev))))
114: #define itoo(dev, x) ((int)(((x)+2*INOPB(dev)-1)%INOPB(dev)))
115: #define fsbtodb(dev, b) ((b)*16)
116: #define dbtofsb(dev, b) ((b)/16)
117: #define NINDIR(dev) (BSIZE(dev)/sizeof(daddr_t))
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 & 077) >> 3)
124: /* that means 8 units with at most 8 pieces each */
125: #endif
126:
127: #define CBSIZE 28 /* number of chars in a clist block */
128: #define CROUND 0x1F /* clist rounding; sizeof(int *) + CBSIZE -1*/
129:
130: /*
131: * Macros for fast min/max
132: */
133: #define MIN(a,b) (((a)<(b))?(a):(b))
134: #define MAX(a,b) (((a)>(b))?(a):(b))
135:
136: /*
137: * Macros for counting and rounding.
138: */
139: #define howmany(x, y) (((x)+((y)-1))/(y))
140: #define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
141:
142: #ifndef KERNEL
143: #include <sys/types.h>
144: #else
145: #ifndef LOCORE
146: #include "../h/types.h"
147: #endif
148: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.