VirtualBox

Changeset 44170 in vbox


Ignore:
Timestamp:
Dec 19, 2012 5:57:32 PM (12 years ago)
Author:
vboxsync
Message:

cpumR3DetectVendor: Use ASMIsXyzCpuEx.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r44078 r44170  
    667667static CPUMCPUVENDOR cpumR3DetectVendor(uint32_t uEAX, uint32_t uEBX, uint32_t uECX, uint32_t uEDX)
    668668{
    669     if (    uEAX >= 1
    670         &&  uEBX == X86_CPUID_VENDOR_AMD_EBX
    671         &&  uECX == X86_CPUID_VENDOR_AMD_ECX
    672         &&  uEDX == X86_CPUID_VENDOR_AMD_EDX)
    673         return CPUMCPUVENDOR_AMD;
    674 
    675     if (    uEAX >= 1
    676         &&  uEBX == X86_CPUID_VENDOR_INTEL_EBX
    677         &&  uECX == X86_CPUID_VENDOR_INTEL_ECX
    678         &&  uEDX == X86_CPUID_VENDOR_INTEL_EDX)
    679         return CPUMCPUVENDOR_INTEL;
    680 
    681     if (    uEAX >= 1
    682         &&  uEBX == X86_CPUID_VENDOR_VIA_EBX
    683         &&  uECX == X86_CPUID_VENDOR_VIA_ECX
    684         &&  uEDX == X86_CPUID_VENDOR_VIA_EDX)
    685         return CPUMCPUVENDOR_VIA;
    686 
    687     /** @todo detect the other buggers... */
     669    if (ASMIsValidStdRange(uEAX))
     670    {
     671        if (ASMIsAmdCpuEx(uEBX, uECX, uEDX))
     672            return CPUMCPUVENDOR_AMD;
     673
     674        if (ASMIsIntelCpuEx(uEBX, uECX, uEDX))
     675            return CPUMCPUVENDOR_INTEL;
     676
     677        if (ASMIsViaCentaurCpuEx(uEBX, uECX, uEDX))
     678            return CPUMCPUVENDOR_VIA;
     679
     680        /** @todo detect the other buggers... */
     681    }
     682
    688683    return CPUMCPUVENDOR_UNKNOWN;
    689684}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette