Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Suspend support specific for power.
0004  *
0005  * Copyright (c) 2002 Pavel Machek <pavel@ucw.cz>
0006  * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org>
0007  */
0008 
0009 #include <linux/mm.h>
0010 #include <linux/suspend.h>
0011 #include <asm/page.h>
0012 #include <asm/sections.h>
0013 
0014 /*
0015  *  pfn_is_nosave - check if given pfn is in the 'nosave' section
0016  */
0017 
0018 int pfn_is_nosave(unsigned long pfn)
0019 {
0020     unsigned long nosave_begin_pfn = __pa(&__nosave_begin) >> PAGE_SHIFT;
0021     unsigned long nosave_end_pfn = PAGE_ALIGN(__pa(&__nosave_end)) >> PAGE_SHIFT;
0022     return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
0023 }