summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include/pte.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386/include/pte.h')
-rw-r--r--sys/arch/i386/include/pte.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/i386/include/pte.h b/sys/arch/i386/include/pte.h
index 1dc9df81457..90b5cd38074 100644
--- a/sys/arch/i386/include/pte.h
+++ b/sys/arch/i386/include/pte.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pte.h,v 1.13 2011/03/23 16:54:35 pirofti Exp $ */
+/* $OpenBSD: pte.h,v 1.14 2013/03/23 16:12:23 deraadt Exp $ */
/* $NetBSD: pte.h,v 1.11 1998/02/06 21:58:05 thorpej Exp $ */
/*
@@ -147,13 +147,15 @@ typedef u_int32_t pt_entry_t; /* PTE */
#define NBPD (1 << PDSHIFT) /* # bytes mapped by PD (4MB) */
#define PDOFSET (NBPD-1) /* mask for non-PD part of VA */
#if 0 /* not used? */
-#define NPTEPD (NBPD / NBPG) /* # of PTEs in a PD */
+#define NPTEPD (NBPD / PAGE_SIZE) /* # of PTEs in a PD */
#else
-#define PTES_PER_PTP (NBPD / NBPG) /* # of PTEs in a PTP */
+#define PTES_PER_PTP (NBPD / PAGE_SIZE) /* # of PTEs in a PTP */
#endif
#define PD_MASK 0xffc00000 /* page directory address bits */
#define PT_MASK 0x003ff000 /* page table address bits */
+#define i386_round_pdr(x) ((((unsigned)(x)) + PDOFSET) & ~PDOFSET)
+
/*
* here we define the bits of the PDE/PTE, as described above:
*