Annotation of Net2/conf/param.c, revision 1.1.1.2

1.1       root        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:  *
1.1.1.2 ! root       33:  *     from: @(#)param.c       7.20 (Berkeley) 6/27/91
        !            34:  *     param.c,v 1.4 1993/05/20 03:29:42 cgd Exp
1.1       root       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"
1.1.1.2 ! root       48: #include "sys/utsname.h"
1.1       root       49: #ifdef SYSVSHM
                     50: #include "machine/vmparam.h"
                     51: #include "sys/shm.h"
                     52: #endif
                     53: 
                     54: /*
                     55:  * System parameter formulae.
                     56:  *
                     57:  * This file is copied into each directory where we compile
                     58:  * the kernel; it should be modified there to suit local taste
                     59:  * if necessary.
                     60:  *
1.1.1.2 ! root       61:  * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx -DMAXFDESCS=xx
1.1       root       62:  */
                     63: 
                     64: #ifndef HZ
                     65: #define        HZ 100
                     66: #endif
                     67: int    hz = HZ;
                     68: int    tick = 1000000 / HZ;
                     69: int    tickadj = 240000 / (60 * HZ);           /* can adjust 240ms in 60s */
                     70: struct timezone tz = { TIMEZONE, DST };
                     71: #define        NPROC (20 + 16 * MAXUSERS)
                     72: int    maxproc = NPROC;
                     73: #define        NTEXT (80 + NPROC / 8)                  /* actually the object cache */
                     74: #define        NVNODE (NPROC + NTEXT + 100)
                     75: long   desiredvnodes = NVNODE;
1.1.1.2 ! root       76: int    maxfdescs = MAXFDESCS;
1.1       root       77: int    maxfiles = 3 * (NPROC + MAXUSERS) + 80;
                     78: int    ncallout = 16 + NPROC;
                     79: int    nclist = 60 + 12 * MAXUSERS;
                     80: int    nmbclusters = NMBCLUSTERS;
                     81: int    fscale = FSCALE;        /* kernel uses `FSCALE', user uses `fscale' */
                     82: 
                     83: /*
                     84:  * Values in support of System V compatible shared memory.     XXX
                     85:  */
                     86: #ifdef SYSVSHM
                     87: #define        SHMMAX  (SHMMAXPGS*NBPG)
                     88: #define        SHMMIN  1
                     89: #define        SHMMNI  32                      /* <= SHMMMNI in shm.h */
                     90: #define        SHMSEG  8
                     91: #define        SHMALL  (SHMMAXPGS/CLSIZE)
                     92: 
                     93: struct shminfo shminfo = {
                     94:        SHMMAX,
                     95:        SHMMIN,
                     96:        SHMMNI,
                     97:        SHMSEG,
                     98:        SHMALL
                     99: };
                    100: #endif
                    101: 
                    102: /*
                    103:  * These are initialized at bootstrap time
                    104:  * to values dependent on memory size
                    105:  */
                    106: int    nbuf, nswbuf;
                    107: 
                    108: /*
                    109:  * These have to be allocated somewhere; allocating
                    110:  * them here forces loader errors if this file is omitted
                    111:  * (if they've been externed everywhere else; hah!).
                    112:  */
                    113: struct         callout *callout;
                    114: struct cblock *cfree;
                    115: struct buf *buf, *swbuf;
                    116: char   *buffers;
                    117: 
                    118: /*
                    119:  * Proc/pgrp hashing.
                    120:  * Here so that hash table sizes can depend on MAXUSERS/NPROC.
                    121:  * Hash size must be a power of two.
                    122:  * NOW omission of this file will cause loader errors!
                    123:  */
                    124: 
                    125: #if NPROC > 1024
                    126: #define        PIDHSZ          512
                    127: #else
                    128: #if NPROC > 512
                    129: #define        PIDHSZ          256
                    130: #else
                    131: #if NPROC > 256
                    132: #define        PIDHSZ          128
                    133: #else
                    134: #define        PIDHSZ          64
                    135: #endif
                    136: #endif
                    137: #endif
                    138: 
                    139: struct proc *pidhash[PIDHSZ];
                    140: struct pgrp *pgrphash[PIDHSZ];
                    141: int    pidhashmask = PIDHSZ - 1;
1.1.1.2 ! root      142: 
        !           143: struct  utsname utsname;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.