Commit | Line | Data |
---|---|---|
b1078c35 | 1 | /* |
da83315a KM |
2 | * Copyright (c) 1980, 1986, 1989 Regents of the University of California. |
3 | * All rights reserved. | |
86cbc46c | 4 | * |
dbf0c423 | 5 | * %sccs.include.redist.c% |
da83315a | 6 | * |
b03a0fb1 | 7 | * @(#)param.c 7.22 (Berkeley) %G% |
b1078c35 KM |
8 | */ |
9 | ||
933ab5e6 KB |
10 | #include "sys/param.h" |
11 | #include "sys/systm.h" | |
12 | #include "sys/socket.h" | |
933ab5e6 KB |
13 | #include "sys/proc.h" |
14 | #include "sys/vnode.h" | |
15 | #include "sys/file.h" | |
16 | #include "sys/callout.h" | |
17 | #include "sys/clist.h" | |
18 | #include "sys/mbuf.h" | |
c26eaddc | 19 | #include "ufs/ufs/quota.h" |
933ab5e6 | 20 | #include "sys/kernel.h" |
7d08bbf1 KM |
21 | #ifdef SYSVSHM |
22 | #include "machine/vmparam.h" | |
933ab5e6 | 23 | #include "sys/shm.h" |
7d08bbf1 KM |
24 | #endif |
25 | ||
ec6f91b0 BJ |
26 | /* |
27 | * System parameter formulae. | |
28 | * | |
29 | * This file is copied into each directory where we compile | |
30 | * the kernel; it should be modified there to suit local taste | |
31 | * if necessary. | |
32 | * | |
33 | * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx | |
34 | */ | |
35 | ||
46a9a1d7 | 36 | #ifndef HZ |
bf75e5ce | 37 | #define HZ 100 |
46a9a1d7 | 38 | #endif |
ec6f91b0 | 39 | int hz = HZ; |
bf75e5ce | 40 | int tick = 1000000 / HZ; |
b03a0fb1 | 41 | int tickadj = 30000 / (60 * HZ); /* can adjust 30ms in 60s */ |
bf75e5ce | 42 | struct timezone tz = { TIMEZONE, DST }; |
582864af | 43 | #define NPROC (20 + 16 * MAXUSERS) |
64504438 | 44 | int maxproc = NPROC; |
582864af MK |
45 | #define NTEXT (80 + NPROC / 8) /* actually the object cache */ |
46 | #define NVNODE (NPROC + NTEXT + 100) | |
50686e99 | 47 | long desiredvnodes = NVNODE; |
582864af | 48 | int maxfiles = 3 * (NPROC + MAXUSERS) + 80; |
2067e85f | 49 | int ncallout = 16 + NPROC; |
e31e5017 | 50 | int nclist = 60 + 12 * MAXUSERS; |
582864af | 51 | int nmbclusters = NMBCLUSTERS; |
80b6b780 | 52 | int fscale = FSCALE; /* kernel uses `FSCALE', user uses `fscale' */ |
ec6f91b0 | 53 | |
7d08bbf1 | 54 | /* |
582864af | 55 | * Values in support of System V compatible shared memory. XXX |
7d08bbf1 KM |
56 | */ |
57 | #ifdef SYSVSHM | |
58 | #define SHMMAX (SHMMAXPGS*NBPG) | |
582864af MK |
59 | #define SHMMIN 1 |
60 | #define SHMMNI 32 /* <= SHMMMNI in shm.h */ | |
7d08bbf1 | 61 | #define SHMSEG 8 |
582864af | 62 | #define SHMALL (SHMMAXPGS/CLSIZE) |
7d08bbf1 KM |
63 | |
64 | struct shminfo shminfo = { | |
65 | SHMMAX, | |
66 | SHMMIN, | |
67 | SHMMNI, | |
68 | SHMSEG, | |
69 | SHMALL | |
70 | }; | |
71 | #endif | |
72 | ||
ec6f91b0 BJ |
73 | /* |
74 | * These are initialized at bootstrap time | |
75 | * to values dependent on memory size | |
76 | */ | |
77 | int nbuf, nswbuf; | |
78 | ||
79 | /* | |
80 | * These have to be allocated somewhere; allocating | |
6f33ca1e MK |
81 | * them here forces loader errors if this file is omitted |
82 | * (if they've been externed everywhere else; hah!). | |
ec6f91b0 | 83 | */ |
ec6f91b0 BJ |
84 | struct callout *callout; |
85 | struct cblock *cfree; | |
ec6f91b0 | 86 | struct buf *buf, *swbuf; |
ec6f91b0 | 87 | char *buffers; |
76a26bea MK |
88 | |
89 | /* | |
90 | * Proc/pgrp hashing. | |
91 | * Here so that hash table sizes can depend on MAXUSERS/NPROC. | |
92 | * Hash size must be a power of two. | |
93 | * NOW omission of this file will cause loader errors! | |
94 | */ | |
95 | ||
96 | #if NPROC > 1024 | |
97 | #define PIDHSZ 512 | |
98 | #else | |
99 | #if NPROC > 512 | |
100 | #define PIDHSZ 256 | |
101 | #else | |
102 | #if NPROC > 256 | |
103 | #define PIDHSZ 128 | |
104 | #else | |
105 | #define PIDHSZ 64 | |
106 | #endif | |
107 | #endif | |
108 | #endif | |
109 | ||
110 | struct proc *pidhash[PIDHSZ]; | |
111 | struct pgrp *pgrphash[PIDHSZ]; | |
112 | int pidhashmask = PIDHSZ - 1; |