swsusp.c 851 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * swsusp.c - SuperH hibernation support
  3. *
  4. * Copyright (C) 2009 Magnus Damm
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/mm.h>
  11. #include <linux/sched.h>
  12. #include <linux/suspend.h>
  13. #include <asm/suspend.h>
  14. #include <asm/sections.h>
  15. #include <asm/tlbflush.h>
  16. #include <asm/page.h>
  17. #include <asm/fpu.h>
  18. struct swsusp_arch_regs swsusp_arch_regs_cpu0;
  19. int 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. return (pfn >= begin_pfn) && (pfn < end_pfn);
  24. }
  25. void save_processor_state(void)
  26. {
  27. init_fpu(current);
  28. }
  29. void restore_processor_state(void)
  30. {
  31. local_flush_tlb_all();
  32. }