[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxc: osdep: convert xc_evtchn_bind_virq()



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1291369007 0
# Node ID a154ee7ddc9a420d7175fd7a92adfb4e4c495da9
# Parent  c40b8c5b1c45abf197a6b922149879dd5262c363
libxc: osdep: convert xc_evtchn_bind_virq()

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 |    1 +
 6 files changed, 33 insertions(+), 18 deletions(-)

diff -r c40b8c5b1c45 -r a154ee7ddc9a 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
@@ -101,6 +101,12 @@ xc_evtchn_bind_interdomain(xc_evtchn *xc
     return xce->ops->u.evtchn.bind_interdomain(xce, xce->ops_handle, domid, 
remote_port);
 }
 
+evtchn_port_or_error_t
+xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
+{
+    return xce->ops->u.evtchn.bind_virq(xce, xce->ops_handle, virq);
+}
+
 /*
  * Local variables:
  * mode: C
diff -r c40b8c5b1c45 -r a154ee7ddc9a 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
@@ -399,14 +399,15 @@ linux_evtchn_bind_interdomain(xc_evtchn 
     return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
 }
 
-evtchn_port_or_error_t
-xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
+static evtchn_port_or_error_t
+linux_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+{
+    int fd = (int)h;
     struct ioctl_evtchn_bind_virq bind;
 
     bind.virq = virq;
 
-    return ioctl(xce->fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+    return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
 }
 
 int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
@@ -443,6 +444,7 @@ static struct xc_osdep_ops linux_evtchn_
         .notify = &linux_evtchn_notify,
         .bind_unbound_port = &linux_evtchn_bind_unbound_port,
         .bind_interdomain = &linux_evtchn_bind_interdomain,
+        .bind_virq = &linux_evtchn_bind_virq,
     },
 };
 
diff -r c40b8c5b1c45 -r a154ee7ddc9a 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
@@ -346,25 +346,26 @@ int xc_evtchn_unbind(xc_evtchn *xce, evt
     return 0;
 }
 
-evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
+static evtchn_port_or_error_t minios_evtchn_bind_virq(xc_evtchn *xce, 
xc_osdep_handle h, unsigned int virq)
+{
+    int fd = (int)h;
     evtchn_port_t port;
     int i;
 
     assert(get_current() == main_thread);
-    i = port_alloc(xce->fd);
+    i = port_alloc(fd);
     if (i == -1)
        return -1;
 
     printf("xc_evtchn_bind_virq(%d)", virq);
-    port = bind_virq(virq, evtchn_handler, (void*)(intptr_t)xce->fd);
+    port = bind_virq(virq, evtchn_handler, (void*)(intptr_t)fd);
 
     if (port < 0) {
        errno = -port;
        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;
 }
@@ -408,6 +409,7 @@ static struct xc_osdep_ops minios_evtchn
         .notify = &minios_evtchn_notify,
         .bind_unbound_port = &minios_evtchn_bind_unbound_port,
         .bind_interdomain = &minios_evtchn_bind_interdomain,
+        .bind_virq = &minios_evtchn_bind_virq,
     },
 };
 
diff -r c40b8c5b1c45 -r a154ee7ddc9a 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
@@ -268,15 +268,16 @@ int xc_evtchn_unbind(xc_evtchn *xce, evt
     return ioctl(xce->fd, IOCTL_EVTCHN_UNBIND, &unbind);
 }
 
-evtchn_port_or_error_t
-xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
+static evtchn_port_or_error_t
+netbsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+{
+    int fd = (int)h;
     struct ioctl_evtchn_bind_virq bind;
     int err;
 
     bind.virq = virq;
 
-    err = ioctl(xce->fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+    err = ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
     if (err)
        return -1;
     else
@@ -308,6 +309,7 @@ static struct xc_osdep_ops netbsd_evtchn
          .notify = &netbsd_evtchn_notify,
          .bind_unbound_port = &netbsd_evtchn_bind_unbound_port,
          .bind_interdomain = &netbsd_evtchn_bind_interdomain,
+         .bind_virq = &netbsd_evtchn_bind_virq,
     },
 };
 
diff -r c40b8c5b1c45 -r a154ee7ddc9a 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
@@ -241,14 +241,15 @@ solaris_evtchn_bind_interdomain(xc_evtch
     return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
 }
 
-evtchn_port_or_error_t
-xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
-{
+static evtchn_port_or_error_t
+solaris_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+{
+    int fd = (int)h;
     struct ioctl_evtchn_bind_virq bind;
 
     bind.virq = virq;
 
-    return ioctl(xce->fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+    return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
 }
 
 int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
@@ -285,6 +286,7 @@ static struct xc_osdep_ops solaris_evtch
         .notify = &solaris_evtchn_notify,
         .bind_unbound_port = &solaris_evtchn_bind_unbound_port,
         .bind_interdomain = &solaris_evtchn_bind_interdomain,
+        .bind_virq = &solaris_evtchn_bind_virq,
     },
 };
 
diff -r c40b8c5b1c45 -r a154ee7ddc9a 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
@@ -82,6 +82,7 @@ struct xc_osdep_ops
             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_port_or_error_t (*bind_virq)(xc_evtchn *xce, 
xc_osdep_handle h, unsigned int virq);
         } evtchn;
     } u;
 };

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.