swsusp.c 711 B

1234567891011121314151617181920212223242526272829303132333435
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * swsusp.c - SuperH hibernation support
  4. *
  5. * Copyright (C) 2009 Magnus Damm
  6. */
  7. #include <linux/mm.h>
  8. #include <linux/sched.h>
  9. #include <linux/suspend.h>
  10. #include <asm/suspend.h>
  11. #include <asm/sections.h>
  12. #include <asm/tlbflush.h>
  13. #include <asm/page.h>
  14. #include <asm/fpu.h>
  15. struct swsusp_arch_regs swsusp_arch_regs_cpu0;
  16. int pfn_is_nosave(unsigned long pfn)
  17. {
  18. unsigned long begin_pfn = __pa(&__nosave_begin) >> PAGE_SHIFT;
  19. unsigned long end_pfn = PAGE_ALIGN(__pa(&__nosave_end)) >> PAGE_SHIFT;
  20. return (pfn >= begin_pfn) && (pfn < end_pfn);
  21. }
  22. void save_processor_state(void)
  23. {
  24. init_fpu(current);
  25. }
  26. void restore_processor_state(void)
  27. {
  28. local_flush_tlb_all();
  29. }