ia64/xen-unstable

changeset 13549:c3e19108f3ed

[LIBXC] Fix non-x86 build.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@localhost.localdomain
date Sun Jan 21 15:39:04 2007 +0000 (2007-01-21)
parents 7e28a8c150ed
children c1f23d09285e
files tools/libxc/xc_resume.c
line diff
     1.1 --- a/tools/libxc/xc_resume.c	Sat Jan 20 14:33:43 2007 +0000
     1.2 +++ b/tools/libxc/xc_resume.c	Sun Jan 21 15:39:04 2007 +0000
     1.3 @@ -1,5 +1,28 @@
     1.4  #include "xc_private.h"
     1.5  
     1.6 +
     1.7 +#if defined(__i386__) || defined(__x86_64__)
     1.8 +static int modify_returncode(int xc_handle, uint32_t domid)
     1.9 +{
    1.10 +    vcpu_guest_context_t ctxt;
    1.11 +    int rc;
    1.12 +
    1.13 +    if ( (rc = xc_vcpu_getcontext(xc_handle, domid, 0, &ctxt)) != 0 )
    1.14 +        return rc;
    1.15 +    ctxt.user_regs.eax = 1;
    1.16 +    if ( (rc = xc_vcpu_setcontext(xc_handle, domid, 0, &ctxt)) != 0 )
    1.17 +        return rc;
    1.18 +
    1.19 +    return 0;
    1.20 +}
    1.21 +#else
    1.22 +static int modify_returncode(int xc_handle, uint32_t domid)
    1.23 +{
    1.24 +    return 0;
    1.25 +}
    1.26 +#endif
    1.27 +
    1.28 +
    1.29  /*
    1.30   * Resume execution of a domain after suspend shutdown.
    1.31   * This can happen in one of two ways:
    1.32 @@ -13,7 +36,6 @@
    1.33   */
    1.34  int xc_domain_resume(int xc_handle, uint32_t domid)
    1.35  {
    1.36 -    vcpu_guest_context_t ctxt;
    1.37      DECLARE_DOMCTL;
    1.38      int rc;
    1.39  
    1.40 @@ -21,13 +43,8 @@ int xc_domain_resume(int xc_handle, uint
    1.41       * Set hypercall return code to indicate that suspend is cancelled
    1.42       * (rather than resuming in a new domain context).
    1.43       */
    1.44 -#if defined(__i386__) || defined(__x86_64__)
    1.45 -    if ( (rc = xc_vcpu_getcontext(xc_handle, domid, 0, &ctxt)) != 0 )
    1.46 +    if ( (rc = modify_returncode(xc_handle, domid)) != 0 )
    1.47          return rc;
    1.48 -    ctxt.user_regs.eax = 1;
    1.49 -    if ( (rc = xc_vcpu_setcontext(xc_handle, domid, 0, &ctxt)) != 0 )
    1.50 -        return rc;
    1.51 -#endif
    1.52  
    1.53      domctl.cmd = XEN_DOMCTL_resumedomain;
    1.54      domctl.domain = domid;