1 // SPDX-License-Identifier: GPL-2.0 !! 1 /* 2 #include <linux/suspend.h> !! 2 * hibernate.c: Hibernaton support specific for sparc64. 3 #include <asm/tlbflush.h> !! 3 * >> 4 * Copyright (C) 2013 Kirill V Tkhai (tkhai@yandex.ru) >> 5 */ 4 6 5 extern int restore_image(void); !! 7 #include <linux/mm.h> 6 8 7 int swsusp_arch_resume(void) !! 9 #include <asm/hibernate.h> >> 10 #include <asm/visasm.h> >> 11 #include <asm/page.h> >> 12 #include <asm/sections.h> >> 13 #include <asm/tlb.h> >> 14 >> 15 struct saved_context saved_context; >> 16 >> 17 /* >> 18 * pfn_is_nosave - check if given pfn is in the 'nosave' section >> 19 */ >> 20 >> 21 int pfn_is_nosave(unsigned long pfn) 8 { 22 { 9 /* Avoid TLB mismatch during and after !! 23 unsigned long nosave_begin_pfn = PFN_DOWN((unsigned long)&__nosave_begin); 10 local_flush_tlb_all(); !! 24 unsigned long nosave_end_pfn = PFN_DOWN((unsigned long)&__nosave_end); 11 return restore_image(); !! 25 >> 26 return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn); >> 27 } >> 28 >> 29 void save_processor_state(void) >> 30 { >> 31 save_and_clear_fpu(); >> 32 } >> 33 >> 34 void restore_processor_state(void) >> 35 { >> 36 struct mm_struct *mm = current->active_mm; >> 37 >> 38 tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); 12 } 39 } 13 40
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.