aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:47 +0000
committerIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:47 +0000
commitb491e4e05dabc4708bb21d426c38774996fc111a (patch)
tree5df170bfe15c5edd6c12a6d2f6f5cb29cfa00bb2
parentcb1325b0d5f2809eeb855ef3dc655366536910b8 (diff)
downloadxen-b491e4e05dabc4708bb21d426c38774996fc111a.tar.gz
xen-b491e4e05dabc4708bb21d426c38774996fc111a.tar.bz2
xen-b491e4e05dabc4708bb21d426c38774996fc111a.zip
libxc: osdep: convert xc_evtchn_bind_interdomain()
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
-rw-r--r--tools/libxc/xc_evtchn.c7
-rw-r--r--tools/libxc/xc_linux.c10
-rw-r--r--tools/libxc/xc_minios.c12
-rw-r--r--tools/libxc/xc_netbsd.c10
-rw-r--r--tools/libxc/xc_solaris.c6
-rw-r--r--tools/libxc/xenctrlosdep.h2
6 files changed, 32 insertions, 15 deletions
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index 047b519331..25c665eaa4 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -94,6 +94,13 @@ xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
return xce->ops->u.evtchn.bind_unbound_port(xce, xce->ops_handle, domid);
}
+evtchn_port_or_error_t
+xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+ evtchn_port_t remote_port)
+{
+ return xce->ops->u.evtchn.bind_interdomain(xce, xce->ops_handle, domid, remote_port);
+}
+
/*
* Local variables:
* mode: C
diff --git a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
index 0ae64fa26c..231f3fb6a2 100644
--- a/tools/libxc/xc_linux.c
+++ b/tools/libxc/xc_linux.c
@@ -386,16 +386,17 @@ linux_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
}
-evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
- evtchn_port_t remote_port)
+static evtchn_port_or_error_t
+linux_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
+ evtchn_port_t remote_port)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_interdomain bind;
bind.remote_domain = domid;
bind.remote_port = remote_port;
- return ioctl(xce->fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+ return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
}
evtchn_port_or_error_t
@@ -441,6 +442,7 @@ static struct xc_osdep_ops linux_evtchn_ops = {
.fd = &linux_evtchn_fd,
.notify = &linux_evtchn_notify,
.bind_unbound_port = &linux_evtchn_bind_unbound_port,
+ .bind_interdomain = &linux_evtchn_bind_interdomain,
},
};
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index 0a04e4517b..631078a31d 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -302,27 +302,28 @@ static evtchn_port_or_error_t minios_evtchn_bind_unbound_port(xc_evtchn *xce, xc
return port;
}
-evtchn_port_or_error_t xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+static evtchn_port_or_error_t minios_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
evtchn_port_t remote_port)
{
+ int fd = (int)h;
evtchn_port_t local_port;
int ret, i;
assert(get_current() == main_thread);
- i = port_alloc(xce->fd);
+ i = port_alloc(fd);
if (i == -1)
return -1;
printf("xc_evtchn_bind_interdomain(%d, %"PRId32")", domid, remote_port);
- ret = evtchn_bind_interdomain(domid, remote_port, evtchn_handler, (void*)(intptr_t)xce->fd, &local_port);
+ ret = evtchn_bind_interdomain(domid, remote_port, evtchn_handler, (void*)(intptr_t)fd, &local_port);
printf(" = %d\n", ret);
if (ret < 0) {
errno = -ret;
return -1;
}
- files[xce->fd].evtchn.ports[i].bound = 1;
- files[xce->fd].evtchn.ports[i].port = local_port;
+ files[fd].evtchn.ports[i].bound = 1;
+ files[fd].evtchn.ports[i].port = local_port;
unmask_evtchn(local_port);
return local_port;
}
@@ -406,6 +407,7 @@ static struct xc_osdep_ops minios_evtchn_ops = {
.fd = &minios_evtchn_fd,
.notify = &minios_evtchn_notify,
.bind_unbound_port = &minios_evtchn_bind_unbound_port,
+ .bind_interdomain = &minios_evtchn_bind_interdomain,
},
};
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 6bd72d970e..f14ad85d71 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -241,17 +241,18 @@ netbsd_evtchn_bind_unbound_port(xc_evtchn * xce, xc_osdep_handle h, int domid)
return -1;
}
-evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
- evtchn_port_t remote_port)
+static evtchn_port_or_error_t
+netbsd_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
+ evtchn_port_t remote_port)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_interdomain bind;
int ret;
bind.remote_domain = domid;
bind.remote_port = remote_port;
- ret = ioctl(xce->fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+ ret = ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
if (ret == 0)
return bind.port;
else
@@ -306,6 +307,7 @@ static struct xc_osdep_ops netbsd_evtchn_ops = {
.fd = &netbsd_evtchn_fd,
.notify = &netbsd_evtchn_notify,
.bind_unbound_port = &netbsd_evtchn_bind_unbound_port,
+ .bind_interdomain = &netbsd_evtchn_bind_interdomain,
},
};
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index eaacad5f70..3e704c2c7e 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -229,15 +229,16 @@ solaris_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
}
evtchn_port_or_error_t
-xc_evtchn_bind_interdomain(xc_evtchn *xce, int domid,
+solaris_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
evtchn_port_t remote_port)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_interdomain bind;
bind.remote_domain = domid;
bind.remote_port = remote_port;
- return ioctl(xce->fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+ return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
}
evtchn_port_or_error_t
@@ -283,6 +284,7 @@ static struct xc_osdep_ops solaris_evtchn_ops = {
.fd = &solaris_evtchn_fd,
.notify = &solaris_evtchn_notify,
.bind_unbound_port = &solaris_evtchn_bind_unbound_port,
+ .bind_interdomain = &solaris_evtchn_bind_interdomain,
},
};
diff --git a/tools/libxc/xenctrlosdep.h b/tools/libxc/xenctrlosdep.h
index d67d6d40c6..83c79fdceb 100644
--- a/tools/libxc/xenctrlosdep.h
+++ b/tools/libxc/xenctrlosdep.h
@@ -80,6 +80,8 @@ struct xc_osdep_ops
int (*notify)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port);
evtchn_port_or_error_t (*bind_unbound_port)(xc_evtchn *xce, xc_osdep_handle h, int domid);
+ evtchn_port_or_error_t (*bind_interdomain)(xc_evtchn *xce, xc_osdep_handle h, int domid,
+ evtchn_port_t remote_port);
} evtchn;
} u;
};