aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkaf24@localhost.localdomain <kaf24@localhost.localdomain>2007-01-21 15:39:04 +0000
committerkaf24@localhost.localdomain <kaf24@localhost.localdomain>2007-01-21 15:39:04 +0000
commit9b8009662265226e9d271e96ab94a2dce6e7f021 (patch)
treea778e8088e8d71b124830e907d6fac50ecdc7210 /tools
parent2ba523af16e8045f08cdd0d790ba88f1e758996f (diff)
downloadxen-9b8009662265226e9d271e96ab94a2dce6e7f021.tar.gz
xen-9b8009662265226e9d271e96ab94a2dce6e7f021.tar.bz2
xen-9b8009662265226e9d271e96ab94a2dce6e7f021.zip
[LIBXC] Fix non-x86 build.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/libxc/xc_resume.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/tools/libxc/xc_resume.c b/tools/libxc/xc_resume.c
index ea9e121054..ef8b82669a 100644
--- a/tools/libxc/xc_resume.c
+++ b/tools/libxc/xc_resume.c
@@ -1,5 +1,28 @@
#include "xc_private.h"
+
+#if defined(__i386__) || defined(__x86_64__)
+static int modify_returncode(int xc_handle, uint32_t domid)
+{
+ vcpu_guest_context_t ctxt;
+ int rc;
+
+ if ( (rc = xc_vcpu_getcontext(xc_handle, domid, 0, &ctxt)) != 0 )
+ return rc;
+ ctxt.user_regs.eax = 1;
+ if ( (rc = xc_vcpu_setcontext(xc_handle, domid, 0, &ctxt)) != 0 )
+ return rc;
+
+ return 0;
+}
+#else
+static int modify_returncode(int xc_handle, uint32_t domid)
+{
+ return 0;
+}
+#endif
+
+
/*
* Resume execution of a domain after suspend shutdown.
* This can happen in one of two ways:
@@ -13,7 +36,6 @@
*/
int xc_domain_resume(int xc_handle, uint32_t domid)
{
- vcpu_guest_context_t ctxt;
DECLARE_DOMCTL;
int rc;
@@ -21,13 +43,8 @@ int xc_domain_resume(int xc_handle, uint32_t domid)
* Set hypercall return code to indicate that suspend is cancelled
* (rather than resuming in a new domain context).
*/
-#if defined(__i386__) || defined(__x86_64__)
- if ( (rc = xc_vcpu_getcontext(xc_handle, domid, 0, &ctxt)) != 0 )
- return rc;
- ctxt.user_regs.eax = 1;
- if ( (rc = xc_vcpu_setcontext(xc_handle, domid, 0, &ctxt)) != 0 )
+ if ( (rc = modify_returncode(xc_handle, domid)) != 0 )
return rc;
-#endif
domctl.cmd = XEN_DOMCTL_resumedomain;
domctl.domain = domid;