Skip to content

Commit

Permalink
xen: suspend: move arch specific pre/post suspend hooks into generic …
Browse files Browse the repository at this point in the history
…hooks

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Ian Campbell authored and Stefano Stabellini committed Feb 25, 2011
1 parent 82043bb commit 07af381
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/xen/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,22 @@ struct suspend_info {
unsigned long arg; /* extra hypercall argument */
};

static void xen_hvm_post_suspend(void)
static void xen_hvm_post_suspend(int cancelled)
{
xen_arch_hvm_post_suspend(cancelled);
gnttab_resume();
}

static void xen_pre_suspend(void)
{
xen_mm_pin_all();
gnttab_suspend();
xen_arch_pre_suspend();
}

static void xen_post_suspend(void)
static void xen_post_suspend(int cancelled)
{
xen_arch_post_suspend(cancelled);
gnttab_resume();
xen_mm_unpin_all();
}
Expand All @@ -78,8 +81,7 @@ static int xen_hvm_suspend(void *data)
*/
si->cancelled = HYPERVISOR_suspend(si->arg);

xen_arch_hvm_post_suspend(si->cancelled);
xen_hvm_post_suspend();
xen_hvm_post_suspend(si->cancelled);

if (!si->cancelled) {
xen_irq_resume();
Expand Down Expand Up @@ -107,7 +109,6 @@ static int xen_suspend(void *data)
}

xen_pre_suspend();
xen_arch_pre_suspend();

/*
* This hypercall returns 1 if suspend was cancelled
Expand All @@ -116,8 +117,7 @@ static int xen_suspend(void *data)
*/
si->cancelled = HYPERVISOR_suspend(si->arg);

xen_arch_post_suspend(si->cancelled);
xen_post_suspend();
xen_post_suspend(si->cancelled);

if (!si->cancelled) {
xen_irq_resume();
Expand Down

0 comments on commit 07af381

Please sign in to comment.