From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KivG5-0006rv-Mw for qemu-devel@nongnu.org; Thu, 25 Sep 2008 14:08:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KivG3-0006pr-RG for qemu-devel@nongnu.org; Thu, 25 Sep 2008 14:08:08 -0400 Received: from [199.232.76.173] (port=47655 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KivG3-0006pW-KA for qemu-devel@nongnu.org; Thu, 25 Sep 2008 14:08:07 -0400 Received: from savannah.gnu.org ([199.232.41.3]:56819 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KivG3-0007oB-Jd for qemu-devel@nongnu.org; Thu, 25 Sep 2008 14:08:07 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KivG2-0004w0-0x for qemu-devel@nongnu.org; Thu, 25 Sep 2008 18:08:06 +0000 Received: from balrog by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KivG1-0004vv-Qe for qemu-devel@nongnu.org; Thu, 25 Sep 2008 18:08:05 +0000 MIME-Version: 1.0 Errors-To: balrog Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Andrzej Zaborowski Message-Id: Date: Thu, 25 Sep 2008 18:08:05 +0000 Subject: [Qemu-devel] [5316] Clean up vendor identification (Alexander Graf). Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5316 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5316 Author: balrog Date: 2008-09-25 18:08:05 +0000 (Thu, 25 Sep 2008) Log Message: ----------- Clean up vendor identification (Alexander Graf). Right now CPU vendor identification contains a lot of magic numbers. The patch cleans them up to defines, so we can identify the CPU later on without copying magic numbers. Signed-off-by: Alexander Graf Modified Paths: -------------- trunk/target-i386/cpu.h trunk/target-i386/helper.c Modified: trunk/target-i386/cpu.h =================================================================== --- trunk/target-i386/cpu.h 2008-09-25 18:01:46 UTC (rev 5315) +++ trunk/target-i386/cpu.h 2008-09-25 18:08:05 UTC (rev 5316) @@ -333,6 +333,14 @@ #define CPUID_EXT3_IBS (1 << 10) #define CPUID_EXT3_SKINIT (1 << 12) +#define CPUID_VENDOR_INTEL_1 0x756e6547 /* "Genu" */ +#define CPUID_VENDOR_INTEL_2 0x49656e69 /* "ineI" */ +#define CPUID_VENDOR_INTEL_3 0x6c65746e /* "ntel" */ + +#define CPUID_VENDOR_AMD_1 0x68747541 /* "Auth" */ +#define CPUID_VENDOR_AMD_2 0x69746e65 /* "enti" */ +#define CPUID_VENDOR_AMD_3 0x444d4163 /* "cAMD" */ + #define EXCP00_DIVZ 0 #define EXCP01_SSTP 1 #define EXCP02_NMI 2 Modified: trunk/target-i386/helper.c =================================================================== --- trunk/target-i386/helper.c 2008-09-25 18:01:46 UTC (rev 5315) +++ trunk/target-i386/helper.c 2008-09-25 18:08:05 UTC (rev 5316) @@ -146,9 +146,9 @@ { .name = "qemu64", .level = 2, - .vendor1 = 0x68747541, /* "Auth" */ - .vendor2 = 0x69746e65, /* "enti" */ - .vendor3 = 0x444d4163, /* "cAMD" */ + .vendor1 = CPUID_VENDOR_AMD_1, + .vendor2 = CPUID_VENDOR_AMD_2, + .vendor3 = CPUID_VENDOR_AMD_3, .family = 6, .model = 2, .stepping = 3, @@ -347,9 +347,9 @@ env->cpuid_vendor2 = def->vendor2; env->cpuid_vendor3 = def->vendor3; } else { - env->cpuid_vendor1 = 0x756e6547; /* "Genu" */ - env->cpuid_vendor2 = 0x49656e69; /* "ineI" */ - env->cpuid_vendor3 = 0x6c65746e; /* "ntel" */ + env->cpuid_vendor1 = CPUID_VENDOR_INTEL_1; + env->cpuid_vendor2 = CPUID_VENDOR_INTEL_2; + env->cpuid_vendor3 = CPUID_VENDOR_INTEL_3; } env->cpuid_level = def->level; env->cpuid_version = (def->family << 8) | (def->model << 4) | def->stepping;