xref: /openbmc/linux/arch/powerpc/kernel/suspend.c (revision a2531293dbb7608fa672ff28efe3ab4027917a2f)
149c3df6aSVivek Goyal /*
249c3df6aSVivek Goyal  * Suspend support specific for power.
349c3df6aSVivek Goyal  *
449c3df6aSVivek Goyal  * Distribute under GPLv2
549c3df6aSVivek Goyal  *
6*a2531293SPavel Machek  * Copyright (c) 2002 Pavel Machek <pavel@ucw.cz>
749c3df6aSVivek Goyal  * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org>
849c3df6aSVivek Goyal  */
949c3df6aSVivek Goyal 
1027ac792cSAndrea Righi #include <linux/mm.h>
1149c3df6aSVivek Goyal #include <asm/page.h>
1249c3df6aSVivek Goyal 
1349c3df6aSVivek Goyal /* References to section boundaries */
1449c3df6aSVivek Goyal extern const void __nosave_begin, __nosave_end;
1549c3df6aSVivek Goyal 
1649c3df6aSVivek Goyal /*
1749c3df6aSVivek Goyal  *	pfn_is_nosave - check if given pfn is in the 'nosave' section
1849c3df6aSVivek Goyal  */
1949c3df6aSVivek Goyal 
2049c3df6aSVivek Goyal int pfn_is_nosave(unsigned long pfn)
2149c3df6aSVivek Goyal {
2249c3df6aSVivek Goyal 	unsigned long nosave_begin_pfn = __pa(&__nosave_begin) >> PAGE_SHIFT;
2349c3df6aSVivek Goyal 	unsigned long nosave_end_pfn = PAGE_ALIGN(__pa(&__nosave_end)) >> PAGE_SHIFT;
2449c3df6aSVivek Goyal 	return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
2549c3df6aSVivek Goyal }
26