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 09 of 25] libxc: osdep: convert xc_evtchn_fd()

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 09 of 25] libxc: osdep: convert xc_evtchn_fd()
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Fri, 03 Dec 2010 09:57:13 +0000
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Fri, 03 Dec 2010 02:08:03 -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 48c16f1810aa383774b6c0e373d24838c7affffc
# Parent  c4d555d68b742405874662bbc57bfe98a9e250dd
libxc: osdep: convert xc_evtchn_fd()

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

diff -r c4d555d68b74 -r 48c16f1810aa 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
@@ -77,3 +77,8 @@ int xc_evtchn_status(xc_interface *xch, 
     return do_evtchn_op(xch, EVTCHNOP_status, status,
                         sizeof(*status), 1);
 }
+
+int xc_evtchn_fd(xc_evtchn *xce)
+{
+    return xce->ops->u.evtchn.fd(xce, xce->ops_handle);
+}
diff -r c4d555d68b74 -r 48c16f1810aa 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
@@ -360,9 +360,9 @@ static int linux_evtchn_close(xc_evtchn 
     return close(fd);
 }
 
-int xc_evtchn_fd(xc_evtchn *xce)
+static int linux_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
 {
-    return xce->fd;
+    return (int)h;
 }
 
 int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
@@ -434,6 +434,10 @@ static struct xc_osdep_ops linux_evtchn_
 static struct xc_osdep_ops linux_evtchn_ops = {
     .open = &linux_evtchn_open,
     .close = &linux_evtchn_close,
+
+    .u.evtchn = {
+        .fd = &linux_evtchn_fd,
+    },
 };
 
 /* Optionally flush file to disk and discard page cache */
diff -r c4d555d68b74 -r 48c16f1810aa 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
@@ -226,9 +226,9 @@ void minios_evtchn_close_fd(int fd)
     files[fd].type = FTYPE_NONE;
 }
 
-int xc_evtchn_fd(xc_evtchn *xce)
+static int minios_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
 {
-    return xce->fd;
+    return (int)h;
 }
 
 int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
@@ -400,6 +400,10 @@ static struct xc_osdep_ops minios_evtchn
 static struct xc_osdep_ops minios_evtchn_ops = {
     .open = &minios_evtchn_open,
     .close = &minios_evtchn_close,
+
+    .u.evtchn = {
+        .fd = &minios_evtchn_fd,
+    },
 };
 
 /* Optionally flush file to disk and discard page cache */
diff -r c4d555d68b74 -r 48c16f1810aa 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
@@ -210,9 +210,9 @@ static int netbsd_evtchn_close(xc_evtchn
     return close(fd);
 }
 
-int xc_evtchn_fd(xc_evtchn *xce)
+static int netbsd_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
 {
-    return xce->fd;
+    return (int)h;
 }
 
 int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
@@ -299,6 +299,10 @@ static struct xc_osdep_ops netbsd_evtchn
 static struct xc_osdep_ops netbsd_evtchn_ops = {
     .open = &netbsd_evtchn_open,
     .close = &netbsd_evtchn_close,
+
+    .u.evtchn = {
+        .fd = &netbsd_evtchn_fd,
+    },
 };
 
 /* Optionally flush file to disk and discard page cache */
diff -r c4d555d68b74 -r 48c16f1810aa 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
@@ -202,9 +202,9 @@ static int solaris_evtchn_close(xc_evtch
     return close(fd);
 }
 
-int xc_evtchn_fd(xc_evtchn *xce)
+static int solaris_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
 {
-    return xce->fd;
+    return (int)h;
 }
 
 int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
@@ -276,6 +276,10 @@ static struct xc_osdep_ops solaris_evtch
 static struct xc_osdep_ops solaris_evtchn_ops = {
     .open = &solaris_evtchn_open,
     .close = &solaris_evtchn_close,
+
+    .u.evtchn = {
+        .fd = &solaris_evtchn_fd,
+    },
 };
 
 /* Optionally flush file to disk and discard page cache */
diff -r c4d555d68b74 -r 48c16f1810aa 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
@@ -74,6 +74,9 @@ struct xc_osdep_ops
                                         size_t chunksize, privcmd_mmap_entry_t 
entries[],
                                         int nentries);
         } privcmd;
+        struct {
+            int (*fd)(xc_evtchn *xce, xc_osdep_handle h);
+        } evtchn;
     } u;
 };
 typedef struct xc_osdep_ops xc_osdep_ops;

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

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