[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxc: osdep: convert xc_evtchn_unbind()
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxx> # Date 1291369007 0 # Node ID 0ac7a4c596d17f46a313ce8f3d5fc8201aea63b2 # Parent a154ee7ddc9a420d7175fd7a92adfb4e4c495da9 libxc: osdep: convert xc_evtchn_unbind() Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> Signed-off-by: Ian Jackson <ian.jackson.citrix.com> --- tools/libxc/xc_evtchn.c | 5 +++++ tools/libxc/xc_linux.c | 8 +++++--- tools/libxc/xc_minios.c | 14 ++++++++------ tools/libxc/xc_netbsd.c | 8 +++++--- tools/libxc/xc_solaris.c | 8 +++++--- tools/libxc/xenctrlosdep.h | 2 ++ 6 files changed, 30 insertions(+), 15 deletions(-) diff -r a154ee7ddc9a -r 0ac7a4c596d1 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 @@ -107,6 +107,11 @@ xc_evtchn_bind_virq(xc_evtchn *xce, unsi return xce->ops->u.evtchn.bind_virq(xce, xce->ops_handle, virq); } +int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port) +{ + return xce->ops->u.evtchn.unbind(xce, xce->ops_handle, port); +} + /* * Local variables: * mode: C diff -r a154ee7ddc9a -r 0ac7a4c596d1 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 @@ -410,13 +410,14 @@ linux_evtchn_bind_virq(xc_evtchn *xce, x return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind); } -int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port) -{ +static int linux_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port) +{ + int fd = (int)h; struct ioctl_evtchn_unbind unbind; unbind.port = port; - return ioctl(xce->fd, IOCTL_EVTCHN_UNBIND, &unbind); + return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind); } evtchn_port_or_error_t @@ -445,6 +446,7 @@ static struct xc_osdep_ops linux_evtchn_ .bind_unbound_port = &linux_evtchn_bind_unbound_port, .bind_interdomain = &linux_evtchn_bind_interdomain, .bind_virq = &linux_evtchn_bind_virq, + .unbind = &linux_evtchn_unbind, }, }; diff -r a154ee7ddc9a -r 0ac7a4c596d1 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 @@ -328,20 +328,21 @@ static evtchn_port_or_error_t minios_evt return local_port; } -int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port) -{ +static int minios_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port) +{ + int fd = (int)h; int i; for (i = 0; i < MAX_EVTCHN_PORTS; i++) - if (files[xce->fd].evtchn.ports[i].port == port) { - files[xce->fd].evtchn.ports[i].port = -1; + if (files[fd].evtchn.ports[i].port == port) { + files[fd].evtchn.ports[i].port = -1; break; } if (i == MAX_EVTCHN_PORTS) { - printf("Warning: couldn't find port %"PRId32" for xc handle %x\n", port, xce->fd); + printf("Warning: couldn't find port %"PRId32" for xc handle %x\n", port, fd); errno = -EINVAL; return -1; } - files[xce->fd].evtchn.ports[i].bound = 0; + files[fd].evtchn.ports[i].bound = 0; unbind_evtchn(port); return 0; } @@ -410,6 +411,7 @@ static struct xc_osdep_ops minios_evtchn .bind_unbound_port = &minios_evtchn_bind_unbound_port, .bind_interdomain = &minios_evtchn_bind_interdomain, .bind_virq = &minios_evtchn_bind_virq, + .unbind = &minios_evtchn_unbind, }, }; diff -r a154ee7ddc9a -r 0ac7a4c596d1 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 @@ -259,13 +259,14 @@ netbsd_evtchn_bind_interdomain(xc_evtchn return -1; } -int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port) -{ +static int netbsd_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port) +{ + int fd = (int)h; struct ioctl_evtchn_unbind unbind; unbind.port = port; - return ioctl(xce->fd, IOCTL_EVTCHN_UNBIND, &unbind); + return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind); } static evtchn_port_or_error_t @@ -310,6 +311,7 @@ static struct xc_osdep_ops netbsd_evtchn .bind_unbound_port = &netbsd_evtchn_bind_unbound_port, .bind_interdomain = &netbsd_evtchn_bind_interdomain, .bind_virq = &netbsd_evtchn_bind_virq, + .unbind = &netbsd_evtchn_unbind, }, }; diff -r a154ee7ddc9a -r 0ac7a4c596d1 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 @@ -252,13 +252,14 @@ solaris_evtchn_bind_virq(xc_evtchn *xce, return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind); } -int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port) -{ +static int solaris_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port) +{ + int fd = (int)h; struct ioctl_evtchn_unbind unbind; unbind.port = port; - return ioctl(xce->fd, IOCTL_EVTCHN_UNBIND, &unbind); + return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind); } evtchn_port_or_error_t @@ -287,6 +288,7 @@ static struct xc_osdep_ops solaris_evtch .bind_unbound_port = &solaris_evtchn_bind_unbound_port, .bind_interdomain = &solaris_evtchn_bind_interdomain, .bind_virq = &solaris_evtchn_bind_virq, + .unbind = &solaris_evtchn_unbind, }, }; diff -r a154ee7ddc9a -r 0ac7a4c596d1 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 @@ -83,6 +83,8 @@ struct xc_osdep_ops evtchn_port_or_error_t (*bind_interdomain)(xc_evtchn *xce, xc_osdep_handle h, int domid, evtchn_port_t remote_port); evtchn_port_or_error_t (*bind_virq)(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq); + + int (*unbind)(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port); } evtchn; } u; }; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |