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

[Xen-changelog] [xen-unstable] [XEN] add typed p2m entry-setting function



# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1189759967 -3600
# Node ID a79d2c0436439bda200860b363a7154b3eafbc1e
# Parent  ca495837a7223259ecbdc9f8b1ab69d08ed11002
[XEN] add typed p2m entry-setting function
keeping the old one as a fallback for RAM mappings.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm/p2m.c     |    7 +++----
 xen/include/asm-x86/p2m.h |   11 +++++++++--
 2 files changed, 12 insertions(+), 6 deletions(-)

diff -r ca495837a722 -r a79d2c043643 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Wed Sep 12 15:42:39 2007 +0100
+++ b/xen/arch/x86/mm/p2m.c     Fri Sep 14 09:52:47 2007 +0100
@@ -679,8 +679,8 @@ guest_physmap_remove_page(struct domain 
 }
 
 void
-guest_physmap_add_page(struct domain *d, unsigned long gfn,
-                       unsigned long mfn)
+guest_physmap_add_entry(struct domain *d, unsigned long gfn,
+                        unsigned long mfn, p2m_type_t t)
 {
     unsigned long ogfn;
     p2m_type_t ot;
@@ -727,8 +727,7 @@ guest_physmap_add_page(struct domain *d,
 
     if ( mfn_valid(_mfn(mfn)) ) 
     {
-        set_p2m_entry(d, gfn, _mfn(mfn),
-                  p2m_type_to_flags(p2m_ram_rw)|__PAGE_HYPERVISOR|_PAGE_USER);
+        set_p2m_entry(d, gfn, _mfn(mfn), p2m_type_to_flags(t));
         set_gpfn_from_mfn(mfn, gfn);
     }
     else
diff -r ca495837a722 -r a79d2c043643 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h Wed Sep 12 15:42:39 2007 +0100
+++ b/xen/include/asm-x86/p2m.h Fri Sep 14 09:52:47 2007 +0100
@@ -201,8 +201,15 @@ void p2m_teardown(struct domain *d);
 void p2m_teardown(struct domain *d);
 
 /* Add a page to a domain's p2m table */
-void guest_physmap_add_page(struct domain *d, unsigned long gfn,
-                            unsigned long mfn);
+void guest_physmap_add_entry(struct domain *d, unsigned long gfn,
+                             unsigned long mfn, p2m_type_t t);
+
+/* Untyped version for RAM only, for compatibility */
+static inline void guest_physmap_add_page(struct domain *d, unsigned long gfn,
+                                          unsigned long mfn)
+{
+    guest_physmap_add_entry(d, gfn, mfn, p2m_ram_rw);
+}
 
 /* Remove a page from a domain's p2m table */
 void guest_physmap_remove_page(struct domain *d, unsigned long gfn,

_______________________________________________
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®.