WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 08/11] xen: suspend: refactor non-arch specific pre/p

To: Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 08/11] xen: suspend: refactor non-arch specific pre/post suspend hooks
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Tue, 15 Feb 2011 14:13:22 +0000
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Tue, 15 Feb 2011 06:22:21 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1297779181.21980.3722.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1297779181.21980.3722.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 drivers/xen/manage.c |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 7783722..f61c155 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -39,6 +39,23 @@ struct suspend_info {
        unsigned long arg; /* extra hypercall argument */
 };
 
+static void xen_hvm_post_suspend(void)
+{
+       gnttab_resume();
+}
+
+static void xen_pre_suspend(void)
+{
+       xen_mm_pin_all();
+       gnttab_suspend();
+}
+
+static void xen_post_suspend(void)
+{
+       gnttab_resume();
+       xen_mm_unpin_all();
+}
+
 #ifdef CONFIG_PM_SLEEP
 static int xen_hvm_suspend(void *data)
 {
@@ -62,7 +79,7 @@ static int xen_hvm_suspend(void *data)
        si->cancelled = HYPERVISOR_suspend(si->arg);
 
        xen_arch_hvm_post_suspend(si->cancelled);
-       gnttab_resume();
+       xen_hvm_post_suspend();
 
        if (!si->cancelled) {
                xen_irq_resume();
@@ -89,8 +106,7 @@ static int xen_suspend(void *data)
                return err;
        }
 
-       xen_mm_pin_all();
-       gnttab_suspend();
+       xen_pre_suspend();
        xen_arch_pre_suspend();
 
        /*
@@ -101,8 +117,7 @@ static int xen_suspend(void *data)
        si->cancelled = HYPERVISOR_suspend(si->arg);
 
        xen_arch_post_suspend(si->cancelled);
-       gnttab_resume();
-       xen_mm_unpin_all();
+       xen_post_suspend();
 
        if (!si->cancelled) {
                xen_irq_resume();
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>