This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / sys / i386 / include / param.h
index 8d30fac..e5beba3 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)param.h     5.8 (Berkeley) 6/28/91
- *
- * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
- * --------------------         -----   ----------------------
- * CURRENT PATCH LEVEL:         2       00166
- * --------------------         -----   ----------------------
- *
- * 08 Apr 93   Andrew Herbert          Fixes for kmem_alloc panics
- *             Rodney W. Grimes        Tuneable mbuf sizes
- * 04 Jun 93   Rodney W. Grimes        Change default mbuf size to 2048 via
- *                                     MCLSHIFT.
+ *     from: @(#)param.h       5.8 (Berkeley) 6/28/91
+ *     $Id: param.h,v 1.10 1993/11/18 05:02:05 rgrimes Exp $
  */
 
  */
 
+#ifndef _MACHINE_PARAM_H_
+#define _MACHINE_PARAM_H_ 1
+
 /*
  * Machine dependent constants for Intel 386.
  */
 
 /*
  * Machine dependent constants for Intel 386.
  */
 
-#define MACHINE "i386"
+#define MACHINE                "i386"
+#define MID_MACHINE    MID_I386
 
 /*
  * Round p (pointer or byte index) up to a correctly-aligned value
 
 /*
  * Round p (pointer or byte index) up to a correctly-aligned value
 #define ALIGNBYTES     (sizeof(int) - 1)
 #define ALIGN(p)       (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
 
 #define ALIGNBYTES     (sizeof(int) - 1)
 #define ALIGN(p)       (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
 
+/* XXX PGSHIFT and PG_SHIFT are two names for the same thing */
+#define PGSHIFT                12              /* LOG2(NBPG) */
+#define NBPG           (1 << PGSHIFT)  /* bytes/page */
+#define PGOFSET                (NBPG-1)        /* byte offset into page */
+#define NPTEPG         (NBPG/(sizeof (struct pte)))
 
 
-#define        NBPG            4096            /* bytes/page */
-#define        PGOFSET         (NBPG-1)        /* byte offset into page */
-#define        PGSHIFT         12              /* LOG2(NBPG) */
-#define        NPTEPG          (NBPG/(sizeof (struct pte)))
+/* XXX PDRSHIFT and PD_SHIFT are two names for the same thing */
+#define PDRSHIFT       22              /* LOG2(NBPDR) */
+#define NBPDR          (1 << PDRSHIFT) /* bytes/page dir */
+#define PDROFSET       (NBPDR-1)       /* byte offset into page dir */
 
 
-#define NBPDR          (1024*NBPG)     /* bytes/page dir */
-#define        PDROFSET        (NBPDR-1)       /* byte offset into page dir */
-#define        PDRSHIFT        22              /* LOG2(NBPDR) */
+/*
+ * XXX This should really be KPTDPTDI << PDRSHIFT, but since KPTDPTDI is
+ * defined in pmap.h which is included after this we can't do that
+ * (YET!)
+ */
+#define KERNBASE       0xFE000000UL    /* start of kernel virtual */
+#define BTOPKERNBASE   (KERNBASE >> PGSHIFT)
 
 
-#define        KERNBASE        0xFE000000      /* start of kernel virtual */
-#define        BTOPKERNBASE    ((u_long)KERNBASE >> PGSHIFT)
+#define DEV_BSHIFT     9               /* log2(DEV_BSIZE) */
+#define DEV_BSIZE      (1 << DEV_BSHIFT)
 
 
-#define        DEV_BSIZE       512
-#define        DEV_BSHIFT      9               /* log2(DEV_BSIZE) */
 #define BLKDEV_IOSIZE  2048
 #define BLKDEV_IOSIZE  2048
-#define        MAXPHYS         (64 * 1024)     /* max raw I/O transfer size */
+#define MAXPHYS                (64 * 1024)     /* max raw I/O transfer size */
 
 
-#define        CLSIZE          1
-#define        CLSIZELOG2      0
+#define CLSIZELOG2     0
+#define CLSIZE         (1 << CLSIZELOG2)
 
 /* NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */
 
 /* NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */
-#define        SSIZE   1               /* initial stack size/NBPG */
-#define        SINCR   1               /* increment of stack/NBPG */
+#define SSIZE  1               /* initial stack size/NBPG */
+#define SINCR  1               /* increment of stack/NBPG */
 
 
-#define        UPAGES  2               /* pages of u-area */
+#define UPAGES 2               /* pages of u-area */
 
 /*
  * Constants related to network buffer management.
 
 /*
  * Constants related to network buffer management.
  * of the hardware page size.
  */
 #ifndef        MSIZE
  * of the hardware page size.
  */
 #ifndef        MSIZE
-#define        MSIZE           128             /* size of an mbuf */
+#define MSIZE          128             /* size of an mbuf */
 #endif /* MSIZE */
 
 #ifndef        MCLSHIFT
 #endif /* MSIZE */
 
 #ifndef        MCLSHIFT
-#define        MCLSHIFT        11              /* convert bytes to m_buf clusters */
+#define MCLSHIFT       11              /* convert bytes to m_buf clusters */
 #endif /* MCLSHIFT */
 #endif /* MCLSHIFT */
-#define        MCLBYTES        (1 << MCLSHIFT) /* size of an m_buf cluster */
-#define        MCLOFSET        (MCLBYTES - 1)  /* offset within an m_buf cluster */
+#define MCLBYTES       (1 << MCLSHIFT) /* size of an m_buf cluster */
+#define MCLOFSET       (MCLBYTES - 1)  /* offset within an m_buf cluster */
 
 #ifndef NMBCLUSTERS
 #ifdef GATEWAY
 
 #ifndef NMBCLUSTERS
 #ifdef GATEWAY
-#define        NMBCLUSTERS     512             /* map size, max cluster allocation */
+#define NMBCLUSTERS    512             /* map size, max cluster allocation */
 #else
 #else
-#define        NMBCLUSTERS     256             /* map size, max cluster allocation */
+#define NMBCLUSTERS    256             /* map size, max cluster allocation */
 #endif /* GATEWAY */
 #endif /* NMBCLUSTERS */
 
 #endif /* GATEWAY */
 #endif /* NMBCLUSTERS */
 
-/*
- * Size of kernel malloc arena in CLBYTES-sized logical pages
- */ 
-#ifndef NKMEMCLUSTERS
-#define        NKMEMCLUSTERS   (3072*1024/CLBYTES)
-#endif
 /*
  * Some macros for units conversion
  */
 /* Core clicks (4096 bytes) to segments and vice versa */
 /*
  * Some macros for units conversion
  */
 /* Core clicks (4096 bytes) to segments and vice versa */
-#define        ctos(x) (x)
-#define        stoc(x) (x)
+#define ctos(x)        (x)
+#define stoc(x)        (x)
 
 /* Core clicks (4096 bytes) to disk blocks */
 
 /* Core clicks (4096 bytes) to disk blocks */
-#define        ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT))
-#define        dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT))
-#define        dtob(x) ((x)<<DEV_BSHIFT)
+#define ctod(x)        ((x)<<(PGSHIFT-DEV_BSHIFT))
+#define dtoc(x)        ((x)>>(PGSHIFT-DEV_BSHIFT))
+#define dtob(x)        ((x)<<DEV_BSHIFT)
 
 /* clicks to bytes */
 
 /* clicks to bytes */
-#define        ctob(x) ((x)<<PGSHIFT)
+#define ctob(x)        ((x)<<PGSHIFT)
 
 /* bytes to clicks */
 
 /* bytes to clicks */
-#define        btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT)
+#define btoc(x)        (((unsigned)(x)+(NBPG-1))>>PGSHIFT)
 
 
-#define        btodb(bytes)                    /* calculates (bytes / DEV_BSIZE) */ \
+#define btodb(bytes)                   /* calculates (bytes / DEV_BSIZE) */ \
        ((unsigned)(bytes) >> DEV_BSHIFT)
        ((unsigned)(bytes) >> DEV_BSHIFT)
-#define        dbtob(db)                       /* calculates (db * DEV_BSIZE) */ \
+#define dbtob(db)                      /* calculates (db * DEV_BSIZE) */ \
        ((unsigned)(db) << DEV_BSHIFT)
 
 /*
        ((unsigned)(db) << DEV_BSHIFT)
 
 /*
  * add an entry to cdevsw/bdevsw for that purpose.
  * For now though just use DEV_BSIZE.
  */
  * add an entry to cdevsw/bdevsw for that purpose.
  * For now though just use DEV_BSIZE.
  */
-#define        bdbtofsb(bn)    ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
+#define bdbtofsb(bn)   ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
 
 /*
  * Mach derived conversion macros
 
 /*
  * Mach derived conversion macros
 #define i386_btop(x)           ((unsigned)(x) >> PGSHIFT)
 #define i386_ptob(x)           ((unsigned)(x) << PGSHIFT)
 
 #define i386_btop(x)           ((unsigned)(x) >> PGSHIFT)
 #define i386_ptob(x)           ((unsigned)(x) << PGSHIFT)
 
-#ifndef KERNEL
-#define        DELAY(n)        { volatile int N = (n); while (--N > 0); }
-#endif
+#endif /* _MACHINE_PARAM_H_ */