diff options
Diffstat (limited to 'arch/s390/kernel/suspend.c')
-rw-r--r-- | arch/s390/kernel/suspend.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/arch/s390/kernel/suspend.c b/arch/s390/kernel/suspend.c index 086bee970cae..cf9e5c6d5527 100644 --- a/arch/s390/kernel/suspend.c +++ b/arch/s390/kernel/suspend.c | |||
@@ -6,36 +6,26 @@ | |||
6 | * Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com> | 6 | * Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com> |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/suspend.h> | ||
10 | #include <linux/reboot.h> | ||
11 | #include <linux/pfn.h> | 9 | #include <linux/pfn.h> |
12 | #include <linux/mm.h> | ||
13 | #include <asm/sections.h> | ||
14 | #include <asm/system.h> | 10 | #include <asm/system.h> |
15 | #include <asm/ipl.h> | ||
16 | 11 | ||
17 | /* | 12 | /* |
18 | * References to section boundaries | 13 | * References to section boundaries |
19 | */ | 14 | */ |
20 | extern const void __nosave_begin, __nosave_end; | 15 | extern const void __nosave_begin, __nosave_end; |
21 | 16 | ||
22 | /* | ||
23 | * check if given pfn is in the 'nosave' or in the read only NSS section | ||
24 | */ | ||
25 | int pfn_is_nosave(unsigned long pfn) | 17 | int pfn_is_nosave(unsigned long pfn) |
26 | { | 18 | { |
27 | unsigned long nosave_begin_pfn = __pa(&__nosave_begin) >> PAGE_SHIFT; | 19 | unsigned long nosave_begin_pfn = PFN_DOWN(__pa(&__nosave_begin)); |
28 | unsigned long nosave_end_pfn = PAGE_ALIGN(__pa(&__nosave_end)) | 20 | unsigned long nosave_end_pfn = PFN_DOWN(__pa(&__nosave_end)); |
29 | >> PAGE_SHIFT; | ||
30 | unsigned long eshared_pfn = PFN_DOWN(__pa(&_eshared)) - 1; | ||
31 | unsigned long stext_pfn = PFN_DOWN(__pa(&_stext)); | ||
32 | 21 | ||
22 | /* Always save lowcore pages (LC protection might be enabled). */ | ||
23 | if (pfn <= LC_PAGES) | ||
24 | return 0; | ||
33 | if (pfn >= nosave_begin_pfn && pfn < nosave_end_pfn) | 25 | if (pfn >= nosave_begin_pfn && pfn < nosave_end_pfn) |
34 | return 1; | 26 | return 1; |
35 | if (pfn >= stext_pfn && pfn <= eshared_pfn) { | 27 | /* Skip memory holes and read-only pages (NSS, DCSS, ...). */ |
36 | if (ipl_info.type == IPL_TYPE_NSS) | 28 | if (tprot(PFN_PHYS(pfn))) |
37 | return 1; | ||
38 | } else if ((tprot(pfn * PAGE_SIZE) && pfn > 0)) | ||
39 | return 1; | 29 | return 1; |
40 | return 0; | 30 | return 0; |
41 | } | 31 | } |