mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-13 11:22:03 +00:00
[X86] Set the cpu_vendor in __cpu_indicator_init to VENDOR_OTHER if cpuid isn't supported on the CPU.
We need to set the cpu_vendor to a non-zero value to indicate that we already called __cpu_indicator_init once. This should only happen on a 386 or 486 CPU.
This commit is contained in:
parent
da6332f5f9
commit
35f7d58328
@ -655,14 +655,12 @@ int CONSTRUCTOR_ATTRIBUTE __cpu_indicator_init(void) {
|
||||
if (__cpu_model.__cpu_vendor)
|
||||
return 0;
|
||||
|
||||
if (!isCpuIdSupported())
|
||||
return -1;
|
||||
|
||||
// Assume cpuid insn present. Run in level 0 to get vendor id.
|
||||
if (getX86CpuIDAndInfo(0, &MaxLeaf, &Vendor, &ECX, &EDX) || MaxLeaf < 1) {
|
||||
if (!isCpuIdSupported() ||
|
||||
getX86CpuIDAndInfo(0, &MaxLeaf, &Vendor, &ECX, &EDX) || MaxLeaf < 1) {
|
||||
__cpu_model.__cpu_vendor = VENDOR_OTHER;
|
||||
return -1;
|
||||
}
|
||||
|
||||
getX86CpuIDAndInfo(1, &EAX, &EBX, &ECX, &EDX);
|
||||
detectX86FamilyModel(EAX, &Family, &Model);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user