[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/12] cpuid: replace magic number with named consta
From: |
Andre Przywara |
Subject: |
[Qemu-devel] [PATCH 03/12] cpuid: replace magic number with named constant |
Date: |
Fri, 11 Sep 2009 00:20:48 +0200 |
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 <address@hidden>
---
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
- [Qemu-devel] [PATCH 0/12] cpuid: cleanup and some enhancements, Andre Przywara, 2009/09/10
- [Qemu-devel] [PATCH 02/12] cpuid: fix over-long lines, Andre Przywara, 2009/09/10
- [Qemu-devel] [PATCH 01/12] cpuid: move CPUID functions into separate file, Andre Przywara, 2009/09/10
- [Qemu-devel] [PATCH 03/12] cpuid: replace magic number with named constant,
Andre Przywara <=
- [Qemu-devel] [PATCH 05/12] cpuid: moved host_cpuid function and remove prototype, Andre Przywara, 2009/09/10
- [Qemu-devel] [PATCH 04/12] cpuid: fix comments, Andre Przywara, 2009/09/10
- [Qemu-devel] [PATCH 09/12] cpuid: simplify CPUID flag search function, Andre Przywara, 2009/09/10
- [Qemu-devel] [PATCH 06/12] cpuid: add missing CPUID feature flag names, Andre Przywara, 2009/09/10
- [Qemu-devel] [PATCH 11/12] cpuid: add TCG feature bit trimming, Andre Przywara, 2009/09/10
- [Qemu-devel] [PATCH 08/12] cpuid: remove unnecessary kvm_trim function, Andre Przywara, 2009/09/10
- [Qemu-devel] [PATCH 12/12] cpuid: decrease L2 cache for Intel and add comments, Andre Przywara, 2009/09/10