suspend.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include <linux/types.h>
  2. #include <xen/interface/xen.h>
  3. #include <xen/grant_table.h>
  4. #include <xen/events.h>
  5. #include <asm/xen/hypercall.h>
  6. #include <asm/xen/page.h>
  7. #include <asm/fixmap.h>
  8. #include "xen-ops.h"
  9. #include "mmu.h"
  10. void xen_pre_suspend(void)
  11. {
  12. xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn);
  13. xen_start_info->console.domU.mfn =
  14. mfn_to_pfn(xen_start_info->console.domU.mfn);
  15. BUG_ON(!irqs_disabled());
  16. HYPERVISOR_shared_info = &xen_dummy_shared_info;
  17. if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
  18. __pte_ma(0), 0))
  19. BUG();
  20. }
  21. void xen_post_suspend(int suspend_cancelled)
  22. {
  23. xen_build_mfn_list_list();
  24. xen_setup_shared_info();
  25. if (suspend_cancelled) {
  26. xen_start_info->store_mfn =
  27. pfn_to_mfn(xen_start_info->store_mfn);
  28. xen_start_info->console.domU.mfn =
  29. pfn_to_mfn(xen_start_info->console.domU.mfn);
  30. } else {
  31. #ifdef CONFIG_SMP
  32. BUG_ON(xen_cpu_initialized_map == NULL);
  33. cpumask_copy(xen_cpu_initialized_map, cpu_online_mask);
  34. #endif
  35. xen_vcpu_restore();
  36. }
  37. }
  38. void xen_arch_resume(void)
  39. {
  40. /* nothing */
  41. }