indir => syscall; __indir => __syscall
[unix-history] / usr / src / sys / conf / param.c
CommitLineData
b1078c35 1/*
da83315a
KM
2 * Copyright (c) 1980, 1986, 1989 Regents of the University of California.
3 * All rights reserved.
86cbc46c 4 *
dbf0c423 5 * %sccs.include.redist.c%
da83315a 6 *
598ea503 7 * @(#)param.c 8.1 (Berkeley) %G%
b1078c35
KM
8 */
9
38a01dbe
KB
10#include <sys/param.h>
11#include <sys/systm.h>
12#include <sys/socket.h>
13#include <sys/proc.h>
14#include <sys/vnode.h>
15#include <sys/file.h>
16#include <sys/callout.h>
17#include <sys/clist.h>
18#include <sys/mbuf.h>
19#include <sys/kernel.h>
20
21#include <ufs/ufs/quota.h>
22
7d08bbf1 23#ifdef SYSVSHM
38a01dbe
KB
24#include <machine/vmparam.h>
25#include <sys/shm.h>
7d08bbf1
KM
26#endif
27
ec6f91b0
BJ
28/*
29 * System parameter formulae.
30 *
31 * This file is copied into each directory where we compile
32 * the kernel; it should be modified there to suit local taste
33 * if necessary.
34 *
35 * Compiled with -DHZ=xx -DTIMEZONE=x -DDST=x -DMAXUSERS=xx
36 */
37
46a9a1d7 38#ifndef HZ
bf75e5ce 39#define HZ 100
46a9a1d7 40#endif
ec6f91b0 41int hz = HZ;
bf75e5ce 42int tick = 1000000 / HZ;
b03a0fb1 43int tickadj = 30000 / (60 * HZ); /* can adjust 30ms in 60s */
bf75e5ce 44struct timezone tz = { TIMEZONE, DST };
582864af 45#define NPROC (20 + 16 * MAXUSERS)
64504438 46int maxproc = NPROC;
582864af
MK
47#define NTEXT (80 + NPROC / 8) /* actually the object cache */
48#define NVNODE (NPROC + NTEXT + 100)
50686e99 49long desiredvnodes = NVNODE;
582864af 50int maxfiles = 3 * (NPROC + MAXUSERS) + 80;
2067e85f 51int ncallout = 16 + NPROC;
e31e5017 52int nclist = 60 + 12 * MAXUSERS;
582864af 53int nmbclusters = NMBCLUSTERS;
80b6b780 54int fscale = FSCALE; /* kernel uses `FSCALE', user uses `fscale' */
ec6f91b0 55
7d08bbf1 56/*
582864af 57 * Values in support of System V compatible shared memory. XXX
7d08bbf1
KM
58 */
59#ifdef SYSVSHM
60#define SHMMAX (SHMMAXPGS*NBPG)
582864af
MK
61#define SHMMIN 1
62#define SHMMNI 32 /* <= SHMMMNI in shm.h */
7d08bbf1 63#define SHMSEG 8
582864af 64#define SHMALL (SHMMAXPGS/CLSIZE)
7d08bbf1
KM
65
66struct shminfo shminfo = {
67 SHMMAX,
68 SHMMIN,
69 SHMMNI,
70 SHMSEG,
71 SHMALL
72};
73#endif
74
ec6f91b0
BJ
75/*
76 * These are initialized at bootstrap time
77 * to values dependent on memory size
78 */
79int nbuf, nswbuf;
80
81/*
82 * These have to be allocated somewhere; allocating
6f33ca1e
MK
83 * them here forces loader errors if this file is omitted
84 * (if they've been externed everywhere else; hah!).
ec6f91b0 85 */
ec6f91b0
BJ
86struct callout *callout;
87struct cblock *cfree;
ec6f91b0 88struct buf *buf, *swbuf;
ec6f91b0 89char *buffers;
76a26bea
MK
90
91/*
92 * Proc/pgrp hashing.
93 * Here so that hash table sizes can depend on MAXUSERS/NPROC.
94 * Hash size must be a power of two.
95 * NOW omission of this file will cause loader errors!
96 */
97
98#if NPROC > 1024
99#define PIDHSZ 512
100#else
101#if NPROC > 512
102#define PIDHSZ 256
103#else
104#if NPROC > 256
105#define PIDHSZ 128
106#else
107#define PIDHSZ 64
108#endif
109#endif
110#endif
111
112struct proc *pidhash[PIDHSZ];
113struct pgrp *pgrphash[PIDHSZ];
114int pidhashmask = PIDHSZ - 1;