xref: /openbmc/linux/arch/xtensa/kernel/hibernate.c (revision 7effbd18)
1 // SPDX-License-Identifier: GPL-2.0-only
2 
3 #include <linux/mm.h>
4 #include <linux/suspend.h>
5 #include <asm/coprocessor.h>
6 
7 int pfn_is_nosave(unsigned long pfn)
8 {
9 	unsigned long nosave_begin_pfn = PFN_DOWN(__pa(&__nosave_begin));
10 	unsigned long nosave_end_pfn = PFN_UP(__pa(&__nosave_end));
11 
12 	return	(pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
13 }
14 
15 void notrace save_processor_state(void)
16 {
17 	WARN_ON(num_online_cpus() != 1);
18 #if XTENSA_HAVE_COPROCESSORS
19 	local_coprocessors_flush_release_all();
20 #endif
21 }
22 
23 void notrace restore_processor_state(void)
24 {
25 }
26