WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 14 of 25] libxc: osdep: convert xc_evtchn_unbind()

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 14 of 25] libxc: osdep: convert xc_evtchn_unbind()
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Fri, 03 Dec 2010 09:57:18 +0000
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Fri, 03 Dec 2010 02:23:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1291370224@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1291369007 0
# Node ID 03b9f81f1f367a2143e2ef48fd7f2a57b0c47643
# Parent  32767e7632ccac87a9b0b33ec8a2322a7938af68
libxc: osdep: convert xc_evtchn_unbind()

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 32767e7632cc -r 03b9f81f1f36 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 32767e7632cc -r 03b9f81f1f36 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 32767e7632cc -r 03b9f81f1f36 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 32767e7632cc -r 03b9f81f1f36 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 32767e7632cc -r 03b9f81f1f36 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 32767e7632cc -r 03b9f81f1f36 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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>