[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 03/21] cpuid: replace magic number with named con
From: |
Andre Przywara |
Subject: |
[Qemu-devel] [PATCH v2 03/21] cpuid: replace magic number with named constant |
Date: |
Fri, 18 Sep 2009 13:47:56 +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 | 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
- [Qemu-devel] [PATCH v2 13/21] cpuid: add TCG feature bit trimming, (continued)
- [Qemu-devel] [PATCH v2 13/21] cpuid: add TCG feature bit trimming, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 08/21] cpuid: list all known x86 CPUID feature flags, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 15/21] cpuid: Adjust feature bit constants, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 16/21] cpuid: Update qemu64/32 CPU models, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 14/21] cpuid: decrease L2 cache for Intel and add comments, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 01/21] cpuid: move CPUID functions into separate file, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 20/21] cpuid: Add kvm32 CPU model, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 12/21] cpuid: Fix multicore setup on Intel, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 05/21] cpuid: moved host_cpuid function and remove prototype, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 17/21] cpuid: Fix CPU models to use new feature set names, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 03/21] cpuid: replace magic number with named constant,
Andre Przywara <=
- [Qemu-devel] [PATCH v2 19/21] cpuid: Add athlon64 CPU model, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 21/21] cpuid: Always expose 32 and 64-bit CPUs, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 18/21] cpuid: Fix 486 CPU model, Andre Przywara, 2009/09/18
- [Qemu-devel] [PATCH v2 11/21] cpuid: propagate further CPUID leafs when -cpu host, Andre Przywara, 2009/09/18