mirror of https://github.com/xemu-project/xemu.git
target-i386: Eliminate unnecessary get_cpuid_vendor() function
The function was used in only two places. In one of them, the function made the code less readable by requiring temporary te[bcd]x variables. In the other one we can simply inline the existing code. Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
a3c2ca7d29
commit
08e1a1e5a1
|
@ -2214,14 +2214,6 @@ void x86_cpudef_setup(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void get_cpuid_vendor(CPUX86State *env, uint32_t *ebx,
|
|
||||||
uint32_t *ecx, uint32_t *edx)
|
|
||||||
{
|
|
||||||
*ebx = env->cpuid_vendor1;
|
|
||||||
*edx = env->cpuid_vendor2;
|
|
||||||
*ecx = env->cpuid_vendor3;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
|
void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
|
||||||
uint32_t *eax, uint32_t *ebx,
|
uint32_t *eax, uint32_t *ebx,
|
||||||
uint32_t *ecx, uint32_t *edx)
|
uint32_t *ecx, uint32_t *edx)
|
||||||
|
@ -2255,7 +2247,9 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
|
||||||
switch(index) {
|
switch(index) {
|
||||||
case 0:
|
case 0:
|
||||||
*eax = env->cpuid_level;
|
*eax = env->cpuid_level;
|
||||||
get_cpuid_vendor(env, ebx, ecx, edx);
|
*ebx = env->cpuid_vendor1;
|
||||||
|
*edx = env->cpuid_vendor2;
|
||||||
|
*ecx = env->cpuid_vendor3;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
*eax = env->cpuid_version;
|
*eax = env->cpuid_version;
|
||||||
|
@ -2448,11 +2442,9 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
|
||||||
* So dont set it here for Intel to make Linux guests happy.
|
* So dont set it here for Intel to make Linux guests happy.
|
||||||
*/
|
*/
|
||||||
if (cs->nr_cores * cs->nr_threads > 1) {
|
if (cs->nr_cores * cs->nr_threads > 1) {
|
||||||
uint32_t tebx, tecx, tedx;
|
if (env->cpuid_vendor1 != CPUID_VENDOR_INTEL_1 ||
|
||||||
get_cpuid_vendor(env, &tebx, &tecx, &tedx);
|
env->cpuid_vendor2 != CPUID_VENDOR_INTEL_2 ||
|
||||||
if (tebx != CPUID_VENDOR_INTEL_1 ||
|
env->cpuid_vendor3 != CPUID_VENDOR_INTEL_3) {
|
||||||
tedx != CPUID_VENDOR_INTEL_2 ||
|
|
||||||
tecx != CPUID_VENDOR_INTEL_3) {
|
|
||||||
*ecx |= 1 << 1; /* CmpLegacy bit */
|
*ecx |= 1 << 1; /* CmpLegacy bit */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue