find a different way.
-/* $OpenBSD: hibernate_machdep.c,v 1.42 2014/12/22 23:59:43 mlarkin Exp $ */
+/* $OpenBSD: hibernate_machdep.c,v 1.43 2014/12/23 01:24:50 deraadt Exp $ */
/*
* Copyright (c) 2011 Mike Larkin <mlarkin@openbsd.org>
pt_entry_t *pde, npde;
pde = s4pde_4m(va);
- npde = (pa & HIB_PD_MASK) | PG_RW | PG_V | PG_M | PG_PS;
+ npde = (pa & PD_MASK) | PG_RW | PG_V | PG_M | PG_PS;
*pde = npde;
}
-/* $OpenBSD: pmap.c,v 1.164 2014/12/22 23:59:43 mlarkin Exp $ */
+/* $OpenBSD: pmap.c,v 1.165 2014/12/23 01:24:50 deraadt Exp $ */
/* $NetBSD: pmap.c,v 1.91 2000/06/02 17:46:37 thorpej Exp $ */
/*
#define PMAP_HEAD_TO_MAP_LOCK() /* null */
#define PMAP_HEAD_TO_MAP_UNLOCK() /* null */
-#define PD_MASK 0xffc00000 /* page directory address bits */
-#define PT_MASK 0x003ff000 /* page table address bits */
-
-/*
- * pdei/ptei: generate index into PDP/PTP from a VA
- */
-#define pdei(VA) (((VA) & PD_MASK) >> PDSHIFT)
-#define ptei(VA) (((VA) & PT_MASK) >> PAGE_SHIFT)
-
/*
* global data structures
*/
-/* $OpenBSD: hibernate_var.h,v 1.13 2014/12/22 23:59:43 mlarkin Exp $ */
+/* $OpenBSD: hibernate_var.h,v 1.14 2014/12/23 01:24:51 deraadt Exp $ */
/*
* Copyright (c) 2011 Mike Larkin <mlarkin@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define HIB_PD_MASK 0xffc00000
-#define PIGLET_PAGE_MASK (HIB_PD_MASK)
+#define PIGLET_PAGE_MASK (PD_MASK)
#define HIBERNATE_PD_PAGE (PAGE_SIZE * 21)
#define HIBERNATE_PT_PAGE (PAGE_SIZE * 22)
-/* $OpenBSD: pmap.h,v 1.68 2014/12/22 23:59:43 mlarkin Exp $ */
+/* $OpenBSD: pmap.h,v 1.69 2014/12/23 01:24:51 deraadt Exp $ */
/* $NetBSD: pmap.h,v 1.44 2000/04/24 17:18:18 thorpej Exp $ */
/*
#define avtophys(VA) ((*avtopte(VA) & PG_FRAME) | \
((unsigned)(VA) & ~PG_FRAME))
+/*
+ * pdei/ptei: generate index into PDP/PTP from a VA
+ */
+#define pdei(VA) (((VA) & PD_MASK) >> PDSHIFT)
+#define ptei(VA) (((VA) & PT_MASK) >> PAGE_SHIFT)
+
/*
* PTP macros:
* A PTP's index is the PD index of the PDE that points to it.
-/* $OpenBSD: pte.h,v 1.17 2014/12/22 23:59:43 mlarkin Exp $ */
+/* $OpenBSD: pte.h,v 1.18 2014/12/23 01:24:51 deraadt Exp $ */
/* $NetBSD: pte.h,v 1.11 1998/02/06 21:58:05 thorpej Exp $ */
/*
#else
#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 PAGE_MASK_L2 (NBPD - 1)