[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/21] target-i386: use define for cpuid vendor stri
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 15/21] target-i386: use define for cpuid vendor string size |
Date: |
Wed, 15 Aug 2012 18:13:35 +0200 |
Signed-off-by: Igor Mammedov <address@hidden>
---
target-i386/cpu.c | 6 +++---
target-i386/cpu.h | 2 ++
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index cb6ada0..af6c9a3 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -862,13 +862,13 @@ static char *x86_cpuid_get_vendor(Object *obj, Error
**errp)
char *value;
int i;
- value = (char *)g_malloc(12 + 1);
+ value = (char *)g_malloc(CPUID_VENDOR_SZ + 1);
for (i = 0; i < 4; i++) {
value[i ] = env->cpuid_vendor1 >> (8 * i);
value[i + 4] = env->cpuid_vendor2 >> (8 * i);
value[i + 8] = env->cpuid_vendor3 >> (8 * i);
}
- value[12] = '\0';
+ value[CPUID_VENDOR_SZ] = '\0';
return value;
}
@@ -879,7 +879,7 @@ static void x86_cpuid_set_vendor(Object *obj, const char
*value,
CPUX86State *env = &cpu->env;
int i;
- if (strlen(value) != 12) {
+ if (strlen(value) != CPUID_VENDOR_SZ) {
error_set(errp, QERR_PROPERTY_VALUE_BAD, "",
"vendor", value);
return;
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 979682a..5c75704 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -440,6 +440,8 @@
#define CPUID_SVM_PAUSEFILTER (1 << 10)
#define CPUID_SVM_PFTHRESHOLD (1 << 12)
+#define CPUID_VENDOR_SZ 12
+
#define CPUID_VENDOR_INTEL_1 0x756e6547 /* "Genu" */
#define CPUID_VENDOR_INTEL_2 0x49656e69 /* "ineI" */
#define CPUID_VENDOR_INTEL_3 0x6c65746e /* "ntel" */
--
1.7.11.2
- [Qemu-devel] [PATCH 01/21] target-i386: return Error from cpu_x86_find_by_name(), (continued)
- [Qemu-devel] [PATCH 01/21] target-i386: return Error from cpu_x86_find_by_name(), Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 03/21] target-i386: if x86_cpu_realize() failed report error and do cleanup, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 06/21] target-i386: xlevel should be more than 0x80000000, move fixup into setter, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 04/21] target-i386: filter out not TCG features if running without kvm at realize time, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 08/21] target-i386: convert 'hv_spinlocks' feature into property, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 07/21] target-i386: convert cpuid features into properties, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 10/21] target-i386: convert 'hv_vapic' feature into property, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 11/21] target-i386: convert 'check' and 'enforce' features into properties, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 02/21] target-i386: cpu_x86_register(): report error from property setter, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 14/21] target-i386: introduce vendor-override property, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 15/21] target-i386: use define for cpuid vendor string size,
Igor Mammedov <=
- [Qemu-devel] [PATCH 13/21] target-i386: use visit_type_hz to parse tsc_freq property value, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 05/21] target-i386: move out CPU features initialization in separate func, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 16/21] target-i386: replace uint32_t vendor fields by vendor string in x86_def_t, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 19/21] target-i386: move init of "hypervisor" feature into CPU initializer from cpudef, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 20/21] target-i386: move default init of cpuid_kvm_features bitmap into CPU initializer from cpudef, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 12/21] add visitor for parsing hz[KMG] input string, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 18/21] target-i386: use properties to set/unset user specified features on CPU, Igor Mammedov, 2012/08/15
- [Qemu-devel] [PATCH 21/21] target-i386: cleanup cpu_x86_find_by_name(), only fill x86_def_t in it, Igor Mammedov, 2012/08/15