home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / param.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  7.0 KB  |  251 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_PARAM_H
  11. #define _SYS_PARAM_H
  12.  
  13. #ident    "@(#)/usr/include/sys/param.h.sl 1.1 4.0 12/08/90 64116 AT&T-USL"
  14.  
  15. #include <sys/types.h>
  16. #include <sys/fs/s5param.h>
  17. /*
  18.  * Fundamental variables; don't change too often.
  19.  */
  20. #ifndef _POSIX_VDISABLE
  21. #define _POSIX_VDISABLE 0 /* Disable special character functions */
  22. #endif
  23.  
  24. #ifndef MAX_INPUT
  25. #define MAX_INPUT 512     /* Maximum bytes stored in the input queue */
  26. #endif
  27.  
  28. #ifndef MAX_CANON
  29. #define MAX_CANON 256     /* Maximum bytes in a line for canoical processing */
  30. #endif
  31.  
  32. #define UID_NOBODY  60001   /* user ID no body */
  33. #define GID_NOBODY  UID_NOBODY
  34.  
  35. #define UID_NOACCESS    60002   /* user ID no access */
  36.  
  37.  
  38. #define    MAXPID    30000        /* max process id */
  39. #define    MAXUID    60002        /* max user id */
  40. #define    MAXLINK    1000        /* max links */
  41.  
  42. #define    SSIZE    1        /* initial stack size (*4096 bytes) */
  43. #define    SINCR    1        /* increment of stack (*4096 bytes) */
  44. #define    USIZE    MINUSIZE    /* inital size of user block (*4096) */
  45. #define    MINUSIZE  2        /* min size of user block (*4096 bytes) */
  46. #define    MAXUSIZE 18        /* max size of user block (*4096 bytes) */
  47.  
  48. #define    CANBSIZ    256        /* max size of typewriter line    */
  49. #define    HZ    100        /* 100 ticks/second of the clock */
  50. #define TICK    10000000    /* nanoseconds per tick */
  51.  
  52.  
  53. #define NOFILE    20        /* this define is here for    */
  54.                 /* compatibility purposes only    */
  55.                 /* and will be removed in a    */
  56.                 /* later release        */
  57.  
  58. /*
  59.  * The following macros are no longer supported in SVR 4.0
  60.  * since there is no longer a limit on the number of files that
  61.  * a process can open. However, for SVR3.2 source compatibility, 
  62.  * you may uncomment  NOFILES_MIN and NOFILES_MAX.
  63.  */
  64.  
  65. /* #define    NOFILES_MIN     20    SVR3.2 Source Compatibility */
  66. /* #define    NOFILES_MAX    100    SVR3.2 Source Compatibility */
  67.  
  68. /*
  69.  * These define the maximum and minimum allowable values of the
  70.  * configurable parameter NGROUPS_MAX.
  71.  */
  72. #define    NGROUPS_UMAX    32
  73. #define    NGROUPS_UMIN    0
  74.  
  75. /*
  76.  * The following defines apply to the kernel virtual address space.
  77.  */
  78.  
  79. /*
  80.  * The size of the kernel segment table in pages.  The starting address
  81.  * comes from the vuifile.
  82.  */
  83. #define MAXKSEG        127    /*max no of pages per kseg */
  84.  
  85. /*
  86.  * To avoid prefetch errors at the end of a region, it must
  87.  * be padded with the following number of bytes.
  88.  */
  89.  
  90. #define    PREFETCH    0
  91.  
  92. /*
  93.  * Priorities.  Should not be altered too much.
  94.  */
  95.  
  96. #define    PMASK    0177
  97. #define    PCATCH    0400
  98. #define    PNOSTOP    01000
  99. #define    PSWP    0
  100. #define    PINOD    10
  101. #define PSNDD    PINOD
  102. #define    PRIBIO    20
  103. #define    PZERO    25
  104. #define PMEM    0
  105. #define    NZERO    20
  106. #define    PPIPE    26
  107. #define PVFS    27
  108. #define    PWAIT    30
  109. #define    PSLEP    39
  110. #define    PUSER    60
  111. #define    PIDLE    127
  112.  
  113. /*
  114.  * Fundamental constants of the implementation--cannot be changed easily.
  115.  */
  116.  
  117. #define    NBPW    sizeof(int)    /* number of bytes in an integer */
  118. #define    NCPPT    1024        /* Number of clicks per page table */
  119. #define    CPPTSHIFT    10    /* LOG2(NCPPT) if exact */
  120. #define    NBPC    4096        /* Number of bytes per click */
  121. #define    BPCSHIFT    12    /* LOG2(NBPC) if exact */
  122. #define    NULL    0
  123. #define    CMASK    0        /* default mask for file creation */
  124. #define    CDLIMIT    (1L<<14)    /* default max write address */
  125. #define NBPSCTR         512     /* Bytes per LOGICAL disk sector. */
  126. #define    UBSIZE        512    /* unix block size.        */
  127. #define SCTRSHFT    9    /* Shift for BPSECT.        */
  128.  
  129. #define    UMODE    3        /* current Xlevel == user */
  130. #define    USERMODE(cs)    (((cs) & SEL_RPL) == UMODE)
  131.  
  132. #define    lobyte(X)    (((unsigned char *)&(X))[0])
  133. #define    hibyte(X)    (((unsigned char *)&(X))[1])
  134. #define    loword(X)    (((ushort *)&(X))[0])
  135. #define    hiword(X)    (((ushort *)&(X))[1])
  136.  
  137. #define    MAXSUSE    255
  138.  
  139. /* REMOTE -- whether machine is primary, secondary, or regular */
  140. #define SYSNAME 9        /* # chars in system name */
  141. #define PREMOTE 39
  142.  
  143. /* XENIX compatibility */
  144. #define    ktop(vaddr)    ((paddr_t)svirtophys(vaddr))
  145.  
  146. /*
  147.  * MAXPATHLEN defines the longest permissible path length,
  148.  * including the terminating null, after expanding symbolic links.
  149.  * MAXSYMLINKS defines the maximum number of symbolic links
  150.  * that may be expanded in a path name. It should be set high
  151.  * enough to allow all legitimate uses, but halt infinite loops
  152.  * reasonably quickly.
  153.  * MAXNAMELEN is the length (including the terminating null) of
  154.  * the longest permissible file (component) name.
  155.  */
  156. #define    MAXPATHLEN    1024
  157. #define    MAXSYMLINKS    20
  158. #define    MAXNAMELEN    256
  159.  
  160. #ifndef NADDR
  161. #define NADDR 13
  162. #endif
  163.  
  164. /*
  165.  * The following are defined to be the same as
  166.  * defined in /usr/include/limits.h.  They are
  167.  * needed for pipe and FIFO compatibility.
  168.  */
  169. #ifndef PIPE_BUF    /* max # bytes atomic in write to a pipe */
  170. #ifdef u3b15
  171. #define PIPE_BUF    4096
  172. #else
  173. #define PIPE_BUF    5120
  174. #endif    /* u3b15 */
  175. #endif    /* PIPE_BUF */
  176.  
  177. #ifndef PIPE_MAX    /* max # bytes written to a pipe in a write */
  178. #ifdef u3b15
  179. #define PIPE_MAX    4096
  180. #else
  181. #define PIPE_MAX    5120
  182. #endif    /* u3b15 */
  183. #endif    /* PIPE_MAX */
  184.  
  185. #define NBBY    8            /* number of bits per byte */
  186.  
  187. /*
  188.  * File system parameters and macros.
  189.  *
  190.  * The file system is made out of blocks of at most MAXBSIZE units,
  191.  * with smaller units (fragments) only in the last direct block.
  192.  * MAXBSIZE primarily determines the size of buffers in the buffer
  193.  * pool. It may be made larger without any effect on existing
  194.  * file systems; however making it smaller make make some file
  195.  * systems unmountable.
  196.  *
  197.  * Note that the blocked devices are assumed to have DEV_BSIZE
  198.  * "sectors" and that fragments must be some multiple of this size.
  199.  */
  200. #define    MAXBSIZE    8192
  201. #define    DEV_BSIZE    512
  202. #define    DEV_BSHIFT    9        /* log2(DEV_BSIZE) */
  203. #define    MAXFRAG     8
  204.  
  205. #define    btodb(bytes)             /* calculates (bytes / DEV_BSIZE) */ \
  206.     ((unsigned)(bytes) >> DEV_BSHIFT)
  207. #define    dbtob(db)            /* calculates (db * DEV_BSIZE) */ \
  208.     ((unsigned)(db) << DEV_BSHIFT)
  209.  
  210. /*
  211.  * MMU_PAGES* describes the physical page size used by the mapping hardware.
  212.  * PAGES* describes the logical page size used by the system.
  213.  */
  214.  
  215. #define    MMU_PAGESIZE    0x1000        /* 4096 bytes */
  216. #define    MMU_PAGESHIFT    12        /* log2(MMU_PAGESIZE) */
  217. #define    MMU_PAGEOFFSET    (MMU_PAGESIZE-1)/* Mask of address bits in page */
  218. #define    MMU_PAGEMASK    (~MMU_PAGEOFFSET)
  219.  
  220. #define    PAGESIZE    0x1000        /* All of the above, for logical */
  221. #define    PAGESHIFT    12
  222. #define    PAGEOFFSET    (PAGESIZE - 1)
  223. #define    PAGEMASK    (~PAGEOFFSET)
  224.  
  225. #ifndef NODEV
  226. #define NODEV    (dev_t)(-1)
  227. #endif
  228.  
  229. /*
  230.  * Some random macros for units conversion.
  231.  */
  232.  
  233. /*
  234.  * MMU pages to bytes, and back (with and without rounding)
  235.  */
  236. #define    mmu_ptob(x)    ((x) << MMU_PAGESHIFT)
  237. #define    mmu_btop(x)    (((unsigned)(x)) >> MMU_PAGESHIFT)
  238. #define    mmu_btopr(x)    ((((unsigned)(x) + MMU_PAGEOFFSET) >> MMU_PAGESHIFT))
  239.  
  240. /*
  241.  * pages to bytes, and back (with and without rounding)
  242.  */
  243. #define    ptob(x)        ((x) << PAGESHIFT)
  244. #define    btop(x)        (((unsigned)(x)) >> PAGESHIFT)
  245. #define    btopr(x)    ((((unsigned)(x) + PAGEOFFSET) >> PAGESHIFT))
  246.  
  247. #define shm_alignment    ctob(1)        /* segment size */
  248.  
  249.  
  250. #endif    /* _SYS_PARAM_H */
  251.