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

[Minios-devel] [PATCH v2 46/47] arm: add mapping for GNT table



Implement the map_frames(), and use it for the GNT table mapping.

Signed-off-by: Huang Shijie <shijie.huang@xxxxxxx>
---
 arch/arm/mm.c         | 12 +++++++++++-
 include/arm/arch_mm.h |  3 +--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mm.c b/arch/arm/mm.c
index f998a53..e394579 100644
--- a/arch/arm/mm.c
+++ b/arch/arm/mm.c
@@ -352,6 +352,11 @@ void *map_frames_ex(const unsigned long *f, unsigned long 
n, unsigned long strid
     return (void *)addr;
 }
 
+void *map_frames(unsigned long *frames, unsigned long pfn_num)
+{
+    return map_frames_ex(frames, pfn_num, 1, 0, 1, DOMID_SELF, NULL, 
MEM_DEF_ATTR);
+}
+
 static lpae_t *get_ptep(unsigned long vaddr)
 {
     lpae_t *pgd, *pud, *pmd, *pte;
@@ -403,6 +408,11 @@ unsigned long map_frame_virt(unsigned long mfn)
 {
     return mfn_to_virt(mfn);
 }
+
+void *map_frames(unsigned long *frames, unsigned long pfn_num)
+{
+    return pfn_to_virt(frames[0]);
+}
 #endif
 
 void arch_init_mm(unsigned long *start_pfn_p, unsigned long *max_pfn_p)
@@ -543,5 +553,5 @@ grant_entry_v1_t *arch_init_gnttab(int nr_grant_frames)
         BUG();
     }
 
-    return to_virt(gnttab_table);
+    return map_frames(frames, nr_grant_frames);
 }
diff --git a/include/arm/arch_mm.h b/include/arm/arch_mm.h
index 0765ba2..aa8695f 100644
--- a/include/arm/arch_mm.h
+++ b/include/arm/arch_mm.h
@@ -64,8 +64,7 @@ extern paddr_t physical_address_offset;
 #define virtual_to_mfn(_virt)     virt_to_mfn(_virt)
 
 void arch_mm_preinit(void *dtb_pointer);
-// FIXME
-#define map_frames(f, n) (NULL)
+void *map_frames(unsigned long *frames, unsigned long pfn_num);
 
 void *ioremap(paddr_t addr, unsigned long size);
 
-- 
2.7.4


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.