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 are permitted 6 * provided that the above copyright notice and this paragraph are 7 * duplicated in all such forms and that any documentation, 8 * advertising materials, and other materials related to such 9 * distribution and use acknowledge that the software was developed 10 * by the University of California, Berkeley. The name of the 11 * University may not be used to endorse or promote products derived 12 * from this software without specific prior written permission. 13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 * 17 * @(#)param.c 7.7 (Berkeley) 07/01/89 18 */ 19 20 #ifndef lint 21 char copyright[] = 22 "@(#) Copyright (c) 1980, 1986, 1989 Regents of the University of California.\n\ 23 All rights reserved.\n"; 24 #endif not lint 25 26 #include "../sys/param.h" 27 #include "../sys/systm.h" 28 #include "../sys/socket.h" 29 #include "../sys/user.h" 30 #include "../sys/proc.h" 31 #include "../sys/text.h" 32 #include "../sys/vnode.h" 33 #include "../ufs/inode.h" 34 #include "../sys/file.h" 35 #include "../sys/callout.h" 36 #include "../sys/clist.h" 37 #include "../sys/cmap.h" 38 #include "../sys/mbuf.h" 39 #include "../ufs/quota.h" 40 #include "../sys/kernel.h" 41 /* 42 * System parameter formulae. 43 * 44 * This file is copied into each directory where we compile 45 * the kernel; it should be modified there to suit local taste 46 * if necessary. 47 * 48 * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx 49 */ 50 51 #ifndef HZ 52 #define HZ 100 53 #endif 54 int hz = HZ; 55 int tick = 1000000 / HZ; 56 int tickadj = 240000 / (60 * HZ); /* can adjust 240ms in 60s */ 57 struct timezone tz = { TIMEZONE, DST }; 58 #define NPROC (20 + 8 * MAXUSERS) 59 int nproc = NPROC; 60 int ntext = 36 + MAXUSERS; 61 #define NINODE ((NPROC + 16 + MAXUSERS) + 32) 62 int ninode = NINODE; 63 #ifndef NFS 64 int nchsize = NINODE * 11 / 10; 65 #else 66 int nnfsnode = NINODE; 67 int nchsize = (2 * NINODE) * 11 / 10; 68 #endif /* NFS */ 69 int nfile = 16 * (NPROC + 16 + MAXUSERS) / 10 + 32; 70 int ncallout = 16 + NPROC; 71 int nclist = 60 + 12 * MAXUSERS; 72 int nmbclusters = NMBCLUSTERS; 73 #ifdef QUOTA 74 int nquota = (MAXUSERS * 9) / 7 + 3; 75 int ndquot = NINODE + (MAXUSERS * NMOUNT) / 4; 76 #endif 77 int fscale = FSCALE; /* kernel uses `FSCALE', user uses `fscale' */ 78 79 /* 80 * These are initialized at bootstrap time 81 * to values dependent on memory size 82 */ 83 int nbuf, nswbuf; 84 85 /* 86 * These have to be allocated somewhere; allocating 87 * them here forces loader errors if this file is omitted 88 * (if they've been externed everywhere else; hah!). 89 */ 90 struct proc *proc, *procNPROC; 91 struct text *text, *textNTEXT; 92 struct inode *inode, *inodeNINODE; 93 struct file *file, *fileNFILE; 94 struct callout *callout; 95 struct cblock *cfree; 96 struct buf *buf, *swbuf; 97 char *buffers; 98 struct cmap *cmap, *ecmap; 99 struct namecache *namecache; 100 #ifdef QUOTA 101 struct quota *quota, *quotaNQUOTA; 102 struct dquot *dquot, *dquotNDQUOT; 103 #endif 104