Module Name:    src
Committed By:   maxv
Date:           Sat Mar  9 09:09:56 UTC 2019

Modified Files:
        src/sys/arch/amd64/include: pmap.h
        src/sys/arch/i386/include: pmap.h

Log Message:
New software PTE bits.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.122 -r1.123 src/sys/arch/i386/include/pmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/include/pmap.h
diff -u src/sys/arch/amd64/include/pmap.h:1.59 src/sys/arch/amd64/include/pmap.h:1.60
--- src/sys/arch/amd64/include/pmap.h:1.59	Mon Feb 11 14:59:32 2019
+++ src/sys/arch/amd64/include/pmap.h	Sat Mar  9 09:09:56 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.59 2019/02/11 14:59:32 cherry Exp $	*/
+/*	$NetBSD: pmap.h,v 1.60 2019/03/09 09:09:56 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -163,14 +163,16 @@ extern pt_entry_t *pte_base;
 #define PTP_LEVELS	4
 
 /*
- * PG_AVAIL usage: we make use of the ignored bits of the PTE
+ * PTE_AVL usage: we make use of the ignored bits of the PTE
  */
-
-#define PG_W		PG_AVAIL1	/* "wired" mapping */
-#define PG_PVLIST	PG_AVAIL2	/* mapping has entry on pvlist */
-/* PG_AVAIL3 not used */
-
-#define	PG_X		0		/* dummy */
+#define PTE_WIRED	PTE_AVL1	/* Wired Mapping */
+#define PTE_PVLIST	PTE_AVL2	/* Mapping has entry on pvlist */
+#define PTE_X		0		/* Dummy */
+
+/* XXX To be deleted. */
+#define PG_W		PTE_WIRED
+#define PG_PVLIST	PTE_PVLIST
+#define PG_X		PTE_X
 
 void svs_pmap_sync(struct pmap *, int);
 void svs_lwp_switch(struct lwp *, struct lwp *);
@@ -182,7 +184,7 @@ extern bool svs_enabled;
 
 #ifndef XENPV
 #define pmap_pa2pte(a)			(a)
-#define pmap_pte2pa(a)			((a) & PG_FRAME)
+#define pmap_pte2pa(a)			((a) & PTE_FRAME)
 #define pmap_pte_set(p, n)		do { *(p) = (n); } while (0)
 #define pmap_pte_cas(p, o, n)		atomic_cas_64((p), (o), (n))
 #define pmap_pte_testset(p, n)		\
@@ -204,7 +206,7 @@ pmap_pa2pte(paddr_t pa)
 static __inline paddr_t
 pmap_pte2pa(pt_entry_t pte)
 {
-	return xpmap_mtop_masked(pte & PG_FRAME);
+	return xpmap_mtop_masked(pte & PTE_FRAME);
 }
 
 static __inline void

Index: src/sys/arch/i386/include/pmap.h
diff -u src/sys/arch/i386/include/pmap.h:1.122 src/sys/arch/i386/include/pmap.h:1.123
--- src/sys/arch/i386/include/pmap.h:1.122	Mon Feb 11 14:59:32 2019
+++ src/sys/arch/i386/include/pmap.h	Sat Mar  9 09:09:56 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.122 2019/02/11 14:59:32 cherry Exp $	*/
+/*	$NetBSD: pmap.h,v 1.123 2019/03/09 09:09:56 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -224,7 +224,7 @@
 #define L2_SLOT_KERN	(KERNBASE/NBPD_L2)   /* 768: start of kernel space */
 #endif /* PAE */
 
-#define	L2_SLOT_KERNBASE L2_SLOT_KERN
+#define L2_SLOT_KERNBASE L2_SLOT_KERN
 
 #define PDIR_SLOT_KERN	L2_SLOT_KERN
 #define PDIR_SLOT_PTE	L2_SLOT_PTE
@@ -278,18 +278,22 @@
 #define PTP_LEVELS	2
 
 /*
- * PG_AVAIL usage: we make use of the ignored bits of the PTE
+ * PTE_AVL usage: we make use of the ignored bits of the PTE
  */
-
-#define PG_W		PG_AVAIL1	/* "wired" mapping */
-#define PG_PVLIST	PG_AVAIL2	/* mapping has entry on pvlist */
-#define PG_X		PG_AVAIL3	/* executable mapping */
+#define PTE_WIRED	PTE_AVL1	/* Wired Mapping */
+#define PTE_PVLIST	PTE_AVL2	/* Mapping has entry on pvlist */
+#define PTE_X		PTE_AVL3	/* Executable */
+
+/* XXX To be deleted. */
+#define PG_W		PTE_WIRED
+#define PG_PVLIST	PTE_PVLIST
+#define PG_X		PTE_X
 
 #include <x86/pmap.h>
 
 #ifndef XENPV
 #define pmap_pa2pte(a)			(a)
-#define pmap_pte2pa(a)			((a) & PG_FRAME)
+#define pmap_pte2pa(a)			((a) & PTE_FRAME)
 #define pmap_pte_set(p, n)		do { *(p) = (n); } while (0)
 #define pmap_pte_flush()		/* nothing */
 
@@ -323,7 +327,7 @@ pmap_pa2pte(paddr_t pa)
 static __inline paddr_t
 pmap_pte2pa(pt_entry_t pte)
 {
-	return xpmap_mtop_masked(pte & PG_FRAME);
+	return xpmap_mtop_masked(pte & PTE_FRAME);
 }
 static __inline void
 pmap_pte_set(pt_entry_t *pte, pt_entry_t npte)

Reply via email to