BSD 4_3_Tahoe release
[unix-history] / usr / src / sys / vax / pte.h
index 86d0987..39b6e34 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)pte.h       7.1 (Berkeley) 6/5/86
+ *     @(#)pte.h       7.4 (Berkeley) 5/2/88
  */
 
 /*
  */
 
 /*
@@ -22,7 +22,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 */
@@ -66,12 +66,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[];
@@ -84,12 +87,9 @@ 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];
 extern struct pte Ioamap[][1];
-#ifdef VAX630
-extern struct pte Clockmap[];
-extern struct pte Ka630map[];
-#endif
-#endif
 #endif
 #endif
+#endif /* defined(KERNEL) && !defined(LOCORE) */