# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1291369007 0
# Node ID 7637af0d22976a3a84461e6ccdc6f29a9f81504f
# Parent e1593440f73c4a3474820312d9076f40c0a69b77
libxc: osdep: convert xc_evtchn_bind_unbound_port()
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/libxc/xc_evtchn.c | 6 ++++++
tools/libxc/xc_linux.c | 10 ++++++----
tools/libxc/xc_minios.c | 14 ++++++++------
tools/libxc/xc_netbsd.c | 10 ++++++----
tools/libxc/xc_solaris.c | 10 ++++++----
tools/libxc/xenctrlosdep.h | 2 ++
6 files changed, 34 insertions(+), 18 deletions(-)
diff -r e1593440f73c -r 7637af0d2297 tools/libxc/xc_evtchn.c
--- a/tools/libxc/xc_evtchn.c Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_evtchn.c Fri Dec 03 09:36:47 2010 +0000
@@ -88,6 +88,12 @@ int xc_evtchn_notify(xc_evtchn *xce, evt
return xce->ops->u.evtchn.notify(xce, xce->ops_handle, port);
}
+evtchn_port_or_error_t
+xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
+{
+ return xce->ops->u.evtchn.bind_unbound_port(xce, xce->ops_handle, domid);
+}
+
/*
* Local variables:
* mode: C
diff -r e1593440f73c -r 7637af0d2297 tools/libxc/xc_linux.c
--- a/tools/libxc/xc_linux.c Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_linux.c Fri Dec 03 09:36:47 2010 +0000
@@ -375,14 +375,15 @@ static int linux_evtchn_notify(xc_evtchn
return ioctl(fd, IOCTL_EVTCHN_NOTIFY, ¬ify);
}
-evtchn_port_or_error_t
-xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
-{
+static evtchn_port_or_error_t
+linux_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
+{
+ int fd = (int)h;
struct ioctl_evtchn_bind_unbound_port bind;
bind.remote_domain = domid;
- return ioctl(xce->fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+ return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
}
evtchn_port_or_error_t
@@ -439,6 +440,7 @@ static struct xc_osdep_ops linux_evtchn_
.u.evtchn = {
.fd = &linux_evtchn_fd,
.notify = &linux_evtchn_notify,
+ .bind_unbound_port = &linux_evtchn_bind_unbound_port,
},
};
diff -r e1593440f73c -r 7637af0d2297 tools/libxc/xc_minios.c
--- a/tools/libxc/xc_minios.c Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_minios.c Fri Dec 03 09:36:47 2010 +0000
@@ -277,26 +277,27 @@ static void evtchn_handler(evtchn_port_t
wake_up(&event_queue);
}
-evtchn_port_or_error_t xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
-{
+static evtchn_port_or_error_t minios_evtchn_bind_unbound_port(xc_evtchn *xce,
xc_osdep_handle h, int domid)
+{
+ int fd = (int)h;
int ret, i;
evtchn_port_t port;
assert(get_current() == main_thread);
- i = port_alloc(xce->fd);
+ i = port_alloc(fd);
if (i == -1)
return -1;
printf("xc_evtchn_bind_unbound_port(%d)", domid);
- ret = evtchn_alloc_unbound(domid, evtchn_handler,
(void*)(intptr_t)xce->fd, &port);
+ ret = evtchn_alloc_unbound(domid, evtchn_handler, (void*)(intptr_t)fd,
&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 = port;
+ files[fd].evtchn.ports[i].bound = 1;
+ files[fd].evtchn.ports[i].port = port;
unmask_evtchn(port);
return port;
}
@@ -404,6 +405,7 @@ static struct xc_osdep_ops minios_evtchn
.u.evtchn = {
.fd = &minios_evtchn_fd,
.notify = &minios_evtchn_notify,
+ .bind_unbound_port = &minios_evtchn_bind_unbound_port,
},
};
diff -r e1593440f73c -r 7637af0d2297 tools/libxc/xc_netbsd.c
--- a/tools/libxc/xc_netbsd.c Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_netbsd.c Fri Dec 03 09:36:47 2010 +0000
@@ -225,15 +225,16 @@ static int netbsd_evtchn_notify(xc_evtch
return ioctl(fd, IOCTL_EVTCHN_NOTIFY, ¬ify);
}
-evtchn_port_or_error_t
-xc_evtchn_bind_unbound_port(xc_evtchn * xce, int domid)
-{
+static evtchn_port_or_error_t
+netbsd_evtchn_bind_unbound_port(xc_evtchn * xce, xc_osdep_handle h, int domid)
+{
+ int fd = (int)h;
struct ioctl_evtchn_bind_unbound_port bind;
int ret;
bind.remote_domain = domid;
- ret = ioctl(xce->fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+ ret = ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
if (ret == 0)
return bind.port;
else
@@ -304,6 +305,7 @@ static struct xc_osdep_ops netbsd_evtchn
.u.evtchn = {
.fd = &netbsd_evtchn_fd,
.notify = &netbsd_evtchn_notify,
+ .bind_unbound_port = &netbsd_evtchn_bind_unbound_port,
},
};
diff -r e1593440f73c -r 7637af0d2297 tools/libxc/xc_solaris.c
--- a/tools/libxc/xc_solaris.c Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_solaris.c Fri Dec 03 09:36:47 2010 +0000
@@ -217,14 +217,15 @@ static int solaris_evtchn_notify(xc_evtc
return ioctl(fd, IOCTL_EVTCHN_NOTIFY, ¬ify);
}
-evtchn_port_or_error_t
-xc_evtchn_bind_unbound_port(xc_evtchn *xce, int domid)
-{
+static evtchn_port_or_error_t
+solaris_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
+{
+ int fd = (int)h;
struct ioctl_evtchn_bind_unbound_port bind;
bind.remote_domain = domid;
- return ioctl(xce->fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+ return ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
}
evtchn_port_or_error_t
@@ -281,6 +282,7 @@ static struct xc_osdep_ops solaris_evtch
.u.evtchn = {
.fd = &solaris_evtchn_fd,
.notify = &solaris_evtchn_notify,
+ .bind_unbound_port = &solaris_evtchn_bind_unbound_port,
},
};
diff -r e1593440f73c -r 7637af0d2297 tools/libxc/xenctrlosdep.h
--- a/tools/libxc/xenctrlosdep.h Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xenctrlosdep.h Fri Dec 03 09:36:47 2010 +0000
@@ -78,6 +78,8 @@ struct xc_osdep_ops
int (*fd)(xc_evtchn *xce, xc_osdep_handle h);
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;
} u;
};
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|