aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-06-20 12:26:23 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-06-20 12:26:23 +0100
commit947835578c6dce70d2698e22c901a91ce4bfc93e (patch)
treeef3cc59dffdaf080782aa323e9125325a7c933ff
parenta1b2027c865a85952b82d1a3a6dc3528986ddab0 (diff)
downloadxen-947835578c6dce70d2698e22c901a91ce4bfc93e.tar.gz
xen-947835578c6dce70d2698e22c901a91ce4bfc93e.tar.bz2
xen-947835578c6dce70d2698e22c901a91ce4bfc93e.zip
[IA64] compilation fix caused by 17880:d3a87899985d
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
-rw-r--r--tools/debugger/xenitp/xenitp.c24
-rw-r--r--tools/libxc/ia64/xc_ia64_hvm_build.c7
-rw-r--r--tools/libxc/ia64/xc_ia64_linux_restore.c22
-rw-r--r--tools/libxc/ia64/xc_ia64_linux_save.c16
-rw-r--r--tools/libxc/xc_core_ia64.c3
-rw-r--r--tools/libxc/xc_core_ia64.h2
6 files changed, 45 insertions, 29 deletions
diff --git a/tools/debugger/xenitp/xenitp.c b/tools/debugger/xenitp/xenitp.c
index f2f992a983..95d3820f94 100644
--- a/tools/debugger/xenitp/xenitp.c
+++ b/tools/debugger/xenitp/xenitp.c
@@ -58,6 +58,16 @@ static int cur_vcpu;
int virt_to_phys (int is_inst, unsigned long vaddr, unsigned long *paddr);
+/* wrapper for vcpu_gest_context_any_t */
+static int xc_ia64_vcpu_getcontext(int xc_handle,
+ uint32_t domid,
+ uint32_t vcpu,
+ vcpu_guest_context_t *ctxt)
+{
+ return xc_vcpu_getcontext(xc_handle, domid, vcpu,
+ (vcpu_guest_context_any_t *)ctxt);
+}
+
static inline unsigned int ctx_slot (vcpu_guest_context_t *ctx)
{
return (ctx->regs.psr >> PSR_RI_SHIFT) & 3;
@@ -729,7 +739,7 @@ int wait_domain (int vcpu, vcpu_guest_context_t *ctx)
fflush (stdout);
nanosleep (&ts, NULL);
}
- return xc_vcpu_getcontext (xc_handle, domid, vcpu, ctx);
+ return xc_ia64_vcpu_getcontext (xc_handle, domid, vcpu, ctx);
}
int virt_to_phys (int is_inst, unsigned long vaddr, unsigned long *paddr)
@@ -945,13 +955,13 @@ char *parse_arg (char **buf)
return res;
}
-vcpu_guest_context_t vcpu_ctx[MAX_VIRT_CPUS];
+vcpu_guest_context_any_t vcpu_ctx_any[MAX_VIRT_CPUS];
int vcpu_setcontext (int vcpu)
{
int ret;
- ret = xc_vcpu_setcontext (xc_handle, domid, vcpu, &vcpu_ctx[vcpu]);
+ ret = xc_vcpu_setcontext (xc_handle, domid, vcpu, &vcpu_ctx_any[vcpu]);
if (ret < 0)
perror ("xc_vcpu_setcontext");
@@ -1518,7 +1528,7 @@ enum cmd_status do_command (int vcpu, char *line)
int flag_ambiguous;
cur_vcpu = vcpu;
- cur_ctx = &vcpu_ctx[vcpu];
+ cur_ctx = &vcpu_ctx_any[vcpu].c;
/* Handle repeat last-command. */
if (*line == 0) {
@@ -1575,7 +1585,7 @@ void xenitp (int vcpu)
int ret;
struct sigaction sa;
- cur_ctx = &vcpu_ctx[vcpu];
+ cur_ctx = &vcpu_ctx_any[vcpu].c;
xc_handle = xc_interface_open (); /* for accessing control interface */
@@ -1588,9 +1598,9 @@ void xenitp (int vcpu)
exit (-1);
}
- ret = xc_vcpu_getcontext (xc_handle, domid, vcpu, cur_ctx);
+ ret = xc_ia64_vcpu_getcontext (xc_handle, domid, vcpu, cur_ctx);
if (ret < 0) {
- perror ("xc_vcpu_getcontext");
+ perror ("xc_ia64_vcpu_getcontext");
exit (-1);
}
diff --git a/tools/libxc/ia64/xc_ia64_hvm_build.c b/tools/libxc/ia64/xc_ia64_hvm_build.c
index 5a27ffc2c2..016037041d 100644
--- a/tools/libxc/ia64/xc_ia64_hvm_build.c
+++ b/tools/libxc/ia64/xc_ia64_hvm_build.c
@@ -1052,7 +1052,8 @@ error_out:
int
xc_hvm_build(int xc_handle, uint32_t domid, int memsize, const char *image_name)
{
- vcpu_guest_context_t st_ctxt, *ctxt = &st_ctxt;
+ vcpu_guest_context_any_t st_ctxt_any;
+ vcpu_guest_context_t *ctxt = &st_ctxt_any.c;
char *image = NULL;
unsigned long image_size;
unsigned long nr_pages;
@@ -1079,14 +1080,14 @@ xc_hvm_build(int xc_handle, uint32_t domid, int memsize, const char *image_name)
free(image);
- memset(ctxt, 0, sizeof(*ctxt));
+ memset(&st_ctxt_any, 0, sizeof(st_ctxt_any));
ctxt->regs.ip = 0x80000000ffffffb0UL;
ctxt->regs.ar.fpsr = xc_ia64_fpsr_default();
ctxt->regs.cr.itir = 14 << 2;
ctxt->regs.psr = IA64_PSR_AC | IA64_PSR_BN;
ctxt->regs.cr.dcr = 0;
ctxt->regs.cr.pta = 15 << 2;
- return xc_vcpu_setcontext(xc_handle, domid, 0, ctxt);
+ return xc_vcpu_setcontext(xc_handle, domid, 0, &st_ctxt_any);
error_out:
free(image);
diff --git a/tools/libxc/ia64/xc_ia64_linux_restore.c b/tools/libxc/ia64/xc_ia64_linux_restore.c
index 528eef67e2..f9c59b380d 100644
--- a/tools/libxc/ia64/xc_ia64_linux_restore.c
+++ b/tools/libxc/ia64/xc_ia64_linux_restore.c
@@ -117,8 +117,9 @@ xc_ia64_recv_unallocated_list(int xc_handle, int io_fd, uint32_t dom,
static int
xc_ia64_recv_vcpu_context(int xc_handle, int io_fd, uint32_t dom,
- uint32_t vcpu, vcpu_guest_context_t *ctxt)
+ uint32_t vcpu, vcpu_guest_context_any_t *ctxt_any)
{
+ vcpu_guest_context_t *ctxt = &ctxt_any->c;
if (read_exact(io_fd, ctxt, sizeof(*ctxt))) {
ERROR("Error when reading ctxt");
return -1;
@@ -128,14 +129,14 @@ xc_ia64_recv_vcpu_context(int xc_handle, int io_fd, uint32_t dom,
/* Initialize and set registers. */
ctxt->flags = VGCF_EXTRA_REGS | VGCF_SET_CR_IRR;
- if (xc_vcpu_setcontext(xc_handle, dom, vcpu, ctxt) != 0) {
+ if (xc_vcpu_setcontext(xc_handle, dom, vcpu, ctxt_any) != 0) {
ERROR("Couldn't set vcpu context");
return -1;
}
/* Just a check. */
ctxt->flags = 0;
- if (xc_vcpu_getcontext(xc_handle, dom, vcpu, ctxt)) {
+ if (xc_vcpu_getcontext(xc_handle, dom, vcpu, ctxt_any)) {
ERROR("Could not get vcpu context");
return -1;
}
@@ -195,22 +196,23 @@ xc_ia64_pv_recv_context(int xc_handle, int io_fd, uint32_t dom,
unsigned long gmfn;
/* A copy of the CPU context of the guest. */
- vcpu_guest_context_t ctxt;
+ vcpu_guest_context_any_t ctxt_any;
+ vcpu_guest_context_t *ctxt = &ctxt_any.c;
/* A temporary mapping of the guest's start_info page. */
start_info_t *start_info;
- if (lock_pages(&ctxt, sizeof(ctxt))) {
+ if (lock_pages(&ctxt_any, sizeof(ctxt_any))) {
/* needed for build domctl, but might as well do early */
ERROR("Unable to lock_pages ctxt");
return -1;
}
- if (xc_ia64_recv_vcpu_context(xc_handle, io_fd, dom, 0, &ctxt))
+ if (xc_ia64_recv_vcpu_context(xc_handle, io_fd, dom, 0, &ctxt_any))
goto out;
/* Then get privreg page. */
- if (read_page(xc_handle, io_fd, dom, ctxt.privregs_pfn) < 0) {
+ if (read_page(xc_handle, io_fd, dom, ctxt->privregs_pfn) < 0) {
ERROR("Could not read vcpu privregs");
goto out;
}
@@ -243,7 +245,7 @@ xc_ia64_pv_recv_context(int xc_handle, int io_fd, uint32_t dom,
rc = 0;
out:
- unlock_pages(&ctxt, sizeof(ctxt));
+ unlock_pages(&ctxt_any, sizeof(ctxt_any));
return rc;
}
@@ -314,12 +316,12 @@ xc_ia64_hvm_recv_context(int xc_handle, int io_fd, uint32_t dom,
/* vcpu context */
for (i = 0; i <= info.max_vcpu_id; i++) {
/* A copy of the CPU context of the guest. */
- vcpu_guest_context_t ctxt;
+ vcpu_guest_context_any_t ctxt_any;
if (!__test_bit(i, vcpumap))
continue;
- if (xc_ia64_recv_vcpu_context(xc_handle, io_fd, dom, i, &ctxt))
+ if (xc_ia64_recv_vcpu_context(xc_handle, io_fd, dom, i, &ctxt_any))
goto out;
// system context of vcpu is recieved as hvm context.
diff --git a/tools/libxc/ia64/xc_ia64_linux_save.c b/tools/libxc/ia64/xc_ia64_linux_save.c
index 2009da781e..77398eecd2 100644
--- a/tools/libxc/ia64/xc_ia64_linux_save.c
+++ b/tools/libxc/ia64/xc_ia64_linux_save.c
@@ -180,9 +180,10 @@ xc_ia64_send_unallocated_list(int xc_handle, int io_fd,
static int
xc_ia64_send_vcpu_context(int xc_handle, int io_fd, uint32_t dom,
- uint32_t vcpu, vcpu_guest_context_t *ctxt)
+ uint32_t vcpu, vcpu_guest_context_any_t *ctxt_any)
{
- if (xc_vcpu_getcontext(xc_handle, dom, vcpu, ctxt)) {
+ vcpu_guest_context_t *ctxt = &ctxt_any->c;
+ if (xc_vcpu_getcontext(xc_handle, dom, vcpu, ctxt_any)) {
ERROR("Could not get vcpu context");
return -1;
}
@@ -211,14 +212,15 @@ xc_ia64_pv_send_context(int xc_handle, int io_fd, uint32_t dom,
shared_info_t *live_shinfo)
{
/* A copy of the CPU context of the guest. */
- vcpu_guest_context_t ctxt;
+ vcpu_guest_context_any_t ctxt_any;
+ vcpu_guest_context_t *ctxt = &ctxt_any.c;
char *mem;
- if (xc_ia64_send_vcpu_context(xc_handle, io_fd, dom, 0, &ctxt))
+ if (xc_ia64_send_vcpu_context(xc_handle, io_fd, dom, 0, &ctxt_any))
return -1;
mem = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
- PROT_READ|PROT_WRITE, ctxt.privregs_pfn);
+ PROT_READ|PROT_WRITE, ctxt->privregs_pfn);
if (mem == NULL) {
ERROR("cannot map privreg page");
return -1;
@@ -297,12 +299,12 @@ xc_ia64_hvm_send_context(int xc_handle, int io_fd, uint32_t dom,
/* vcpu context */
for (i = 0; i <= info->max_vcpu_id; i++) {
/* A copy of the CPU context of the guest. */
- vcpu_guest_context_t ctxt;
+ vcpu_guest_context_any_t ctxt_any;
if (!__test_bit(i, vcpumap))
continue;
- if (xc_ia64_send_vcpu_context(xc_handle, io_fd, dom, i, &ctxt))
+ if (xc_ia64_send_vcpu_context(xc_handle, io_fd, dom, i, &ctxt_any))
goto out;
// system context of vcpu is sent as hvm context.
diff --git a/tools/libxc/xc_core_ia64.c b/tools/libxc/xc_core_ia64.c
index bd233cd1a6..ce9c07d24e 100644
--- a/tools/libxc/xc_core_ia64.c
+++ b/tools/libxc/xc_core_ia64.c
@@ -308,9 +308,10 @@ xc_core_arch_context_free(struct xc_core_arch_context* arch_ctxt)
int
xc_core_arch_context_get(struct xc_core_arch_context* arch_ctxt,
- vcpu_guest_context_t* ctxt,
+ vcpu_guest_context_any_t* ctxt_any,
int xc_handle, uint32_t domid)
{
+ vcpu_guest_context_t *ctxt = &ctxt_any->c;
mapped_regs_t* mapped_regs;
if ( ctxt->privregs_pfn == VGC_PRIVREGS_HVM )
diff --git a/tools/libxc/xc_core_ia64.h b/tools/libxc/xc_core_ia64.h
index 88e7e229e1..75dd40fdc7 100644
--- a/tools/libxc/xc_core_ia64.h
+++ b/tools/libxc/xc_core_ia64.h
@@ -40,7 +40,7 @@ void
xc_core_arch_context_free(struct xc_core_arch_context* arch_ctxt);
int
xc_core_arch_context_get(struct xc_core_arch_context* arch_ctxt,
- vcpu_guest_context_t* ctxt,
+ vcpu_guest_context_any_t* ctxt,
int xc_handle, uint32_t domid);
int
xc_core_arch_context_get_shdr(struct xc_core_arch_context* arch_ctxt,