blob: 0b772d6d714fed25af7b491d972987a638b1dce5 [file] [log] [blame]
Kuninori Morimoto5933f6d2018-12-28 00:32:24 -08001// SPDX-License-Identifier: GPL-2.0
Magnus Damm2ef7f0d2009-03-06 09:47:02 +00002/*
3 * swsusp.c - SuperH hibernation support
4 *
5 * Copyright (C) 2009 Magnus Damm
Magnus Damm2ef7f0d2009-03-06 09:47:02 +00006 */
7
8#include <linux/mm.h>
9#include <linux/sched.h>
10#include <linux/suspend.h>
11#include <asm/suspend.h>
12#include <asm/sections.h>
13#include <asm/tlbflush.h>
14#include <asm/page.h>
15#include <asm/fpu.h>
16
17struct swsusp_arch_regs swsusp_arch_regs_cpu0;
18
19int pfn_is_nosave(unsigned long pfn)
20{
21 unsigned long begin_pfn = __pa(&__nosave_begin) >> PAGE_SHIFT;
22 unsigned long end_pfn = PAGE_ALIGN(__pa(&__nosave_end)) >> PAGE_SHIFT;
23
24 return (pfn >= begin_pfn) && (pfn < end_pfn);
25}
26
27void save_processor_state(void)
28{
29 init_fpu(current);
30}
31
32void restore_processor_state(void)
33{
34 local_flush_tlb_all();
35}