ia64/xen-unstable

changeset 17896:26ecd1f9e128

[IA64] compilation fix caused by 17880:d3a87899985d

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 20 12:26:23 2008 +0100 (2008-06-20)
parents ec5717ac4815
children ad156e312aef
files tools/debugger/xenitp/xenitp.c tools/libxc/ia64/xc_ia64_hvm_build.c tools/libxc/ia64/xc_ia64_linux_restore.c tools/libxc/ia64/xc_ia64_linux_save.c tools/libxc/xc_core_ia64.c tools/libxc/xc_core_ia64.h
line diff
     1.1 --- a/tools/debugger/xenitp/xenitp.c	Fri Jun 20 12:18:10 2008 +0100
     1.2 +++ b/tools/debugger/xenitp/xenitp.c	Fri Jun 20 12:26:23 2008 +0100
     1.3 @@ -58,6 +58,16 @@ static int cur_vcpu;
     1.4  
     1.5  int virt_to_phys (int is_inst, unsigned long vaddr, unsigned long *paddr);
     1.6  
     1.7 +/* wrapper for vcpu_gest_context_any_t */
     1.8 +static int xc_ia64_vcpu_getcontext(int xc_handle,
     1.9 +                                   uint32_t domid,
    1.10 +                                   uint32_t vcpu,
    1.11 +                                   vcpu_guest_context_t *ctxt)
    1.12 +{
    1.13 +    return xc_vcpu_getcontext(xc_handle, domid, vcpu,
    1.14 +                              (vcpu_guest_context_any_t *)ctxt);
    1.15 +}
    1.16 +
    1.17  static inline unsigned int ctx_slot (vcpu_guest_context_t *ctx)
    1.18  {
    1.19      return (ctx->regs.psr >> PSR_RI_SHIFT) & 3;
    1.20 @@ -729,7 +739,7 @@ int wait_domain (int vcpu, vcpu_guest_co
    1.21          fflush (stdout);
    1.22          nanosleep (&ts, NULL);
    1.23      }
    1.24 -    return xc_vcpu_getcontext (xc_handle, domid, vcpu, ctx);
    1.25 +    return xc_ia64_vcpu_getcontext (xc_handle, domid, vcpu, ctx);
    1.26  }
    1.27  
    1.28  int virt_to_phys (int is_inst, unsigned long vaddr, unsigned long *paddr)
    1.29 @@ -945,13 +955,13 @@ char *parse_arg (char **buf)
    1.30      return res;
    1.31  }
    1.32  
    1.33 -vcpu_guest_context_t vcpu_ctx[MAX_VIRT_CPUS];
    1.34 +vcpu_guest_context_any_t vcpu_ctx_any[MAX_VIRT_CPUS];
    1.35  
    1.36  int vcpu_setcontext (int vcpu)
    1.37  {
    1.38      int ret;
    1.39  
    1.40 -    ret = xc_vcpu_setcontext (xc_handle, domid, vcpu, &vcpu_ctx[vcpu]);
    1.41 +    ret = xc_vcpu_setcontext (xc_handle, domid, vcpu, &vcpu_ctx_any[vcpu]);
    1.42      if (ret < 0)
    1.43          perror ("xc_vcpu_setcontext");
    1.44  
    1.45 @@ -1518,7 +1528,7 @@ enum cmd_status do_command (int vcpu, ch
    1.46      int flag_ambiguous;
    1.47  
    1.48      cur_vcpu = vcpu;
    1.49 -    cur_ctx = &vcpu_ctx[vcpu];
    1.50 +    cur_ctx = &vcpu_ctx_any[vcpu].c;
    1.51  
    1.52      /* Handle repeat last-command.  */
    1.53      if (*line == 0) {
    1.54 @@ -1575,7 +1585,7 @@ void xenitp (int vcpu)
    1.55      int ret;
    1.56      struct sigaction sa;
    1.57  
    1.58 -    cur_ctx = &vcpu_ctx[vcpu];
    1.59 +    cur_ctx = &vcpu_ctx_any[vcpu].c;
    1.60  
    1.61      xc_handle = xc_interface_open (); /* for accessing control interface */
    1.62  
    1.63 @@ -1588,9 +1598,9 @@ void xenitp (int vcpu)
    1.64          exit (-1);
    1.65      }
    1.66  
    1.67 -    ret = xc_vcpu_getcontext (xc_handle, domid, vcpu, cur_ctx);
    1.68 +    ret = xc_ia64_vcpu_getcontext (xc_handle, domid, vcpu, cur_ctx);
    1.69      if (ret < 0) {
    1.70 -        perror ("xc_vcpu_getcontext");
    1.71 +        perror ("xc_ia64_vcpu_getcontext");
    1.72          exit (-1);
    1.73      }
    1.74  
     2.1 --- a/tools/libxc/ia64/xc_ia64_hvm_build.c	Fri Jun 20 12:18:10 2008 +0100
     2.2 +++ b/tools/libxc/ia64/xc_ia64_hvm_build.c	Fri Jun 20 12:26:23 2008 +0100
     2.3 @@ -1052,7 +1052,8 @@ error_out:
     2.4  int
     2.5  xc_hvm_build(int xc_handle, uint32_t domid, int memsize, const char *image_name)
     2.6  {
     2.7 -    vcpu_guest_context_t st_ctxt, *ctxt = &st_ctxt;
     2.8 +    vcpu_guest_context_any_t st_ctxt_any;
     2.9 +    vcpu_guest_context_t *ctxt = &st_ctxt_any.c;
    2.10      char *image = NULL;
    2.11      unsigned long image_size;
    2.12      unsigned long nr_pages;
    2.13 @@ -1079,14 +1080,14 @@ xc_hvm_build(int xc_handle, uint32_t dom
    2.14  
    2.15      free(image);
    2.16  
    2.17 -    memset(ctxt, 0, sizeof(*ctxt));
    2.18 +    memset(&st_ctxt_any, 0, sizeof(st_ctxt_any));
    2.19      ctxt->regs.ip = 0x80000000ffffffb0UL;
    2.20      ctxt->regs.ar.fpsr = xc_ia64_fpsr_default();
    2.21      ctxt->regs.cr.itir = 14 << 2;
    2.22      ctxt->regs.psr = IA64_PSR_AC | IA64_PSR_BN;
    2.23      ctxt->regs.cr.dcr = 0;
    2.24      ctxt->regs.cr.pta = 15 << 2;
    2.25 -    return xc_vcpu_setcontext(xc_handle, domid, 0, ctxt);
    2.26 +    return xc_vcpu_setcontext(xc_handle, domid, 0, &st_ctxt_any);
    2.27  
    2.28  error_out:
    2.29      free(image);
     3.1 --- a/tools/libxc/ia64/xc_ia64_linux_restore.c	Fri Jun 20 12:18:10 2008 +0100
     3.2 +++ b/tools/libxc/ia64/xc_ia64_linux_restore.c	Fri Jun 20 12:26:23 2008 +0100
     3.3 @@ -117,8 +117,9 @@ xc_ia64_recv_unallocated_list(int xc_han
     3.4  
     3.5  static int
     3.6  xc_ia64_recv_vcpu_context(int xc_handle, int io_fd, uint32_t dom,
     3.7 -                          uint32_t vcpu, vcpu_guest_context_t *ctxt)
     3.8 +                          uint32_t vcpu, vcpu_guest_context_any_t *ctxt_any)
     3.9  {
    3.10 +    vcpu_guest_context_t *ctxt = &ctxt_any->c;
    3.11      if (read_exact(io_fd, ctxt, sizeof(*ctxt))) {
    3.12          ERROR("Error when reading ctxt");
    3.13          return -1;
    3.14 @@ -128,14 +129,14 @@ xc_ia64_recv_vcpu_context(int xc_handle,
    3.15  
    3.16      /* Initialize and set registers.  */
    3.17      ctxt->flags = VGCF_EXTRA_REGS | VGCF_SET_CR_IRR;
    3.18 -    if (xc_vcpu_setcontext(xc_handle, dom, vcpu, ctxt) != 0) {
    3.19 +    if (xc_vcpu_setcontext(xc_handle, dom, vcpu, ctxt_any) != 0) {
    3.20          ERROR("Couldn't set vcpu context");
    3.21          return -1;
    3.22      }
    3.23  
    3.24      /* Just a check.  */
    3.25      ctxt->flags = 0;
    3.26 -    if (xc_vcpu_getcontext(xc_handle, dom, vcpu, ctxt)) {
    3.27 +    if (xc_vcpu_getcontext(xc_handle, dom, vcpu, ctxt_any)) {
    3.28          ERROR("Could not get vcpu context");
    3.29          return -1;
    3.30      }
    3.31 @@ -195,22 +196,23 @@ xc_ia64_pv_recv_context(int xc_handle, i
    3.32      unsigned long gmfn;
    3.33  
    3.34      /* A copy of the CPU context of the guest. */
    3.35 -    vcpu_guest_context_t ctxt;
    3.36 +    vcpu_guest_context_any_t ctxt_any;
    3.37 +    vcpu_guest_context_t *ctxt = &ctxt_any.c;
    3.38  
    3.39      /* A temporary mapping of the guest's start_info page. */
    3.40      start_info_t *start_info;
    3.41  
    3.42 -    if (lock_pages(&ctxt, sizeof(ctxt))) {
    3.43 +    if (lock_pages(&ctxt_any, sizeof(ctxt_any))) {
    3.44          /* needed for build domctl, but might as well do early */
    3.45          ERROR("Unable to lock_pages ctxt");
    3.46          return -1;
    3.47      }
    3.48  
    3.49 -    if (xc_ia64_recv_vcpu_context(xc_handle, io_fd, dom, 0, &ctxt))
    3.50 +    if (xc_ia64_recv_vcpu_context(xc_handle, io_fd, dom, 0, &ctxt_any))
    3.51          goto out;
    3.52  
    3.53      /* Then get privreg page.  */
    3.54 -    if (read_page(xc_handle, io_fd, dom, ctxt.privregs_pfn) < 0) {
    3.55 +    if (read_page(xc_handle, io_fd, dom, ctxt->privregs_pfn) < 0) {
    3.56          ERROR("Could not read vcpu privregs");
    3.57          goto out;
    3.58      }
    3.59 @@ -243,7 +245,7 @@ xc_ia64_pv_recv_context(int xc_handle, i
    3.60      rc = 0;
    3.61  
    3.62   out:
    3.63 -    unlock_pages(&ctxt, sizeof(ctxt));
    3.64 +    unlock_pages(&ctxt_any, sizeof(ctxt_any));
    3.65      return rc;
    3.66  }
    3.67  
    3.68 @@ -314,12 +316,12 @@ xc_ia64_hvm_recv_context(int xc_handle, 
    3.69      /* vcpu context */
    3.70      for (i = 0; i <= info.max_vcpu_id; i++) {
    3.71          /* A copy of the CPU context of the guest. */
    3.72 -        vcpu_guest_context_t ctxt;
    3.73 +        vcpu_guest_context_any_t ctxt_any;
    3.74  
    3.75          if (!__test_bit(i, vcpumap))
    3.76              continue;
    3.77  
    3.78 -        if (xc_ia64_recv_vcpu_context(xc_handle, io_fd, dom, i, &ctxt))
    3.79 +        if (xc_ia64_recv_vcpu_context(xc_handle, io_fd, dom, i, &ctxt_any))
    3.80              goto out;
    3.81  
    3.82          // system context of vcpu is recieved as hvm context.
     4.1 --- a/tools/libxc/ia64/xc_ia64_linux_save.c	Fri Jun 20 12:18:10 2008 +0100
     4.2 +++ b/tools/libxc/ia64/xc_ia64_linux_save.c	Fri Jun 20 12:26:23 2008 +0100
     4.3 @@ -180,9 +180,10 @@ xc_ia64_send_unallocated_list(int xc_han
     4.4  
     4.5  static int
     4.6  xc_ia64_send_vcpu_context(int xc_handle, int io_fd, uint32_t dom,
     4.7 -                          uint32_t vcpu, vcpu_guest_context_t *ctxt)
     4.8 +                          uint32_t vcpu, vcpu_guest_context_any_t *ctxt_any)
     4.9  {
    4.10 -    if (xc_vcpu_getcontext(xc_handle, dom, vcpu, ctxt)) {
    4.11 +    vcpu_guest_context_t *ctxt = &ctxt_any->c;
    4.12 +    if (xc_vcpu_getcontext(xc_handle, dom, vcpu, ctxt_any)) {
    4.13          ERROR("Could not get vcpu context");
    4.14          return -1;
    4.15      }
    4.16 @@ -211,14 +212,15 @@ xc_ia64_pv_send_context(int xc_handle, i
    4.17                          shared_info_t *live_shinfo)
    4.18  {
    4.19      /* A copy of the CPU context of the guest. */
    4.20 -    vcpu_guest_context_t ctxt;
    4.21 +    vcpu_guest_context_any_t ctxt_any;
    4.22 +    vcpu_guest_context_t *ctxt = &ctxt_any.c;
    4.23      char *mem;
    4.24  
    4.25 -    if (xc_ia64_send_vcpu_context(xc_handle, io_fd, dom, 0, &ctxt))
    4.26 +    if (xc_ia64_send_vcpu_context(xc_handle, io_fd, dom, 0, &ctxt_any))
    4.27          return -1;
    4.28  
    4.29      mem = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
    4.30 -                               PROT_READ|PROT_WRITE, ctxt.privregs_pfn);
    4.31 +                               PROT_READ|PROT_WRITE, ctxt->privregs_pfn);
    4.32      if (mem == NULL) {
    4.33          ERROR("cannot map privreg page");
    4.34          return -1;
    4.35 @@ -297,12 +299,12 @@ xc_ia64_hvm_send_context(int xc_handle, 
    4.36      /* vcpu context */
    4.37      for (i = 0; i <= info->max_vcpu_id; i++) {
    4.38          /* A copy of the CPU context of the guest. */
    4.39 -        vcpu_guest_context_t ctxt;
    4.40 +        vcpu_guest_context_any_t ctxt_any;
    4.41  
    4.42          if (!__test_bit(i, vcpumap))
    4.43              continue;
    4.44  
    4.45 -        if (xc_ia64_send_vcpu_context(xc_handle, io_fd, dom, i, &ctxt))
    4.46 +        if (xc_ia64_send_vcpu_context(xc_handle, io_fd, dom, i, &ctxt_any))
    4.47              goto out;
    4.48  
    4.49          // system context of vcpu is sent as hvm context.
     5.1 --- a/tools/libxc/xc_core_ia64.c	Fri Jun 20 12:18:10 2008 +0100
     5.2 +++ b/tools/libxc/xc_core_ia64.c	Fri Jun 20 12:26:23 2008 +0100
     5.3 @@ -308,9 +308,10 @@ xc_core_arch_context_free(struct xc_core
     5.4  
     5.5  int
     5.6  xc_core_arch_context_get(struct xc_core_arch_context* arch_ctxt,
     5.7 -                         vcpu_guest_context_t* ctxt,
     5.8 +                         vcpu_guest_context_any_t* ctxt_any,
     5.9                           int xc_handle, uint32_t domid)
    5.10  {
    5.11 +    vcpu_guest_context_t *ctxt = &ctxt_any->c;
    5.12      mapped_regs_t* mapped_regs;
    5.13  
    5.14      if ( ctxt->privregs_pfn == VGC_PRIVREGS_HVM )
     6.1 --- a/tools/libxc/xc_core_ia64.h	Fri Jun 20 12:18:10 2008 +0100
     6.2 +++ b/tools/libxc/xc_core_ia64.h	Fri Jun 20 12:26:23 2008 +0100
     6.3 @@ -40,7 +40,7 @@ void
     6.4  xc_core_arch_context_free(struct xc_core_arch_context* arch_ctxt);
     6.5  int
     6.6  xc_core_arch_context_get(struct xc_core_arch_context* arch_ctxt,
     6.7 -                         vcpu_guest_context_t* ctxt,
     6.8 +                         vcpu_guest_context_any_t* ctxt,
     6.9                           int xc_handle, uint32_t domid);
    6.10  int
    6.11  xc_core_arch_context_get_shdr(struct xc_core_arch_context* arch_ctxt,