summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2014-10-01 19:41:07 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2014-10-01 19:41:07 +0000
commit95191566ee44da1185220414cc037649100ef2d0 (patch)
treef6542ca00a949eb6e046a2f6997775bef9aa4b9a /sys/arch/amd64
parent9d4a1503dea09860c97621368f5ccdef8eab6415 (diff)
Move some hibernate #defines to pte.h and eliminate some duplicate defines
from hibernate code that were already defined in pte.h (with different names). No functional change. ok sf@, deraadt@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/hibernate_machdep.c6
-rw-r--r--sys/arch/amd64/include/hibernate_var.h10
-rw-r--r--sys/arch/amd64/include/pte.h4
3 files changed, 8 insertions, 12 deletions
diff --git a/sys/arch/amd64/amd64/hibernate_machdep.c b/sys/arch/amd64/amd64/hibernate_machdep.c
index be69a7ebb96..bea8a7c60f1 100644
--- a/sys/arch/amd64/amd64/hibernate_machdep.c
+++ b/sys/arch/amd64/amd64/hibernate_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hibernate_machdep.c,v 1.28 2014/07/20 19:47:53 deraadt Exp $ */
+/* $OpenBSD: hibernate_machdep.c,v 1.29 2014/10/01 19:41:06 mlarkin Exp $ */
/*
* Copyright (c) 2012 Mike Larkin <mlarkin@openbsd.org>
@@ -329,8 +329,8 @@ hibernate_populate_resume_pt(union hibernate_info *hib_info,
/*
* Map current kernel VA range using 2MB pages
*/
- kern_start_2m_va = (paddr_t)&start & ~(PAGE_MASK_2M);
- kern_end_2m_va = (paddr_t)&end & ~(PAGE_MASK_2M);
+ kern_start_2m_va = (paddr_t)&start & ~(PAGE_MASK_L2);
+ kern_end_2m_va = (paddr_t)&end & ~(PAGE_MASK_L2);
/* amd64 kernels load at 16MB phys (on the 8th 2mb page) */
phys_page_number = 8;
diff --git a/sys/arch/amd64/include/hibernate_var.h b/sys/arch/amd64/include/hibernate_var.h
index c822f195357..bc63cff9b59 100644
--- a/sys/arch/amd64/include/hibernate_var.h
+++ b/sys/arch/amd64/include/hibernate_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hibernate_var.h,v 1.8 2014/01/05 23:06:54 mlarkin Exp $ */
+/* $OpenBSD: hibernate_var.h,v 1.9 2014/10/01 19:41:06 mlarkin Exp $ */
/*
* Copyright (c) 2011 Mike Larkin <mlarkin@openbsd.org>
@@ -16,13 +16,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* amd64 hibernate support definitions */
-
-#define PAGE_MASK_2M (NBPD_L2 - 1)
-#define PAGE_MASK_1G (NBPD_L3 - 1)
-#define PAGE_MASK_512G (NBPD_L4 - 1)
-
-#define PIGLET_PAGE_MASK ~((paddr_t)PAGE_MASK_2M)
+#define PIGLET_PAGE_MASK (L2_FRAME)
/*
* PML4 table for resume
diff --git a/sys/arch/amd64/include/pte.h b/sys/arch/amd64/include/pte.h
index acdb7535c62..96207c265e3 100644
--- a/sys/arch/amd64/include/pte.h
+++ b/sys/arch/amd64/include/pte.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pte.h,v 1.10 2014/04/21 11:58:48 guenther Exp $ */
+/* $OpenBSD: pte.h,v 1.11 2014/10/01 19:41:06 mlarkin Exp $ */
/* $NetBSD: pte.h,v 1.1 2003/04/26 18:39:47 fvdl Exp $ */
/*
@@ -97,6 +97,8 @@ typedef u_int64_t pt_entry_t; /* PTE */
#define L2_FRAME (L3_FRAME|L2_MASK)
#define L1_FRAME (L2_FRAME|L1_MASK)
+#define PAGE_MASK_L2 (NBPD_L2 - 1)
+
#define x86_round_pdr(x) \
((((unsigned long)(x)) + (NBPD_L2 - 1)) & ~(NBPD_L2 - 1))