home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / conf / param.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  5.3 KB  |  185 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    param.c,v $
  29.  * Revision 2.1  92/04/21  17:11:40  rwd
  30.  * BSDSS
  31.  * 
  32.  *
  33.  */
  34.  
  35. /*
  36.  * Copyright (c) 1980, 1986, 1989 Regents of the University of California.
  37.  * All rights reserved.
  38.  *
  39.  * Redistribution and use in source and binary forms, with or without
  40.  * modification, are permitted provided that the following conditions
  41.  * are met:
  42.  * 1. Redistributions of source code must retain the above copyright
  43.  *    notice, this list of conditions and the following disclaimer.
  44.  * 2. Redistributions in binary form must reproduce the above copyright
  45.  *    notice, this list of conditions and the following disclaimer in the
  46.  *    documentation and/or other materials provided with the distribution.
  47.  * 3. All advertising materials mentioning features or use of this software
  48.  *    must display the following acknowledgement:
  49.  *    This product includes software developed by the University of
  50.  *    California, Berkeley and its contributors.
  51.  * 4. Neither the name of the University nor the names of its contributors
  52.  *    may be used to endorse or promote products derived from this software
  53.  *    without specific prior written permission.
  54.  *
  55.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  56.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  57.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  58.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  59.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  60.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  61.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  62.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  63.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  64.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  65.  * SUCH DAMAGE.
  66.  *
  67.  *    @(#)param.c    7.20 (Berkeley) 6/27/91
  68.  */
  69.  
  70. #include <sys/param.h>
  71. #include <sys/systm.h>
  72. #include <sys/socket.h>
  73. #include <sys/proc.h>
  74. #include <sys/vnode.h>
  75. #include <sys/file.h>
  76. #include <sys/callout.h>
  77. #include <sys/clist.h>
  78. #include <sys/mbuf.h>
  79. #include <ufs/quota.h>
  80. #include <sys/kernel.h>
  81. #ifdef SYSVSHM
  82. #include <machine/vmparam.h>
  83. #include <sys/shm.h>
  84. #endif
  85.  
  86. /*
  87.  * System parameter formulae.
  88.  *
  89.  * This file is copied into each directory where we compile
  90.  * the kernel; it should be modified there to suit local taste
  91.  * if necessary.
  92.  *
  93.  * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx
  94.  */
  95.  
  96. #ifndef TIMEZONE
  97. #define TIMEZONE 300
  98. #endif
  99. #ifndef MAXUSERS
  100. #define MAXUSERS 16
  101. #endif
  102. #ifndef DST
  103. #define DST 1
  104. #endif
  105. #ifndef MAXDSIZE
  106. #define MAXDSIZ 0x2000000
  107. #endif
  108. #ifndef HZ
  109. #define    HZ 1000
  110. #endif
  111. int    hz = HZ;
  112. int    tick = 1000000 / HZ;
  113. int    tickadj = 240000 / (60 * HZ);        /* can adjust 240ms in 60s */
  114. struct    timezone tz = { TIMEZONE, DST };
  115. #define    NPROC (20 + 16 * MAXUSERS)
  116. int    maxproc = NPROC;
  117. #define    NTEXT (80 + NPROC / 8)            /* actually the object cache */
  118. #define    NVNODE (NPROC + NTEXT + 100)
  119. long    desiredvnodes = NVNODE;
  120. int    maxfiles = 3 * (NPROC + MAXUSERS) + 80;
  121. int    ncallout = 16 + NPROC;
  122. int    nclist = 60 + 12 * MAXUSERS;
  123. int    nmbclusters = NMBCLUSTERS;
  124. int    fscale = FSCALE;    /* kernel uses `FSCALE', user uses `fscale' */
  125.  
  126. /*
  127.  * Values in support of System V compatible shared memory.    XXX
  128.  */
  129. #ifdef SYSVSHM
  130. #define    SHMMAX    (SHMMAXPGS*NBPG)
  131. #define    SHMMIN    1
  132. #define    SHMMNI    32            /* <= SHMMMNI in shm.h */
  133. #define    SHMSEG    8
  134. #define    SHMALL    (SHMMAXPGS/CLSIZE)
  135.  
  136. struct    shminfo shminfo = {
  137.     SHMMAX,
  138.     SHMMIN,
  139.     SHMMNI,
  140.     SHMSEG,
  141.     SHMALL
  142. };
  143. #endif
  144.  
  145. /*
  146.  * These are initialized at bootstrap time
  147.  * to values dependent on memory size
  148.  */
  149. int    nbuf, nswbuf;
  150.  
  151. /*
  152.  * These have to be allocated somewhere; allocating
  153.  * them here forces loader errors if this file is omitted
  154.  * (if they've been externed everywhere else; hah!).
  155.  */
  156. struct     callout *callout;
  157. struct    cblock *cfree;
  158. struct    buf *buf, *swbuf;
  159. char    *buffers;
  160.  
  161. /*
  162.  * Proc/pgrp hashing.
  163.  * Here so that hash table sizes can depend on MAXUSERS/NPROC.
  164.  * Hash size must be a power of two.
  165.  * NOW omission of this file will cause loader errors!
  166.  */
  167.  
  168. #if NPROC > 1024
  169. #define    PIDHSZ        512
  170. #else
  171. #if NPROC > 512
  172. #define    PIDHSZ        256
  173. #else
  174. #if NPROC > 256
  175. #define    PIDHSZ        128
  176. #else
  177. #define    PIDHSZ        64
  178. #endif
  179. #endif
  180. #endif
  181.  
  182. struct    proc *pidhash[PIDHSZ];
  183. struct    pgrp *pgrphash[PIDHSZ];
  184. int    pidhashmask = PIDHSZ - 1;
  185.