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