xref: /csrg-svn/sys/conf/param.c (revision 40875)
123133Smckusick /*
237766Smckusick  * Copyright (c) 1980, 1986, 1989 Regents of the University of California.
337766Smckusick  * All rights reserved.
426395Skarels  *
537766Smckusick  * Redistribution and use in source and binary forms are permitted
637766Smckusick  * provided that the above copyright notice and this paragraph are
737766Smckusick  * duplicated in all such forms and that any documentation,
837766Smckusick  * advertising materials, and other materials related to such
937766Smckusick  * distribution and use acknowledge that the software was developed
1037766Smckusick  * by the University of California, Berkeley.  The name of the
1137766Smckusick  * University may not be used to endorse or promote products derived
1237766Smckusick  * from this software without specific prior written permission.
1337766Smckusick  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1437766Smckusick  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1537766Smckusick  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1637766Smckusick  *
17*40875Smckusick  *	@(#)param.c	7.9 (Berkeley) 04/10/90
1823133Smckusick  */
193124Swnj 
2023133Smckusick #ifndef lint
2123133Smckusick char copyright[] =
2237766Smckusick "@(#) Copyright (c) 1980, 1986, 1989 Regents of the University of California.\n\
2323133Smckusick  All rights reserved.\n";
2423133Smckusick #endif not lint
2523133Smckusick 
2637531Smckusick #include "../sys/param.h"
2737531Smckusick #include "../sys/systm.h"
2837531Smckusick #include "../sys/socket.h"
2937531Smckusick #include "../sys/user.h"
3037531Smckusick #include "../sys/proc.h"
3137531Smckusick #include "../sys/text.h"
3237766Smckusick #include "../sys/vnode.h"
3337531Smckusick #include "../sys/file.h"
3437531Smckusick #include "../sys/callout.h"
3537531Smckusick #include "../sys/clist.h"
3637531Smckusick #include "../sys/cmap.h"
3737531Smckusick #include "../sys/mbuf.h"
3837531Smckusick #include "../ufs/quota.h"
3937531Smckusick #include "../sys/kernel.h"
403124Swnj /*
413124Swnj  * System parameter formulae.
423124Swnj  *
433124Swnj  * This file is copied into each directory where we compile
443124Swnj  * the kernel; it should be modified there to suit local taste
453124Swnj  * if necessary.
463124Swnj  *
473124Swnj  * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx
483124Swnj  */
493124Swnj 
5029929Skarels #ifndef HZ
518229Sroot #define	HZ 100
5229929Skarels #endif
533124Swnj int	hz = HZ;
548229Sroot int	tick = 1000000 / HZ;
5526304Skarels int	tickadj = 240000 / (60 * HZ);		/* can adjust 240ms in 60s */
568229Sroot struct	timezone tz = { TIMEZONE, DST };
573124Swnj #define	NPROC (20 + 8 * MAXUSERS)
583124Swnj int	nproc = NPROC;
5918649Skarels int	ntext = 36 + MAXUSERS;
6039377Smckusick #define NVNODE ((NPROC + 16 + MAXUSERS) + 32)
61*40875Smckusick int	desiredvnodes = NVNODE;
6216575Ssam int	nfile = 16 * (NPROC + 16 + MAXUSERS) / 10 + 32;
639248Ssam int	ncallout = 16 + NPROC;
6424909Skarels int	nclist = 60 + 12 * MAXUSERS;
655148Swnj int     nmbclusters = NMBCLUSTERS;
669183Ssam #ifdef QUOTA
6717009Smckusick int	nquota = (MAXUSERS * 9) / 7 + 3;
6839377Smckusick int	ndquot = NVNODE + (MAXUSERS * NMOUNT) / 4;
697638Ssam #endif
7038159Smckusick int	fscale = FSCALE;	/* kernel uses `FSCALE', user uses `fscale' */
713124Swnj 
723124Swnj /*
733124Swnj  * These are initialized at bootstrap time
743124Swnj  * to values dependent on memory size
753124Swnj  */
763124Swnj int	nbuf, nswbuf;
773124Swnj 
783124Swnj /*
793124Swnj  * These have to be allocated somewhere; allocating
8026304Skarels  * them here forces loader errors if this file is omitted
8126304Skarels  * (if they've been externed everywhere else; hah!).
823124Swnj  */
833124Swnj struct	proc *proc, *procNPROC;
843124Swnj struct	text *text, *textNTEXT;
853124Swnj struct	file *file, *fileNFILE;
863124Swnj struct 	callout *callout;
873124Swnj struct	cblock *cfree;
883124Swnj struct	buf *buf, *swbuf;
893124Swnj char	*buffers;
903124Swnj struct	cmap *cmap, *ecmap;
919183Ssam #ifdef QUOTA
927638Ssam struct	quota *quota, *quotaNQUOTA;
937638Ssam struct	dquot *dquot, *dquotNDQUOT;
947638Ssam #endif
95