BSD 4_4 release
[unix-history] / usr / src / sys / vax / include / pte.h
index bd9345d..bf71dab 100644 (file)
@@ -1,4 +1,13 @@
-/*     pte.h   6.4     85/04/18        */
+/*-
+ * Copyright (c) 1982, 1986 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This module is believed to contain source code proprietary to AT&T.
+ * Use and redistribution is subject to the Berkeley Software License
+ * Agreement and your Software Agreement with AT&T (Western Electric).
+ *
+ *     @(#)pte.h       7.7 (Berkeley) 5/8/91
+ */
 
 /*
  * VAX page table entry
 
 /*
  * VAX page table entry
@@ -16,7 +25,7 @@ struct pte
 unsigned int   pg_pfnum:21,            /* core page frame number or 0 */
                :2,
                pg_vreadm:1,            /* modified since vread (or with _m) */
 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 */
@@ -60,12 +69,15 @@ unsigned int        pg_blkno:24,            /* 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)
 
 
-#ifndef LOCORE
-#ifdef KERNEL
+/*
+ * 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[];
@@ -78,7 +90,15 @@ extern       struct pte Pushmap[];
 extern struct pte Vfmap[];
 extern struct pte mmap[];
 extern struct pte msgbufmap[];
 extern struct pte Vfmap[];
 extern struct pte mmap[];
 extern struct pte msgbufmap[];
-extern struct pte camap[];
+extern struct pte kmempt[], ekmempt[];
 extern struct pte Nexmap[][16];
 extern struct pte Nexmap[][16];
+#if VAX8600
+extern struct pte Ioamap[][1];
+#endif
+#ifdef NFS
+extern struct pte Nfsiomap[];
 #endif
 #endif
+#ifdef MFS
+extern struct pte Mfsiomap[];
 #endif
 #endif
+#endif /* defined(KERNEL) && !defined(LOCORE) */