Put the sound stuff in alpabetic order.
[unix-history] / sys / conf / param.c
CommitLineData
15637ed4
RG
1/*
2 * Copyright (c) 1980, 1986, 1989 Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
be581a37
RG
33 * from: @(#)param.c 7.20 (Berkeley) 6/27/91
34 * $Id$
15637ed4
RG
35 */
36
37#include "sys/param.h"
38#include "sys/systm.h"
39#include "sys/socket.h"
40#include "sys/proc.h"
41#include "sys/vnode.h"
42#include "sys/file.h"
43#include "sys/callout.h"
44#include "sys/clist.h"
45#include "sys/mbuf.h"
46#include "ufs/quota.h"
47#include "sys/kernel.h"
48#ifdef SYSVSHM
49#include "machine/vmparam.h"
50#include "sys/shm.h"
51#endif
52
53/*
54 * System parameter formulae.
55 *
56 * This file is copied into each directory where we compile
57 * the kernel; it should be modified there to suit local taste
58 * if necessary.
59 *
d7f27d01 60 * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx -DMAXFDESCS=xx
15637ed4
RG
61 */
62
63#ifndef HZ
64#define HZ 100
65#endif
66int hz = HZ;
67int tick = 1000000 / HZ;
68int tickadj = 240000 / (60 * HZ); /* can adjust 240ms in 60s */
69struct timezone tz = { TIMEZONE, DST };
70#define NPROC (20 + 16 * MAXUSERS)
71int maxproc = NPROC;
72#define NTEXT (80 + NPROC / 8) /* actually the object cache */
73#define NVNODE (NPROC + NTEXT + 100)
74long desiredvnodes = NVNODE;
d7f27d01 75int maxfdescs = MAXFDESCS;
15637ed4
RG
76int maxfiles = 3 * (NPROC + MAXUSERS) + 80;
77int ncallout = 16 + NPROC;
78int nclist = 60 + 12 * MAXUSERS;
79int nmbclusters = NMBCLUSTERS;
80int fscale = FSCALE; /* kernel uses `FSCALE', user uses `fscale' */
81
82/*
83 * Values in support of System V compatible shared memory. XXX
84 */
85#ifdef SYSVSHM
86#define SHMMAX (SHMMAXPGS*NBPG)
87#define SHMMIN 1
88#define SHMMNI 32 /* <= SHMMMNI in shm.h */
89#define SHMSEG 8
90#define SHMALL (SHMMAXPGS/CLSIZE)
91
92struct shminfo shminfo = {
93 SHMMAX,
94 SHMMIN,
95 SHMMNI,
96 SHMSEG,
97 SHMALL
98};
99#endif
100
101/*
102 * These are initialized at bootstrap time
103 * to values dependent on memory size
104 */
105int nbuf, nswbuf;
106
107/*
108 * These have to be allocated somewhere; allocating
109 * them here forces loader errors if this file is omitted
110 * (if they've been externed everywhere else; hah!).
111 */
112struct callout *callout;
113struct cblock *cfree;
114struct buf *buf, *swbuf;
115char *buffers;
116
117/*
118 * Proc/pgrp hashing.
119 * Here so that hash table sizes can depend on MAXUSERS/NPROC.
120 * Hash size must be a power of two.
121 * NOW omission of this file will cause loader errors!
122 */
123
124#if NPROC > 1024
125#define PIDHSZ 512
126#else
127#if NPROC > 512
128#define PIDHSZ 256
129#else
130#if NPROC > 256
131#define PIDHSZ 128
132#else
133#define PIDHSZ 64
134#endif
135#endif
136#endif
137
138struct proc *pidhash[PIDHSZ];
139struct pgrp *pgrphash[PIDHSZ];
140int pidhashmask = PIDHSZ - 1;