]> xenbits.xensource.com Git - xen.git/commitdiff
xen: arm: implement domain_page_map_to_mfn
authorIan Campbell <ian.campbell@citrix.com>
Mon, 28 Jan 2013 16:48:20 +0000 (16:48 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 28 Jan 2013 16:48:20 +0000 (16:48 +0000)
This was recently (re?)introduced on x86 in 26447:f831d8dcf18f and is
now used in generic code (specifically tmem in 26454:38847c15d8cd).

This fixes the build on ARM.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/mm.c

index 9c5c33448a2a54e81b94014096b1da6276a5785f..7621d1ba0fec54419f7c75bf2a29b86f8567676b 100644 (file)
@@ -208,6 +208,18 @@ void unmap_domain_page(const void *va)
     local_irq_restore(flags);
 }
 
+unsigned long domain_page_map_to_mfn(const void *va)
+{
+    lpae_t *map = xen_second + second_linear_offset(DOMHEAP_VIRT_START);
+    int slot = ((unsigned long) va - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
+    unsigned long offset = ((unsigned long)va>>THIRD_SHIFT) & LPAE_ENTRY_MASK;
+
+    ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
+    ASSERT(map[slot].pt.avail != 0);
+
+    return map[slot].pt.base + offset;
+}
+
 void __init arch_init_memory(void)
 {
     /*