blob: 95be7b434724c5067214dc416367633c522a69bb [file] [log] [blame]
Jeremy Fitzhardinge0e913982008-05-26 23:31:27 +01001#include <linux/types.h>
2
3#include <xen/interface/xen.h>
4#include <xen/grant_table.h>
5#include <xen/events.h>
6
7#include <asm/xen/hypercall.h>
8#include <asm/xen/page.h>
Ingo Molnar99d00002009-01-23 11:09:15 +01009#include <asm/fixmap.h>
Jeremy Fitzhardinge0e913982008-05-26 23:31:27 +010010
11#include "xen-ops.h"
12#include "mmu.h"
13
14void xen_pre_suspend(void)
15{
16 xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn);
17 xen_start_info->console.domU.mfn =
18 mfn_to_pfn(xen_start_info->console.domU.mfn);
19
20 BUG_ON(!irqs_disabled());
21
22 HYPERVISOR_shared_info = &xen_dummy_shared_info;
23 if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
24 __pte_ma(0), 0))
25 BUG();
26}
27
28void xen_post_suspend(int suspend_cancelled)
29{
Jeremy Fitzhardinge9c7a7942008-05-31 01:33:02 +010030 xen_setup_shared_info();
31
Jeremy Fitzhardinge0e913982008-05-26 23:31:27 +010032 if (suspend_cancelled) {
33 xen_start_info->store_mfn =
34 pfn_to_mfn(xen_start_info->store_mfn);
35 xen_start_info->console.domU.mfn =
36 pfn_to_mfn(xen_start_info->console.domU.mfn);
37 } else {
38#ifdef CONFIG_SMP
Mike Travisb78936e2008-12-16 17:33:57 -080039 BUG_ON(xen_cpu_initialized_map == NULL);
40 cpumask_copy(xen_cpu_initialized_map, cpu_online_mask);
Jeremy Fitzhardinge0e913982008-05-26 23:31:27 +010041#endif
Jeremy Fitzhardinge9c7a7942008-05-31 01:33:02 +010042 xen_vcpu_restore();
Jeremy Fitzhardinge0e913982008-05-26 23:31:27 +010043 }
44
Jeremy Fitzhardinge0e913982008-05-26 23:31:27 +010045}
46
Isaku Yamahataad55db92008-07-08 15:06:32 -070047void xen_arch_resume(void)
48{
49 /* nothing */
50}