Commit c5096daf7f5e6d8a607319fbd1dfa8acbe96f4b8
1 parent
4242b1bd
Clean up vendor identification (Alexander Graf).
Right now CPU vendor identification contains a lot of magic numbers. The patch cleans them up to defines, so we can identify the CPU later on without copying magic numbers. Signed-off-by: Alexander Graf <agraf@suse.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5316 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
14 additions
and
6 deletions
target-i386/cpu.h
| ... | ... | @@ -333,6 +333,14 @@ |
| 333 | 333 | #define CPUID_EXT3_IBS (1 << 10) |
| 334 | 334 | #define CPUID_EXT3_SKINIT (1 << 12) |
| 335 | 335 | |
| 336 | +#define CPUID_VENDOR_INTEL_1 0x756e6547 /* "Genu" */ | |
| 337 | +#define CPUID_VENDOR_INTEL_2 0x49656e69 /* "ineI" */ | |
| 338 | +#define CPUID_VENDOR_INTEL_3 0x6c65746e /* "ntel" */ | |
| 339 | + | |
| 340 | +#define CPUID_VENDOR_AMD_1 0x68747541 /* "Auth" */ | |
| 341 | +#define CPUID_VENDOR_AMD_2 0x69746e65 /* "enti" */ | |
| 342 | +#define CPUID_VENDOR_AMD_3 0x444d4163 /* "cAMD" */ | |
| 343 | + | |
| 336 | 344 | #define EXCP00_DIVZ 0 |
| 337 | 345 | #define EXCP01_SSTP 1 |
| 338 | 346 | #define EXCP02_NMI 2 | ... | ... |
target-i386/helper.c
| ... | ... | @@ -146,9 +146,9 @@ static x86_def_t x86_defs[] = { |
| 146 | 146 | { |
| 147 | 147 | .name = "qemu64", |
| 148 | 148 | .level = 2, |
| 149 | - .vendor1 = 0x68747541, /* "Auth" */ | |
| 150 | - .vendor2 = 0x69746e65, /* "enti" */ | |
| 151 | - .vendor3 = 0x444d4163, /* "cAMD" */ | |
| 149 | + .vendor1 = CPUID_VENDOR_AMD_1, | |
| 150 | + .vendor2 = CPUID_VENDOR_AMD_2, | |
| 151 | + .vendor3 = CPUID_VENDOR_AMD_3, | |
| 152 | 152 | .family = 6, |
| 153 | 153 | .model = 2, |
| 154 | 154 | .stepping = 3, |
| ... | ... | @@ -347,9 +347,9 @@ static int cpu_x86_register (CPUX86State *env, const char *cpu_model) |
| 347 | 347 | env->cpuid_vendor2 = def->vendor2; |
| 348 | 348 | env->cpuid_vendor3 = def->vendor3; |
| 349 | 349 | } else { |
| 350 | - env->cpuid_vendor1 = 0x756e6547; /* "Genu" */ | |
| 351 | - env->cpuid_vendor2 = 0x49656e69; /* "ineI" */ | |
| 352 | - env->cpuid_vendor3 = 0x6c65746e; /* "ntel" */ | |
| 350 | + env->cpuid_vendor1 = CPUID_VENDOR_INTEL_1; | |
| 351 | + env->cpuid_vendor2 = CPUID_VENDOR_INTEL_2; | |
| 352 | + env->cpuid_vendor3 = CPUID_VENDOR_INTEL_3; | |
| 353 | 353 | } |
| 354 | 354 | env->cpuid_level = def->level; |
| 355 | 355 | env->cpuid_version = (def->family << 8) | (def->model << 4) | def->stepping; | ... | ... |