xref: /original-bsd/sys/conf/param.c (revision bbde4fec)
17b8cfba6Smckusick /*
250371b44Sbostic  * Copyright (c) 1980, 1986, 1989, 1993
350371b44Sbostic  *	The Regents of the University of California.  All rights reserved.
461345825Sbostic  * (c) UNIX System Laboratories, Inc.
561345825Sbostic  * All or some portions of this file are derived from material licensed
661345825Sbostic  * to the University of California by American Telephone and Telegraph
761345825Sbostic  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
861345825Sbostic  * the permission of UNIX System Laboratories, Inc.
9599a30feSkarels  *
10e279468cSbostic  * %sccs.include.redist.c%
115db41149Smckusick  *
12*bbde4fecSmckusick  *	@(#)param.c	8.3 (Berkeley) 08/20/94
137b8cfba6Smckusick  */
147b8cfba6Smckusick 
15eae0030cSbostic #include <sys/param.h>
16eae0030cSbostic #include <sys/systm.h>
17eae0030cSbostic #include <sys/socket.h>
18eae0030cSbostic #include <sys/proc.h>
19eae0030cSbostic #include <sys/vnode.h>
20eae0030cSbostic #include <sys/file.h>
21eae0030cSbostic #include <sys/callout.h>
22eae0030cSbostic #include <sys/clist.h>
23eae0030cSbostic #include <sys/mbuf.h>
24eae0030cSbostic #include <sys/kernel.h>
25eae0030cSbostic 
26eae0030cSbostic #include <ufs/ufs/quota.h>
27eae0030cSbostic 
28a39359aaSmckusick #ifdef SYSVSHM
29eae0030cSbostic #include <machine/vmparam.h>
30eae0030cSbostic #include <sys/shm.h>
31a39359aaSmckusick #endif
32a39359aaSmckusick 
33d70434ccSwnj /*
34d70434ccSwnj  * System parameter formulae.
35d70434ccSwnj  *
36d70434ccSwnj  * This file is copied into each directory where we compile
37d70434ccSwnj  * the kernel; it should be modified there to suit local taste
38d70434ccSwnj  * if necessary.
39d70434ccSwnj  *
40d70434ccSwnj  * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx
41d70434ccSwnj  */
42d70434ccSwnj 
436aa471b0Skarels #ifndef HZ
44ed98ab50Sroot #define	HZ 100
456aa471b0Skarels #endif
46d70434ccSwnj int	hz = HZ;
47ed98ab50Sroot int	tick = 1000000 / HZ;
487265ecfcStorek int	tickadj = 30000 / (60 * HZ);		/* can adjust 30ms in 60s */
49ed98ab50Sroot struct	timezone tz = { TIMEZONE, DST };
5029499b94Skarels #define	NPROC (20 + 16 * MAXUSERS)
51dd81634eSkarels int	maxproc = NPROC;
5229499b94Skarels #define	NTEXT (80 + NPROC / 8)			/* actually the object cache */
5329499b94Skarels #define	NVNODE (NPROC + NTEXT + 100)
54a66062f2Smckusick int	desiredvnodes = NVNODE;
5529499b94Skarels int	maxfiles = 3 * (NPROC + MAXUSERS) + 80;
564c033502Ssam int	ncallout = 16 + NPROC;
574dccf5e7Skarels int	nclist = 60 + 12 * MAXUSERS;
58d40a79efSwnj int	nmbclusters = NMBCLUSTERS;
593683084fSmckusick int	fscale = FSCALE;	/* kernel uses `FSCALE', user uses `fscale' */
60d70434ccSwnj 
61d70434ccSwnj /*
6229499b94Skarels  * Values in support of System V compatible shared memory.	XXX
63a39359aaSmckusick  */
64a39359aaSmckusick #ifdef SYSVSHM
65a39359aaSmckusick #define	SHMMAX	(SHMMAXPGS*NBPG)
66a39359aaSmckusick #define	SHMMIN	1
67a39359aaSmckusick #define	SHMMNI	32			/* <= SHMMMNI in shm.h */
68a39359aaSmckusick #define	SHMSEG	8
69a39359aaSmckusick #define	SHMALL	(SHMMAXPGS/CLSIZE)
70a39359aaSmckusick 
71a39359aaSmckusick struct	shminfo shminfo = {
72a39359aaSmckusick 	SHMMAX,
73a39359aaSmckusick 	SHMMIN,
74a39359aaSmckusick 	SHMMNI,
75a39359aaSmckusick 	SHMSEG,
76a39359aaSmckusick 	SHMALL
77a39359aaSmckusick };
78a39359aaSmckusick #endif
79a39359aaSmckusick 
80a39359aaSmckusick /*
81d70434ccSwnj  * These are initialized at bootstrap time
82d70434ccSwnj  * to values dependent on memory size
83d70434ccSwnj  */
84d70434ccSwnj int	nbuf, nswbuf;
85d70434ccSwnj 
86d70434ccSwnj /*
87d70434ccSwnj  * These have to be allocated somewhere; allocating
88e55a822eSkarels  * them here forces loader errors if this file is omitted
89e55a822eSkarels  * (if they've been externed everywhere else; hah!).
90d70434ccSwnj  */
91d70434ccSwnj struct 	callout *callout;
92d70434ccSwnj struct	cblock *cfree;
93d70434ccSwnj struct	buf *buf, *swbuf;
94d70434ccSwnj char	*buffers;
95