Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mls3x-0004c6-5o for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:24:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mls3r-0004Wq-UK for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:24:20 -0400 Received: from [199.232.76.173] (port=40029 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mls3r-0004W7-AQ for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:24:15 -0400 Received: from tx2ehsobe003.messaging.microsoft.com ([65.55.88.13]:48022 helo=TX2EHSOBE005.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1Mls3q-0001JQ-Rz for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:24:15 -0400 Received: from mail109-tx2 (localhost.localdomain [127.0.0.1]) by mail109-tx2-R.bigfish.com (Postfix) with ESMTP id D6F55CE84C7 for ; Thu, 10 Sep 2009 22:24:11 +0000 (UTC) Received: from ausb3extmailp02.amd.com (ausb3extmailp02.amd.com [163.181.251.22]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail109-tx2.bigfish.com (Postfix) with ESMTP id 2B701179005A for ; Thu, 10 Sep 2009 22:24:10 +0000 (UTC) Received: from ausb3twp02.amd.com ([163.181.250.38]) by ausb3extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n8AMO5V1021743 for ; Thu, 10 Sep 2009 17:24:08 -0500 Received: from sausexbh2.amd.com (SAUSEXBH2.amd.com [163.181.22.102]) by ausb3twp02.amd.com (Tumbleweed MailGate 3.7.0) with ESMTP id 25F97C850E for ; Thu, 10 Sep 2009 17:24:03 -0500 (CDT) From: Andre Przywara Date: Fri, 11 Sep 2009 00:20:48 +0200 Message-ID: <1252621257-26364-4-git-send-email-andre.przywara@amd.com> In-Reply-To: <1252621257-26364-1-git-send-email-andre.przywara@amd.com> References: <1252621257-26364-1-git-send-email-andre.przywara@amd.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 03/12] cpuid: replace magic number with named constant List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Andre Przywara CPUID leaf Fn8000_0001.EDX contains a copy of many Fn0000_0001.EDX bits. Define a name for the mask to improve readability and avoid typos. Signed-off-by: Andre Przywara --- target-i386/cpuid.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index b610834..9ed9fb2 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -115,6 +115,8 @@ typedef struct x86_def_t { CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_PGE | CPUID_CMOV | \ CPUID_PAT | CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | \ CPUID_PAE | CPUID_SEP | CPUID_APIC) +#define EXT2_FEATURE_MASK 0x0183F3FF + static x86_def_t x86_defs[] = { #ifdef TARGET_X86_64 { @@ -132,7 +134,7 @@ static x86_def_t x86_defs[] = { /* this feature is needed for Solaris and isn't fully implemented */ CPUID_PSE36, .ext_features = CPUID_EXT_SSE3, - .ext2_features = (PPRO_FEATURES & 0x0183F3FF) | + .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) | CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX, .ext3_features = CPUID_EXT3_SVM, .xlevel = 0x8000000A, @@ -154,7 +156,7 @@ static x86_def_t x86_defs[] = { /* Missing: CPUID_EXT_CX16, CPUID_EXT_POPCNT */ .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR, /* Missing: CPUID_EXT2_PDPE1GB, CPUID_EXT2_RDTSCP */ - .ext2_features = (PPRO_FEATURES & 0x0183F3FF) | + .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) | CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX | CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT | CPUID_EXT2_MMXEXT | CPUID_EXT2_FFXSR, @@ -313,7 +315,7 @@ static x86_def_t x86_defs[] = { CPUID_EXT_SSE3 /* PNI */ | CPUID_EXT_SSSE3, /* Missing: CPUID_EXT_DSCPL | CPUID_EXT_EST | * CPUID_EXT_TM2 | CPUID_EXT_XTPR */ - .ext2_features = (PPRO_FEATURES & 0x0183F3FF) | CPUID_EXT2_NX, + .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) | CPUID_EXT2_NX, /* Missing: .ext3_features = CPUID_EXT3_LAHF_LM */ .xlevel = 0x8000000A, .model_id = "Intel(R) Atom(TM) CPU N270 @ 1.60GHz", -- 1.6.1.3