|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1980, 1986, 1989 Regents of the University of California. ! 3: * All rights reserved. ! 4: * ! 5: * Redistribution is only permitted until one year after the first shipment ! 6: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and ! 7: * binary forms are permitted provided that: (1) source distributions retain ! 8: * this entire copyright notice and comment, and (2) distributions including ! 9: * binaries display the following acknowledgement: This product includes ! 10: * software developed by the University of California, Berkeley and its ! 11: * contributors'' in the documentation or other materials provided with the ! 12: * distribution and in all advertising materials mentioning features or use ! 13: * of this software. Neither the name of the University nor the names of ! 14: * its contributors may be used to endorse or promote products derived from ! 15: * this software without specific prior written permission. ! 16: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 17: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 18: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 19: * ! 20: * @(#)param.c 7.14 (Berkeley) 6/28/90 ! 21: */ ! 22: ! 23: #ifndef lint ! 24: char copyright[] = ! 25: "@(#) Copyright (c) 1980, 1986, 1989 Regents of the University of California.\n\ ! 26: All rights reserved.\n"; ! 27: #endif not lint ! 28: ! 29: #include "../sys/param.h" ! 30: #include "../sys/systm.h" ! 31: #include "../sys/socket.h" ! 32: #include "../sys/user.h" ! 33: #include "../sys/proc.h" ! 34: #include "../sys/text.h" ! 35: #include "../sys/vnode.h" ! 36: #include "../sys/file.h" ! 37: #include "../sys/callout.h" ! 38: #include "../sys/clist.h" ! 39: #include "../sys/cmap.h" ! 40: #include "../sys/mbuf.h" ! 41: #include "../ufs/quota.h" ! 42: #include "../sys/kernel.h" ! 43: #ifdef SYSVSHM ! 44: #include "machine/vmparam.h" ! 45: #include "../sys/shm.h" ! 46: #endif ! 47: ! 48: /* ! 49: * System parameter formulae. ! 50: * ! 51: * This file is copied into each directory where we compile ! 52: * the kernel; it should be modified there to suit local taste ! 53: * if necessary. ! 54: * ! 55: * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx ! 56: */ ! 57: ! 58: #ifndef HZ ! 59: #define HZ 100 ! 60: #endif ! 61: int hz = HZ; ! 62: int tick = 1000000 / HZ; ! 63: int tickadj = 240000 / (60 * HZ); /* can adjust 240ms in 60s */ ! 64: struct timezone tz = { TIMEZONE, DST }; ! 65: #define NPROC (20 + 8 * MAXUSERS) ! 66: int nproc = NPROC; ! 67: #define NTEXT (36 + MAXUSERS) ! 68: int ntext = NTEXT; ! 69: #define NVNODE (NPROC + NTEXT + 300) ! 70: long desiredvnodes = NVNODE; ! 71: int nfile = 16 * (NPROC + 16 + MAXUSERS) / 10 + 32; ! 72: int ncallout = 16 + NPROC; ! 73: int nclist = 60 + 12 * MAXUSERS; ! 74: int nmbclusters = NMBCLUSTERS; ! 75: int fscale = FSCALE; /* kernel uses `FSCALE', user uses `fscale' */ ! 76: ! 77: /* ! 78: * Values in support of System V compatible shared memory. ! 79: */ ! 80: #ifdef SYSVSHM ! 81: #define SHMMAX (SHMMAXPGS*NBPG) ! 82: #define SHMMIN 1 ! 83: #define SHMMNI 32 /* <= SHMMMNI in shm.h */ ! 84: #define SHMSEG 8 ! 85: #define SHMALL (SHMMAXPGS/CLSIZE) ! 86: ! 87: struct shminfo shminfo = { ! 88: SHMMAX, ! 89: SHMMIN, ! 90: SHMMNI, ! 91: SHMSEG, ! 92: SHMALL ! 93: }; ! 94: #endif ! 95: ! 96: /* ! 97: * These are initialized at bootstrap time ! 98: * to values dependent on memory size ! 99: */ ! 100: int nbuf, nswbuf; ! 101: ! 102: /* ! 103: * These have to be allocated somewhere; allocating ! 104: * them here forces loader errors if this file is omitted ! 105: * (if they've been externed everywhere else; hah!). ! 106: */ ! 107: struct proc *proc, *procNPROC; ! 108: struct text *text, *textNTEXT; ! 109: struct file *file, *fileNFILE; ! 110: struct callout *callout; ! 111: struct cblock *cfree; ! 112: struct buf *buf, *swbuf; ! 113: char *buffers; ! 114: struct cmap *cmap, *ecmap; ! 115: ! 116: /* ! 117: * Proc/pgrp hashing. ! 118: * Here so that hash table sizes can depend on MAXUSERS/NPROC. ! 119: * Hash size must be a power of two. ! 120: * NOW omission of this file will cause loader errors! ! 121: */ ! 122: ! 123: #if NPROC > 1024 ! 124: #define PIDHSZ 512 ! 125: #else ! 126: #if NPROC > 512 ! 127: #define PIDHSZ 256 ! 128: #else ! 129: #if NPROC > 256 ! 130: #define PIDHSZ 128 ! 131: #else ! 132: #define PIDHSZ 64 ! 133: #endif ! 134: #endif ! 135: #endif ! 136: ! 137: struct proc *pidhash[PIDHSZ]; ! 138: struct pgrp *pgrphash[PIDHSZ]; ! 139: int pidhashmask = PIDHSZ - 1;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.