suspend.c 984 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 "xen-ops.h"
  8. #include "mmu.h"
  9. void xen_pre_suspend(void)
  10. {
  11. xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn);
  12. xen_start_info->console.domU.mfn =
  13. mfn_to_pfn(xen_start_info->console.domU.mfn);
  14. BUG_ON(!irqs_disabled());
  15. HYPERVISOR_shared_info = &xen_dummy_shared_info;
  16. if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
  17. __pte_ma(0), 0))
  18. BUG();
  19. }
  20. void xen_post_suspend(int suspend_cancelled)
  21. {
  22. xen_setup_shared_info();
  23. if (suspend_cancelled) {
  24. xen_start_info->store_mfn =
  25. pfn_to_mfn(xen_start_info->store_mfn);
  26. xen_start_info->console.domU.mfn =
  27. pfn_to_mfn(xen_start_info->console.domU.mfn);
  28. } else {
  29. #ifdef CONFIG_SMP
  30. xen_cpu_initialized_map = cpu_online_map;
  31. #endif
  32. xen_vcpu_restore();
  33. }
  34. }
  35. void xen_arch_resume(void)
  36. {
  37. /* nothing */
  38. }