home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / sys / vmsystm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.9 KB  |  87 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. /*
  11.  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  12.  *         PROPRIETARY NOTICE (Combined)
  13.  * 
  14.  * This source code is unpublished proprietary information
  15.  * constituting, or derived under license from AT&T's UNIX(r) System V.
  16.  * In addition, portions of such source code were derived from Berkeley
  17.  * 4.3 BSD under license from the Regents of the University of
  18.  * California.
  19.  * 
  20.  * 
  21.  * 
  22.  *         Copyright Notice 
  23.  * 
  24.  * Notice of copyright on this source code product does not indicate 
  25.  * publication.
  26.  * 
  27.  *     (c) 1986,1987,1988,1989  Sun Microsystems, Inc
  28.  *     (c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
  29.  *               All rights reserved.
  30.  *  
  31.  */
  32.  
  33. #ifndef _SYS_VMSYSTM_H
  34. #define _SYS_VMSYSTM_H
  35.  
  36. #ident    "@(#)/usr/include/sys/vmsystm.h.sl 1.1 4.0 12/08/90 30387 AT&T-USL"
  37.  
  38. #ifdef _KERNEL
  39.  
  40. /*
  41.  * Miscellaneous virtual memory subsystem variables and routines.
  42.  */
  43.  
  44. extern int    freemem;    /* remaining blocks of free memory */
  45. extern int    deficit;    /* estimate of needs of new swapped in procs */
  46. extern int    nscan;        /* number of scans in last second */
  47. extern int    desscan;    /* desired pages scanned per second */
  48.  
  49. /* writable copies of tunables */
  50. extern int    maxpgio;    /* max paging i/o per sec before start swaps */
  51. extern int    lotsfree;    /* max free before clock freezes */
  52. extern int    minfree;    /* minimum free pages before swapping begins */
  53. extern int    desfree;    /* no of pages to try to keep free via daemon */
  54.  
  55. #if defined(__STDC__)
  56. extern void vmtotal(void);
  57. extern int valid_va_range(addr_t *, u_int *, u_int, int);
  58. extern int valid_usr_range(addr_t, size_t);
  59. extern int useracc(caddr_t, uint, int);
  60. extern int userwrite(addr_t, size_t);
  61. extern int page_deladd(int, int, rval_t *);
  62. extern void map_addr(addr_t *, u_int, off_t, int);
  63. #else
  64. extern void vmtotal();
  65. extern int valid_va_range();
  66. extern int valid_usr_range();
  67. extern int useracc();
  68. extern int userwrite();
  69. extern int page_deladd();
  70. extern void map_addr();
  71. #endif    /* __STDC__ */
  72.  
  73. /* writeable_usr_range() checks that an address range is within the
  74.    valid user address range, and that it is user-writeable.
  75.    On machines where read/write page permissions are enforced on kernel
  76.    accesses as well as user accesses, this can be simply defined as
  77.    valid_usr_range(addr, size), since the appropriate checks will be done
  78.    at the time of the actual writes.  Otherwise, this must also call a
  79.    routine to simulate a user write fault on the address range. */
  80.  
  81. #define writeable_usr_range(addr, size) \
  82.         (valid_usr_range(addr, size) && userwrite(addr, size) == 0)
  83.  
  84. #endif    /* _KERNEL */
  85.  
  86. #endif    /* _SYS_VMSYSTM_H */
  87.