blob: a531154cc0f3a43f06edbba75e3207ab92b105d5 [file] [log] [blame]
Vivek Goyal49c3df62007-05-02 19:27:07 +02001/*
2 * Suspend support specific for power.
3 *
4 * Distribute under GPLv2
5 *
Pavel Macheka2531292010-07-18 14:27:13 +02006 * Copyright (c) 2002 Pavel Machek <pavel@ucw.cz>
Vivek Goyal49c3df62007-05-02 19:27:07 +02007 * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org>
8 */
9
Andrea Righi27ac7922008-07-23 21:28:13 -070010#include <linux/mm.h>
Vivek Goyal49c3df62007-05-02 19:27:07 +020011#include <asm/page.h>
Geert Uytterhoeven7f8998c2014-10-09 15:30:30 -070012#include <asm/sections.h>
Vivek Goyal49c3df62007-05-02 19:27:07 +020013
14/*
15 * pfn_is_nosave - check if given pfn is in the 'nosave' section
16 */
17
18int pfn_is_nosave(unsigned long pfn)
19{
20 unsigned long nosave_begin_pfn = __pa(&__nosave_begin) >> PAGE_SHIFT;
21 unsigned long nosave_end_pfn = PAGE_ALIGN(__pa(&__nosave_end)) >> PAGE_SHIFT;
22 return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
23}