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-changelog

[Xen-changelog] [xen-unstable] pv-grub: re-implement xc_map_foreign_rang

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] pv-grub: re-implement xc_map_foreign_ranges
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 24 Jul 2008 13:50:09 -0700
Delivery-date: Thu, 24 Jul 2008 13:49:59 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1216905045 -3600
# Node ID 6604234057f63449cfd53f06c2e81f5977756b9e
# Parent  e9f24be7a515fd67c55febf3c8ca72f4bd57ea95
pv-grub: re-implement xc_map_foreign_ranges

Also get rid of va and npages members of privcmd_mmap_entry since we
do not need them any more.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
---
 tools/include/xen-sys/MiniOS/privcmd.h |    2 -
 tools/libxc/xc_minios.c                |   35 +++++++++++++++++----------------
 2 files changed, 19 insertions(+), 18 deletions(-)

diff -r e9f24be7a515 -r 6604234057f6 tools/include/xen-sys/MiniOS/privcmd.h
--- a/tools/include/xen-sys/MiniOS/privcmd.h    Thu Jul 24 13:44:08 2008 +0100
+++ b/tools/include/xen-sys/MiniOS/privcmd.h    Thu Jul 24 14:10:45 2008 +0100
@@ -10,9 +10,7 @@ typedef struct privcmd_hypercall
 } privcmd_hypercall_t;
 
 typedef struct privcmd_mmap_entry {
-       u64 va;
        u64 mfn;
-       u64 npages;
 } privcmd_mmap_entry_t; 
 
 #endif /* __MINIOS_PUBLIC_PRIVCMD_H__ */
diff -r e9f24be7a515 -r 6604234057f6 tools/libxc/xc_minios.c
--- a/tools/libxc/xc_minios.c   Thu Jul 24 13:44:08 2008 +0100
+++ b/tools/libxc/xc_minios.c   Thu Jul 24 14:10:45 2008 +0100
@@ -80,23 +80,26 @@ void *xc_map_foreign_ranges(int xc_handl
                             size_t size, int prot, size_t chunksize,
                             privcmd_mmap_entry_t entries[], int nentries)
 {
-    ERROR("%s: implement me\n");
-    return NULL;
-}
-
-
-#if 0
-int xc_map_foreign_ranges(int xc_handle, uint32_t dom,
-                          privcmd_mmap_entry_t *entries, int nr)
-{
-    int i;
-    for (i = 0; i < nr; i++) {
-       unsigned long mfn = entries[i].mfn;
-        do_map_frames(entries[i].va, &mfn, entries[i].npages, 0, 1, dom, 0, 
L1_PROT);
-    }
-    return 0;
-}
+    unsigned long mfns[size / PAGE_SIZE];
+    int i, j, n;
+    unsigned long pt_prot = 0;
+#ifdef __ia64__
+    /* TODO */
+#else
+    if (prot & PROT_READ)
+       pt_prot = L1_PROT_RO;
+    if (prot & PROT_WRITE)
+       pt_prot = L1_PROT;
 #endif
+
+    n = 0;
+    for (i = 0; i < nentries; i++)
+        for (j = 0; j < chunksize / PAGE_SIZE; j++)
+            mfns[n++] = entries[i].mfn + j;
+
+    return map_frames_ex(mfns, n, 1, 0, 1, dom, 0, pt_prot);
+}
+
 
 int do_xen_hypercall(int xc_handle, privcmd_hypercall_t *hypercall)
 {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] pv-grub: re-implement xc_map_foreign_ranges, Xen patchbot-unstable <=