Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Moc00-0007yB-R9 for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mobzx-0007wN-BG for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:35 -0400 Received: from [199.232.76.173] (port=38473 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mobzw-0007wI-U9 for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:33 -0400 Received: from tx2ehsobe004.messaging.microsoft.com ([65.55.88.14]:7910 helo=TX2EHSOBE007.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1Mobzw-0003O7-Eb for qemu-devel@nongnu.org; Fri, 18 Sep 2009 07:51:32 -0400 Received: from mail39-tx2 (localhost.localdomain [127.0.0.1]) by mail39-tx2-R.bigfish.com (Postfix) with ESMTP id 45D3A6807C for ; Fri, 18 Sep 2009 11:51:30 +0000 (UTC) Received: from svlb1extmailp01.amd.com (unknown [139.95.251.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail39-tx2.bigfish.com (Postfix) with ESMTP id EA6AC1138051 for ; Fri, 18 Sep 2009 11:50:59 +0000 (UTC) Received: from svlb1twp01.amd.com ([139.95.250.34]) by svlb1extmailp01.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n8IBosPY025571 for ; Fri, 18 Sep 2009 04:50:57 -0700 Received: from SSVLEXBH1.amd.com (ssvlexbh1.amd.com [139.95.53.182]) by svlb1twp01.amd.com (Tumbleweed MailGate 3.7.0) with ESMTP id 272AC19A014C for ; Fri, 18 Sep 2009 04:50:50 -0700 (PDT) From: Andre Przywara Date: Fri, 18 Sep 2009 13:47:56 +0200 Message-ID: <1253274494-13244-4-git-send-email-andre.przywara@amd.com> In-Reply-To: <1253274494-13244-1-git-send-email-andre.przywara@amd.com> References: <1253274494-13244-1-git-send-email-andre.przywara@amd.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v2 03/21] 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 | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 32d9b82..8d986fc 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -111,6 +111,7 @@ 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 @@ -129,7 +130,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, @@ -151,7 +152,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, @@ -288,7 +289,7 @@ static x86_def_t x86_defs[] = { .stepping = 3, .features = PPRO_FEATURES | CPUID_PSE36 | CPUID_VME | CPUID_MTRR | CPUID_MCA, - .ext2_features = (PPRO_FEATURES & 0x0183F3FF) | + .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) | CPUID_EXT2_MMXEXT | CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT, .xlevel = 0x80000008, /* XXX: put another string ? */ @@ -310,7 +311,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