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 08 of 25] libxc: osdep: convert xc_map_foreign_ranges

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

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

diff -r 1c7141772937 -r c4d555d68b74 tools/libxc/xc_foreign_memory.c
--- a/tools/libxc/xc_foreign_memory.c   Fri Dec 03 09:36:47 2010 +0000
+++ b/tools/libxc/xc_foreign_memory.c   Fri Dec 03 09:36:47 2010 +0000
@@ -27,6 +27,14 @@ void *xc_map_foreign_range(xc_interface 
                                                  dom, size, prot, mfn);
 }
 
+void *xc_map_foreign_ranges(xc_interface *xch, uint32_t dom,
+                            size_t size, int prot, size_t chunksize,
+                            privcmd_mmap_entry_t entries[], int nentries)
+{
+    return xch->ops->u.privcmd.map_foreign_ranges(xch, xch->ops_handle,
+                                                  dom, size, prot, chunksize, 
entries, nentries);
+}
+
 void *xc_map_foreign_batch(xc_interface *xch, uint32_t dom, int prot,
                            xen_pfn_t *arr, int num)
 {
diff -r 1c7141772937 -r c4d555d68b74 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
@@ -303,9 +303,10 @@ static void *linux_privcmd_map_foreign_r
     return ret;
 }
 
-void *xc_map_foreign_ranges(xc_interface *xch, uint32_t dom, size_t size, int 
prot,
-                            size_t chunksize, privcmd_mmap_entry_t entries[],
-                            int nentries)
+static void *linux_privcmd_map_foreign_ranges(xc_interface *xch, 
xc_osdep_handle h,
+                                              uint32_t dom, size_t size, int 
prot,
+                                              size_t chunksize, 
privcmd_mmap_entry_t entries[],
+                                              int nentries)
 {
     xen_pfn_t *arr;
     int num_per_entry;
@@ -337,6 +338,7 @@ static struct xc_osdep_ops linux_privcmd
         .map_foreign_batch = &linux_privcmd_map_foreign_batch,
         .map_foreign_bulk = &linux_privcmd_map_foreign_bulk,
         .map_foreign_range = &linux_privcmd_map_foreign_range,
+        .map_foreign_ranges = &linux_privcmd_map_foreign_ranges,
     },
 };
 
diff -r 1c7141772937 -r c4d555d68b74 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
@@ -152,9 +152,10 @@ static void *minios_privcmd_map_foreign_
     return map_frames_ex(&mfn, size / getpagesize(), 0, 1, 1, dom, NULL, 
pt_prot);
 }
 
-void *xc_map_foreign_ranges(xc_interface *xch, uint32_t dom,
-                            size_t size, int prot, size_t chunksize,
-                            privcmd_mmap_entry_t entries[], int nentries)
+static void *minios_privcmd_map_foreign_ranges(xc_interface *xch, 
xc_osdep_handle h,
+                                               uint32_t dom,
+                                               size_t size, int prot, size_t 
chunksize,
+                                               privcmd_mmap_entry_t entries[], 
int nentries)
 {
     unsigned long *mfns;
     int i, j, n;
@@ -192,6 +193,7 @@ static struct xc_osdep_ops minios_privcm
         .map_foreign_batch = &minios_privcmd_map_foreign_batch,
         .map_foreign_bulk = &minios_privcmd_map_foreign_bulk,
         .map_foreign_range = &minios_privcmd_map_foreign_range,
+        .map_foreign_ranges = &minios_privcmd_map_foreign_ranges,
     },
 };
 
diff -r 1c7141772937 -r c4d555d68b74 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
@@ -140,10 +140,12 @@ static void *netbsd_privcmd_map_foreign_
     return addr;
 }
 
-void *xc_map_foreign_ranges(xc_interface *xch, uint32_t dom,
-                            size_t size, int prot, size_t chunksize,
-                            privcmd_mmap_entry_t entries[], int nentries)
+static void *netbsd_privcmd_map_foreign_ranges(xc_interface *xch, 
xc_osdep_handle h,
+                                               uint32_t dom,
+                                               size_t size, int prot, size_t 
chunksize,
+                                               privcmd_mmap_entry_t entries[], 
int nentries)
 {
+    int fd = (int)h;
        privcmd_mmap_t ioctlx;
        int i, rc;
        void *addr;
@@ -161,7 +163,7 @@ void *xc_map_foreign_ranges(xc_interface
        ioctlx.dom   = dom;
        ioctlx.entry = entries;
 
-       rc = ioctl(xch->fd, IOCTL_PRIVCMD_MMAP, &ioctlx);
+       rc = ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx);
        if (rc)
                goto ioctl_failed;
 
@@ -186,6 +188,7 @@ static struct xc_osdep_ops netbsd_privcm
         .map_foreign_batch = &netbsd_privcmd_map_foreign_batch,
         .map_foreign_bulk = &xc_map_foreign_bulk_compat,
         .map_foreign_range = &netbsd_privcmd_map_foreign_range,
+        .map_foreign_ranges = &netbsd_privcmd_map_foreign_ranges,
     },
 };
 
diff -r 1c7141772937 -r c4d555d68b74 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
@@ -130,15 +130,17 @@ static void *xc_map_foreign_range(xc_int
     return addr;
 }
 
-void *xc_map_foreign_ranges(xc_interface *xch, uint32_t dom,
-                            size_t size, int prot, size_t chunksize,
-                            privcmd_mmap_entry_t entries[], int nentries)
+static void *solaric_privcmd_map_foreign_ranges(xc_interface *xch, 
xc_osdep_handle h,
+                                                uint32_t dom,
+                                                size_t size, int prot, size_t 
chunksize,
+                                                privcmd_mmap_entry_t 
entries[], int nentries)
 {
+    int fd = (int)fd;
     privcmd_mmap_t ioctlx;
     int i, rc;
     void *addr;
 
-    addr = mmap(NULL, size, prot, MAP_SHARED, xch->fd, 0);
+    addr = mmap(NULL, size, prot, MAP_SHARED, fd, 0);
     if (addr == MAP_FAILED)
         goto mmap_failed;
 
@@ -151,7 +153,7 @@ void *xc_map_foreign_ranges(xc_interface
     ioctlx.dom   = dom;
     ioctlx.entry = entries;
 
-    rc = ioctl(xch->fd, IOCTL_PRIVCMD_MMAP, &ioctlx);
+    rc = ioctl(fd, IOCTL_PRIVCMD_MMAP, &ioctlx);
     if (rc)
         goto ioctl_failed;
 
@@ -176,6 +178,7 @@ static struct xc_osdep_ops solaris_privc
         .map_foreign_batch = &solaris_privcmd_map_foreign_batch,
         .map_foreign_bulk = &xc_map_foreign_bulk_compat,
         .map_foreign_range = &solaris_privcmd_map_foreign_range,
+        .map_foreign_ranges = &solaris_privcmd_map_foreign_ranges,
     },
 };
 
diff -r 1c7141772937 -r c4d555d68b74 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
@@ -70,6 +70,9 @@ struct xc_osdep_ops
                                       const xen_pfn_t *arr, int *err, unsigned 
int num);
             void *(*map_foreign_range)(xc_interface *xch, xc_osdep_handle h, 
uint32_t dom, int size, int prot,
                                        unsigned long mfn);
+            void *(*map_foreign_ranges)(xc_interface *xch, xc_osdep_handle h, 
uint32_t dom, size_t size, int prot,
+                                        size_t chunksize, privcmd_mmap_entry_t 
entries[],
+                                        int nentries);
         } privcmd;
     } u;
 };

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

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