vax 8200 support from torek: generalize cpu support, ops, clock ops
[unix-history] / usr / src / sys / vax / include / pte.h
index 11eddfb..8e5dec4 100644 (file)
@@ -1,4 +1,10 @@
-/*     pte.h   3.2     %G%     */
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)pte.h       7.4 (Berkeley) %G%
+ */
 
 /*
  * VAX page table entry
 
 /*
  * VAX page table entry
  * structure used in page clustering.
  */
 
  * structure used in page clustering.
  */
 
+#ifndef LOCORE
 struct pte
 {
 unsigned int   pg_pfnum:21,            /* core page frame number or 0 */
                :2,
                pg_vreadm:1,            /* modified since vread (or with _m) */
 struct pte
 {
 unsigned int   pg_pfnum:21,            /* core page frame number or 0 */
                :2,
                pg_vreadm:1,            /* modified since vread (or with _m) */
-               pg_swapm:1,             /* have to write back to swap */
+               :1,
                pg_fod:1,               /* is fill on demand (=0) */
                pg_m:1,                 /* hardware maintained modified bit */
                pg_prot:4,              /* access control */
                pg_fod:1,               /* is fill on demand (=0) */
                pg_m:1,                 /* hardware maintained modified bit */
                pg_prot:4,              /* access control */
@@ -29,22 +36,24 @@ unsigned int        pg_pfnum:21,
 };
 struct fpte
 {
 };
 struct fpte
 {
-unsigned int   pg_blkno:20,            /* file system block number */
-               pg_fileno:5,            /* file mapped from or TEXT or ZERO */
+unsigned int   pg_blkno:24,            /* file system block number */
+               pg_fileno:1,            /* file mapped from or TEXT or ZERO */
                pg_fod:1,               /* is fill on demand (=1) */
                :1,
                pg_prot:4,
                pg_v:1;
 };
                pg_fod:1,               /* is fill on demand (=1) */
                :1,
                pg_prot:4,
                pg_v:1;
 };
+#endif
 
 #define        PG_V            0x80000000
 #define        PG_PROT         0x78000000
 #define        PG_M            0x04000000
 
 #define        PG_V            0x80000000
 #define        PG_PROT         0x78000000
 #define        PG_M            0x04000000
+#define        PG_FOD          0x02000000
 #define        PG_VREADM       0x00800000
 #define        PG_PFNUM        0x001fffff
 
 #define        PG_VREADM       0x00800000
 #define        PG_PFNUM        0x001fffff
 
-#define        PG_FZERO        (NOFILE)
-#define        PG_FTEXT        (NOFILE+1)
+#define        PG_FZERO        0
+#define        PG_FTEXT        1
 #define        PG_FMAX         (PG_FTEXT)
 
 #define        PG_NOACC        0
 #define        PG_FMAX         (PG_FTEXT)
 
 #define        PG_NOACC        0
@@ -57,12 +66,15 @@ unsigned int        pg_blkno:20,            /* file system block number */
 /*
  * Pte related macros
  */
 /*
  * Pte related macros
  */
-#define        dirty(pte)      ((pte)->pg_fod == 0 && (pte)->pg_pfnum && \
-                           ((pte)->pg_m || (pte)->pg_swapm))
+#define        dirty(pte)      ((pte)->pg_m)
 
 
-#ifdef KERNEL
-struct pte *vtopte();
+/*
+ * Kernel virtual address to page table entry and to physical address.
+ */
+#define        kvtopte(va) (&Sysmap[((unsigned)(va) &~ KERNBASE) >> PGSHIFT])
+#define        kvtophys(x) ((kvtopte(x)->pg_pfnum << PGSHIFT) | ((int)(x) & PGOFSET))
 
 
+#if defined(KERNEL) && !defined(LOCORE)
 /* utilities defined in locore.s */
 extern struct pte Sysmap[];
 extern struct pte Usrptmap[];
 /* utilities defined in locore.s */
 extern struct pte Sysmap[];
 extern struct pte Usrptmap[];
@@ -74,5 +86,10 @@ extern       struct pte Xswap2map[];
 extern struct pte Pushmap[];
 extern struct pte Vfmap[];
 extern struct pte mmap[];
 extern struct pte Pushmap[];
 extern struct pte Vfmap[];
 extern struct pte mmap[];
-extern struct pte mcrmap[];
+extern struct pte msgbufmap[];
+extern struct pte kmempt[], ekmempt[];
+extern struct pte Nexmap[][16];
+#if VAX8600
+extern struct pte Ioamap[][1];
 #endif
 #endif
+#endif /* defined(KERNEL) && !defined(LOCORE) */