From fbf57596bb1715ebd05bf81e026862a033d62a03 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Sun, 22 Jan 2017 22:19:21 +0100 Subject: msrtool: use a bit more clever cpuid vendor match MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not everything non-intel is AMD. Change-Id: I06d6fbaa0b4f2c9e61d9b3b4aeeb349a91aa090e Signed-off-by: Lubomir Rintel Reviewed-on: https://review.coreboot.org/18255 Reviewed-by: Kyösti Mälkki Tested-by: build bot (Jenkins) --- util/msrtool/msrtool.h | 4 ++-- util/msrtool/sys.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'util') diff --git a/util/msrtool/msrtool.h b/util/msrtool/msrtool.h index 1e923c4bfd..35559c2fb8 100644 --- a/util/msrtool/msrtool.h +++ b/util/msrtool/msrtool.h @@ -95,8 +95,8 @@ struct msrdef { #define MAX_CORES 8 typedef enum { - VENDOR_INTEL = 1, - VENDOR_AMD = 2, + VENDOR_INTEL = 0x756e6547, + VENDOR_AMD = 0x68747541, } vendor_t; struct cpuid_t { diff --git a/util/msrtool/sys.c b/util/msrtool/sys.c index 3e50f49a26..7ff1131b63 100644 --- a/util/msrtool/sys.c +++ b/util/msrtool/sys.c @@ -36,7 +36,7 @@ struct cpuid_t *cpuid(void) { asm ("cpuid" : "=b" (outebx) : "a" (0) : "%ecx", "%edx"); #endif - id.vendor = (outebx == 0x756e6547) ? VENDOR_INTEL : VENDOR_AMD; + id.vendor = outebx; /* Then, identificate CPU itself */ #if defined(__DARWIN__) && !defined(__LP64__) -- cgit v1.2.3