[PATCH 1/1] cpu: msr: disabled test for non-Intel/AMD architectures

Colin King colin.king at canonical.com
Mon Dec 5 18:20:29 UTC 2011


From: Colin Ian King <colin.king at canonical.com>

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/cpu/msr/msr.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/cpu/msr/msr.c b/src/cpu/msr/msr.c
index d2c16a8..06a756f 100644
--- a/src/cpu/msr/msr.c
+++ b/src/cpu/msr/msr.c
@@ -19,6 +19,8 @@
 
 #include "fwts.h"
 
+#ifdef FWTS_ARCH_INTEL
+
 typedef void (*msr_callback_check)(fwts_framework *fw, uint64_t val);
 
 static int ncpus;
@@ -32,6 +34,10 @@ static int msr_init(fwts_framework *fw)
 		fwts_log_error(fw, "Cannot get CPU info");
 		return FWTS_ERROR;
 	}
+	if (cpuinfo->vendor_id == NULL) {
+		fwts_log_error(fw, "Cannot get CPU vendor_id");
+		return FWTS_ERROR;
+	}
 	intel_cpu = strstr(cpuinfo->vendor_id, "Intel") != NULL;
 	amd_cpu = strstr(cpuinfo->vendor_id, "AuthenticAMD") != NULL;
 
@@ -555,3 +561,5 @@ static fwts_framework_ops msr_ops = {
 };
 
 FWTS_REGISTER(msr, &msr_ops, FWTS_TEST_ANYTIME, FWTS_BATCH | FWTS_ROOT_PRIV);
+
+#endif
-- 
1.7.7.3





More information about the fwts-devel mailing list