|
|
1.1 ! root 1: /* ! 2: * Tunable variables which do not usually vary per system. ! 3: * ! 4: * The sizes of most system tables are configured ! 5: * into each system description. The file system buffer ! 6: * cache size is assigned based on available memory. ! 7: * The tables whose sizes don't vary often are given here. ! 8: */ ! 9: ! 10: #define NMOUNT 62 /* number of mountable file systems (cmap.h) */ ! 11: #define MSWAPX 15 /* pseudo mount table index for swapdev */ ! 12: #if MANYPROC ! 13: #define MAXUPRC 75 ! 14: #else ! 15: #define MAXUPRC 35 /* max processes per user */ ! 16: #endif ! 17: #define SSIZE 4 /* initial stack size (*512 bytes) */ ! 18: #define SINCR 4 /* increment of stack (*512 bytes) */ ! 19: #define NOFILE 128 /* max open files per process */ ! 20: #define NSYSFILE 4 /* stdin, stdout, stderr, /dev/tty */ ! 21: #define CANBSIZ 256 /* max size of typewriter line */ ! 22: #define NCARGS (16*1024) /* # characters in exec arglist */ ! 23: #define NGROUPS 32 /* number of simultaneous groups */ ! 24: ! 25: /* ! 26: * priorities ! 27: * probably should not be ! 28: * altered too much ! 29: */ ! 30: ! 31: #define PSWP 0 ! 32: #define PINOD 10 ! 33: #define PRIBIO 20 ! 34: #define PRIUBA 24 ! 35: #define PZERO 25 ! 36: #define PPIPE 26 ! 37: #define PWAIT 30 ! 38: #define PSLEP 40 ! 39: #define PUSER 50 ! 40: ! 41: #define NZERO 20 ! 42: ! 43: /* ! 44: * signals ! 45: * dont change ! 46: */ ! 47: ! 48: #ifndef NSIG ! 49: #include <signal.h> ! 50: #endif ! 51: ! 52: /* ! 53: * Return values from tsleep(). ! 54: */ ! 55: #define TS_OK 0 /* normal wakeup */ ! 56: #define TS_TIME 1 /* timed-out wakeup */ ! 57: #define TS_SIG 2 /* asynchronous signal wakeup */ ! 58: ! 59: /* ! 60: * fundamental constants of the implementation-- ! 61: * cannot be changed easily. ! 62: */ ! 63: ! 64: #define NBBY 8 /* number of bits in a byte */ ! 65: #define NBPW sizeof(int) /* number of bytes in an integer */ ! 66: #define NBPG 512 ! 67: #define PGOFSET (NBPG-1) /* byte offset into page */ ! 68: #define PGSHIFT 9 /* LOG2(NBPG) */ ! 69: ! 70: #define UPAGES 10 /* pages of u-area */ ! 71: #define NULL 0 ! 72: #define CMASK 0 /* default mask for file creation */ ! 73: #define NODEV (dev_t)(-1) ! 74: #define ROOTINO ((ino_t)2) /* i number of all roots */ ! 75: #define SUPERB ((daddr_t)1) /* block number of the super block */ ! 76: #define DIRSIZ 14 /* max characters per directory */ ! 77: ! 78: /* ! 79: * Clustering of hardware pages on machines with ridiculously small ! 80: * page sizes is done here. The paging subsystem deals with units of ! 81: * CLSIZE pte's describing NBPG (from vm.h) pages each... BSIZE must ! 82: * be CLSIZE*NBPG in the current implementation, that is the paging subsystem ! 83: * deals with the same size blocks that the file system uses. ! 84: * ! 85: * NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE ! 86: */ ! 87: #define CLSIZE 2 ! 88: #define CLOFSET (CLSIZE*NBPG-1) /* for clusters, like PGOFSET */ ! 89: ! 90: /* give the base virtual address (first of CLSIZE) */ ! 91: #define clbase(i) ((i) &~ (CLSIZE-1)) ! 92: ! 93: /* round a number of clicks up to a whole cluster */ ! 94: #define clrnd(i) (((i) + (CLSIZE-1)) &~ (CLSIZE-1)) ! 95: ! 96: #if CLSIZE==1 ! 97: #define BSIZE 512 /* size of secondary block (bytes) */ ! 98: #define INOPB 8 /* 8 inodes per block */ ! 99: #define BMASK 0777 /* BSIZE-1 */ ! 100: #define BSHIFT 9 /* LOG2(BSIZE) */ ! 101: #define NMASK 0177 /* NINDIR-1 */ ! 102: #define NSHIFT 7 /* LOG2(NINDIR) */ ! 103: #define NICINOD 100 /* number of superblock inodes */ ! 104: #define NICFREE 50 /* number of superblock free blocks */ ! 105: ! 106: #endif ! 107: ! 108: #if CLSIZE==2 ! 109: #define BITFS(dev) ((dev) & 64) ! 110: #define BUFSIZE 4096 ! 111: #define BSIZE(dev) (BITFS(dev)? 4096: 1024) ! 112: #define INOPB(dev) (BITFS(dev)? 64: 16) ! 113: #define BMASK(dev) (BITFS(dev)? 07777: 01777) ! 114: #define BSHIFT(dev) (BITFS(dev)? 12: 10) ! 115: #define NMASK(dev) (BITFS(dev)? 01777: 0377) ! 116: #define NSHIFT(dev) (BITFS(dev)? 10: 8) ! 117: #define NICINOD 100 ! 118: #define NICFREE 178 ! 119: #define itod(dev, x) ((daddr_t)((((unsigned)(x)+2*INOPB(dev)-1)/INOPB(dev)))) ! 120: #define itoo(dev, x) ((int)(((x)+2*INOPB(dev)-1)%INOPB(dev))) ! 121: #define fsbtodb(dev, b) (BITFS(dev)? (b)*8: (b)*CLSIZE) ! 122: #define dbtofsb(dev, b) (BITFS(dev)? (b)/8: (b)/CLSIZE) ! 123: #define NINDIR(dev) (BSIZE(dev)/sizeof(daddr_t)) ! 124: #endif ! 125: ! 126: #if CLSIZE==4 ! 127: #define BSIZE 2048 ! 128: #define INOPB 32 ! 129: #define BMASK 03777 ! 130: #define BSHIFT 11 ! 131: #define NMASK 0777 ! 132: #define NSHIFT 9 ! 133: #define NICINOD 100 ! 134: #define NICFREE 434 ! 135: #endif ! 136: ! 137: #ifndef INTRLVE ! 138: /* macros replacing interleaving functions */ ! 139: #define dkblock(bp) ((bp)->b_blkno) ! 140: #define dkunit(bp) (minor((bp)->b_dev & 077) >> 3) ! 141: /* that means 8 units with at most 8 pieces each */ ! 142: #endif ! 143: ! 144: #define CBSIZE 28 /* number of chars in a clist block */ ! 145: #define CROUND 0x1F /* clist rounding; sizeof(int *) + CBSIZE -1*/ ! 146: ! 147: /* ! 148: * Macros for fast min/max ! 149: */ ! 150: #define MIN(a,b) (((a)<(b))?(a):(b)) ! 151: #define MAX(a,b) (((a)>(b))?(a):(b)) ! 152: ! 153: /* ! 154: * Some macros for units conversion ! 155: */ ! 156: /* Core clicks (512 bytes) to segments and vice versa */ ! 157: #define ctos(x) (x) ! 158: #define stoc(x) (x) ! 159: ! 160: /* Core clicks (512 bytes) to disk blocks */ ! 161: #define ctod(x) (x) ! 162: ! 163: /* clicks to bytes */ ! 164: #define ctob(x) ((x)<<9) ! 165: ! 166: /* bytes to clicks */ ! 167: #define btoc(x) ((((unsigned)(x)+511)>>9)) ! 168: ! 169: #ifndef KERNEL ! 170: #include <sys/types.h> ! 171: #else ! 172: #include "../h/types.h" ! 173: #endif ! 174: ! 175: /* ! 176: * Machine-dependent bits and macros ! 177: */ ! 178: #define UMODE PSL_CURMOD /* usermode bits */ ! 179: #define USERMODE(ps) (((ps) & UMODE) == UMODE) ! 180: ! 181: #define BASEPRI(ps) (((ps) & PSL_IPL) != 0) ! 182: ! 183: /* ! 184: * Provide about n microseconds of delay ! 185: */ ! 186: #define DELAY(n) { register int N = (n); while (--N > 0); }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.