cpu: Fix PowerPCNodeData

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.
This commit is contained in:
Jiri Denemark 2012-12-18 23:42:34 +01:00
parent 6af5a06275
commit 70349cb90d

View 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,