]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu: Fix PowerPCNodeData
authorJiri Denemark <jdenemar@redhat.com>
Tue, 18 Dec 2012 22:42:34 +0000 (23:42 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 19 Apr 2013 12:33:16 +0000 (14:33 +0200)
Make getting node CPU data for PowerPC unsupported on other
architectures. The function is also renamed as ppcNodeData to match
other functions in PowerPC CPU driver.

src/cpu/cpu_powerpc.c

index ea4f9caa1ec6a19fb6242360592bae55c9882d71..64e6ec8a7b30934310972cfa8fa7775a6b4471c7 100644 (file)
@@ -525,16 +525,6 @@ out:
     return ret;
 }
 
-#if defined(__powerpc__) || \
-    defined(__powerpc64__)
-static uint32_t ppc_mfpvr(void)
-{
-    uint32_t pvr;
-    asm("mfpvr %0"
-        : "=r"(pvr));
-    return pvr;
-}
-#endif
 
 static void
 PowerPCDataFree(union cpuData *data)
@@ -545,8 +535,9 @@ PowerPCDataFree(union cpuData *data)
     VIR_FREE(data);
 }
 
+#if defined(__powerpc__) || defined(__powerpc64__)
 static union cpuData *
-PowerPCNodeData(void)
+ppcNodeData(void)
 {
     union cpuData *data;
 
@@ -555,13 +546,12 @@ PowerPCNodeData(void)
         return NULL;
     }
 
-#if defined(__powerpc__) || \
-    defined(__powerpc64__)
-    data->ppc.pvr = ppc_mfpvr();
-#endif
+    asm("mfpvr %0"
+        : "=r" (data->ppc.pvr));
 
     return data;
 }
+#endif
 
 static int
 PowerPCUpdate(virCPUDefPtr guest ATTRIBUTE_UNUSED,
@@ -634,7 +624,11 @@ struct cpuArchDriver cpuDriverPowerPC = {
     .decode     = PowerPCDecode,
     .encode     = NULL,
     .free       = PowerPCDataFree,
-    .nodeData   = PowerPCNodeData,
+#if defined(__powerpc__) || defined(__powerpc64__)
+    .nodeData   = ppcNodeData,
+#else
+    .nodeData   = NULL,
+#endif
     .guestData  = NULL,
     .baseline   = PowerPCBaseline,
     .update     = PowerPCUpdate,