aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/x86/power/hibernate_32.c
diff options
context:
space:
mode:
authorZhimin Gu <kookoo.gu@intel.com>2018-09-21 14:26:58 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-10-03 11:56:33 +0200
commit25862a049e6f04cc982f4bed25ed3e6f0a0a5a61 (patch)
tree7ab865a3abbb99450a2ecd40268106d1bb63d016 /arch/x86/power/hibernate_32.c
parentx86-32/asm/power: Create stack frames in hibernate_asm_32.S (diff)
downloadwireguard-linux-25862a049e6f04cc982f4bed25ed3e6f0a0a5a61.tar.xz
wireguard-linux-25862a049e6f04cc982f4bed25ed3e6f0a0a5a61.zip
x86, hibernate: Extract the common code of 64/32 bit system
Reduce the hibernation code duplication between x86-32 and x86-64 by extracting the common code into hibernate.c. Currently only pfn_is_nosave() is the activated common function in hibernate.c No functional change. Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Zhimin Gu <kookoo.gu@intel.com> Signed-off-by: Chen Yu <yu.c.chen@intel.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/x86/power/hibernate_32.c')
-rw-r--r--arch/x86/power/hibernate_32.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c
index afc4ed7b1578..f82fbd279d08 100644
--- a/arch/x86/power/hibernate_32.c
+++ b/arch/x86/power/hibernate_32.c
@@ -14,9 +14,7 @@
#include <asm/pgtable.h>
#include <asm/mmzone.h>
#include <asm/sections.h>
-
-/* Defined in hibernate_asm_32.S */
-extern int restore_image(void);
+#include <asm/suspend.h>
/* Pointer to the temporary resume page tables */
pgd_t *resume_pg_dir;
@@ -162,14 +160,3 @@ asmlinkage int swsusp_arch_resume(void)
restore_image();
return 0;
}
-
-/*
- * pfn_is_nosave - check if given pfn is in the 'nosave' section
- */
-
-int pfn_is_nosave(unsigned long pfn)
-{
- unsigned long nosave_begin_pfn = __pa_symbol(&__nosave_begin) >> PAGE_SHIFT;
- unsigned long nosave_end_pfn = PAGE_ALIGN(__pa_symbol(&__nosave_end)) >> PAGE_SHIFT;
- return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
-}