From patchwork Tue Feb 2 10:08:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 44268 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B02B9B7D5B for ; Tue, 2 Feb 2010 21:26:04 +1100 (EST) Received: from localhost ([127.0.0.1]:58724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcFue-0001Bz-KE for incoming@patchwork.ozlabs.org; Tue, 02 Feb 2010 05:23:16 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NcFgV-0002g7-CZ for qemu-devel@nongnu.org; Tue, 02 Feb 2010 05:08:39 -0500 Received: from [199.232.76.173] (port=38597 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcFgU-0002fY-Pa for qemu-devel@nongnu.org; Tue, 02 Feb 2010 05:08:38 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NcFgJ-0006si-8f for qemu-devel@nongnu.org; Tue, 02 Feb 2010 05:08:38 -0500 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12]:41436 helo=TX2EHSOBE003.bigfish.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1NcFgI-0006sa-Vk for qemu-devel@nongnu.org; Tue, 02 Feb 2010 05:08:27 -0500 Received: from mail95-tx2-R.bigfish.com (10.9.14.240) by TX2EHSOBE003.bigfish.com (10.9.40.23) with Microsoft SMTP Server id 8.1.240.5; Tue, 2 Feb 2010 10:08:26 +0000 Received: from mail95-tx2 (localhost [127.0.0.1]) by mail95-tx2-R.bigfish.com (Postfix) with ESMTP id 0CFF5890830; Tue, 2 Feb 2010 10:08:26 +0000 (UTC) X-SpamScore: 1 X-BigFish: VPS1(zzab9bh936eM853kzz1202hzzz32i6bh43j61h) Received: from mail95-tx2 (localhost.localdomain [127.0.0.1]) by mail95-tx2 (MessageSwitch) id 1265105305489753_22570; Tue, 2 Feb 2010 10:08:25 +0000 (UTC) Received: from TX2EHSMHS031.bigfish.com (unknown [10.9.14.240]) by mail95-tx2.bigfish.com (Postfix) with ESMTP id 7430B1120051; Tue, 2 Feb 2010 10:08:25 +0000 (UTC) Received: from ausb3extmailp01.amd.com (163.181.251.8) by TX2EHSMHS031.bigfish.com (10.9.99.131) with Microsoft SMTP Server (TLS) id 14.0.482.39; Tue, 2 Feb 2010 10:08:24 +0000 Received: from ausb3twp01.amd.com ([163.181.250.37]) by ausb3extmailp01.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id o12AA11s015731; Tue, 2 Feb 2010 04:10:07 -0600 X-WSS-ID: 0KX7LHV-01-GSX-02 X-M-MSG: Received: from sausexbh2.amd.com (SAUSEXBH2.amd.com [163.181.22.102]) by ausb3twp01.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 2E23210284A3; Tue, 2 Feb 2010 04:08:19 -0600 (CST) Received: from sausexmb1.amd.com ([163.181.3.156]) by sausexbh2.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 2 Feb 2010 04:08:22 -0600 Received: from seurexmb1.amd.com ([165.204.9.130]) by sausexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 2 Feb 2010 04:08:22 -0600 Received: from gwo.osrc.amd.com ([165.204.16.204]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 2 Feb 2010 11:08:18 +0100 Received: from localhost.localdomain (tronje.osrc.amd.com [165.204.15.48]) by gwo.osrc.amd.com (Postfix) with ESMTP id 5DF5449C107; Tue, 2 Feb 2010 10:08:37 +0000 (GMT) From: Andre Przywara To: qemu-devel@nongnu.org Date: Tue, 2 Feb 2010 11:08:10 +0100 Message-ID: <1265105301-3455-3-git-send-email-andre.przywara@amd.com> X-Mailer: git-send-email 1.6.4 In-Reply-To: <1265105301-3455-1-git-send-email-andre.przywara@amd.com> References: <1265105301-3455-1-git-send-email-andre.przywara@amd.com> X-OriginalArrivalTime: 02 Feb 2010 10:08:18.0525 (UTC) FILETIME=[A476F0D0:01CAA3EF] MIME-Version: 1.0 X-Reverse-DNS: unknown X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ Cc: john.cooper@redhat.com, Andre Przywara Subject: [Qemu-devel] [PATCH 02/13] cpuid: replace magic number with named constant X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Acked-by: Aurelien Jarno --- target-i386/cpuid.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index aaa14ba..0a17020 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -130,6 +130,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 { @@ -147,7 +148,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 | CPUID_EXT_CX16 | CPUID_EXT_POPCNT, - .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_LAHF_LM | CPUID_EXT3_SVM | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A, @@ -170,7 +171,7 @@ static x86_def_t x86_defs[] = { .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | CPUID_EXT_CX16 | CPUID_EXT_POPCNT, /* 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, @@ -220,7 +221,7 @@ static x86_def_t x86_defs[] = { /* Missing: CPUID_EXT_POPCNT, CPUID_EXT_MONITOR */ .ext_features = CPUID_EXT_SSE3 | CPUID_EXT_CX16, /* 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, /* Missing: CPUID_EXT3_LAHF_LM, CPUID_EXT3_CMP_LEG, CPUID_EXT3_EXTAPIC, CPUID_EXT3_CR8LEG, CPUID_EXT3_ABM, CPUID_EXT3_SSE4A, @@ -308,7 +309,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) | CPUID_EXT2_MMXEXT | + .ext2_features = (PPRO_FEATURES & EXT2_FEATURE_MASK) | CPUID_EXT2_MMXEXT | CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT, .xlevel = 0x80000008, /* XXX: put another string ? */ @@ -330,7 +331,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",