add basic data types
[unix-history] / usr / src / sys / vax / include / vmparam.h
index 3a5a0d3..0d927be 100644 (file)
@@ -1,4 +1,11 @@
-/*     vmparam.h       6.1     83/07/29        */
+/*-
+ * Copyright (c) 1982, 1986 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.proprietary.c%
+ *
+ *     @(#)vmparam.h   7.4 (Berkeley) %G%
+ */
 
 /*
  * Machine dependent constants for VAX
 
 /*
  * Machine dependent constants for VAX
  * beginning of the text and from the beginning of the P1 region to the
  * beginning of the stack respectively.
  */
  * beginning of the text and from the beginning of the P1 region to the
  * beginning of the stack respectively.
  */
-                                       /* number of ptes per page */
 #define        USRTEXT         0
 #define        USRTEXT         0
-#define        USRSTACK        (0x80000000-UPAGES*NBPG)
-                                       /* Start of user stack */
+#define        USRSTACK        (0x80000000-UPAGES*NBPG) /* Start of user stack */
+#define        BTOPUSRSTACK    (0x400000 - UPAGES)      /* btop(USRSTACK) */
+/* number of ptes per page */
 #define        P1PAGES         0x200000        /* number of pages in P1 region */
 #define        LOWPAGES        0
 #define        HIGHPAGES       UPAGES
 
 /*
 #define        P1PAGES         0x200000        /* number of pages in P1 region */
 #define        LOWPAGES        0
 #define        HIGHPAGES       UPAGES
 
 /*
- * Virtual memory related constants
+ * Virtual memory related constants, all in bytes
  */
  */
-#define        SLOP    32
-#define        MAXTSIZ         (6*2048-SLOP)           /* max text size (clicks) */
+#ifndef MAXTSIZ
+#define        MAXTSIZ         (6*1024*1024)           /* max text size */
+#endif
+#ifndef DFLDSIZ
+#define        DFLDSIZ         (6*1024*1024)           /* initial data size limit */
+#endif
 #ifndef MAXDSIZ
 #ifndef MAXDSIZ
-#define        MAXDSIZ         (12*1024-32-SLOP)       /* max data size (clicks) */
+#define        MAXDSIZ         (16*1024*1024)          /* max data size */
+#endif
+#ifndef        DFLSSIZ
+#define        DFLSSIZ         (512*1024)              /* initial stack size limit */
 #endif
 #endif
-#define        MAXSSIZ         (12*1024-32-SLOP)       /* max stack size (clicks) */
+#ifndef        MAXSSIZ
+#define        MAXSSIZ         MAXDSIZ                 /* max stack size */
+#endif
+
+/*
+ * Default sizes of swap allocation chunks (see dmap.h).
+ * The actual values may be changed in vminit() based on MAXDSIZ.
+ * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024.
+ * DMMIN should be at least ctod(1) so that vtod() works.
+ * vminit() ensures this.
+ */
+#define        DMMIN   32                      /* smallest swap allocation */
+#define        DMMAX   4096                    /* largest potential swap allocation */
+#define        DMTEXT  1024                    /* swap allocation for text */
 
 /*
  * Sizes of the system and user portions of the system page table.
  */
 /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
 #define        SYSPTSIZE       ((20+MAXUSERS)*NPTEPG)
 
 /*
  * Sizes of the system and user portions of the system page table.
  */
 /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
 #define        SYSPTSIZE       ((20+MAXUSERS)*NPTEPG)
-#define        USRPTSIZE       (8*NPTEPG)
+#define        USRPTSIZE       (32*NPTEPG)
+
+/*
+ * PTEs for system V compatible shared memory.
+ * This is basically slop for kmempt which we actually allocate (malloc) from.
+ */
+#define SHMMAXPGS      1024
+
+/*
+ * Boundary at which to place first MAPMEM segment if not explicitly
+ * specified.  Should be a power of two.  This allows some slop for
+ * the data segment to grow underneath the first mapped segment.
+ */
+#define MMSEG          0x200000
 
 /*
  * The size of the clock loop.
 
 /*
  * The size of the clock loop.
  * larger than it really is.
  *
  * KLMAX gives maximum cluster size in CLSIZE page (cluster-page)
  * larger than it really is.
  *
  * KLMAX gives maximum cluster size in CLSIZE page (cluster-page)
- * units.  Note that KLMAX*CLSIZE must be <= DMMIN in dmap.h.
+ * units.  Note that ctod(KLMAX*CLSIZE) must be <= DMMIN in dmap.h.
+ * ctob(KLMAX) should also be less than MAXPHYS (in vm_swp.c) to
+ * avoid "big push" panics.
  */
 
 #define        KLMAX   (32/CLSIZE)
  */
 
 #define        KLMAX   (32/CLSIZE)
 
 /*
  * Paging thresholds (see vm_sched.c).
 
 /*
  * Paging thresholds (see vm_sched.c).
- * Strategy of 4/22/81:
- *     lotsfree is 1/4 of memory free.
+ * Strategy of 1/19/85:
+ *     lotsfree is 512k bytes, but at most 1/4 of memory
  *     desfree is 200k bytes, but at most 1/8 of memory
  *     minfree is 64k bytes, but at most 1/2 of desfree
  */
  *     desfree is 200k bytes, but at most 1/8 of memory
  *     minfree is 64k bytes, but at most 1/2 of desfree
  */
+#define        LOTSFREE        (512 * 1024)
 #define        LOTSFREEFRACT   4
 #define        DESFREE         (200 * 1024)
 #define        DESFREEFRACT    8
 #define        MINFREE         (64 * 1024)
 #define        MINFREEFRACT    2
 
 #define        LOTSFREEFRACT   4
 #define        DESFREE         (200 * 1024)
 #define        DESFREEFRACT    8
 #define        MINFREE         (64 * 1024)
 #define        MINFREEFRACT    2
 
+/*
+ * There are two clock hands, initially separated by HANDSPREAD bytes
+ * (but at most all of user memory).  The amount of time to reclaim
+ * a page once the pageout process examines it increases with this
+ * distance and decreases as the scan rate rises.
+ */
+#define        HANDSPREAD      (2 * 1024 * 1024)
+
+/*
+ * The number of times per second to recompute the desired paging rate
+ * and poke the pagedaemon.
+ */
+#define        RATETOSCHEDPAGING       4
+
 /*
  * Believed threshold (in megabytes) for which interleaved
  * swapping area is desirable.
  */
 #define        LOTSOFMEM       2
 
 /*
  * Believed threshold (in megabytes) for which interleaved
  * swapping area is desirable.
  */
 #define        LOTSOFMEM       2
 
-/*
- * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1
- */
-#define        mapin(pte, v, pfnum, count, prot) \
-       (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))
+#define        mapin(pte, v, pfnum, prot) \
+       (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, v))