]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
Provide non-PV compatability for mfn related functions
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 8 Aug 2017 14:51:01 +0000 (15:51 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 9 Aug 2017 15:37:25 +0000 (16:37 +0100)
Similar to non-paged compatability.  This allows for extra #ifdef'ary removal
from setup.c

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/include/arch/mm.h
arch/x86/setup.c

index 1f4ceb232d31d59ecf0e9916653ca5fb985d75c4..a17183ef098a2b1e3f4a46b3c1d672ff786c7fd2 100644 (file)
@@ -72,6 +72,14 @@ static inline unsigned long virt_to_mfn(const void *va)
 
 #undef m2p
 
+#else /* CONFIG_PV */
+
+/* Enough compatibility to compile in HVM environments. */
+extern void *mfn_to_virt(unsigned long mfn);
+extern void *maddr_to_virt(uint64_t maddr);
+extern unsigned long pfn_to_mfn(unsigned long pfn);
+extern unsigned long virt_to_mfn(const void *va);
+
 #endif /* CONFIG_PV */
 
 static inline void *gfn_to_virt(unsigned long gfn)
index be8e5c31a40a8d651b896aedb7601c8417e8efc8..ab1d060634514e47a467d72d2074ee295b68f113 100644 (file)
@@ -152,10 +152,12 @@ static void setup_pv_console(void)
     xencons_interface_t *cons_ring;
     evtchn_port_t cons_evtchn;
 
-#if defined(CONFIG_PV)
-    cons_ring = mfn_to_virt(start_info->console.domU.mfn);
-    cons_evtchn = start_info->console.domU.evtchn;
-#elif defined(CONFIG_HVM)
+    if ( IS_DEFINED(CONFIG_PV) )
+    {
+        cons_ring = mfn_to_virt(start_info->console.domU.mfn);
+        cons_evtchn = start_info->console.domU.evtchn;
+    }
+    else /* HVM */
     {
         uint64_t raw_pfn, raw_evtchn;
 
@@ -166,7 +168,6 @@ static void setup_pv_console(void)
         cons_ring = pfn_to_virt(raw_pfn);
         cons_evtchn = raw_evtchn;
     }
-#endif
 
     init_pv_console(cons_ring, cons_evtchn);
 }