diff --git a/reactos/ntoskrnl/ke/i386/cpu.c b/reactos/ntoskrnl/ke/i386/cpu.c index 3e5aa136a47..ca1bd92d500 100644 --- a/reactos/ntoskrnl/ke/i386/cpu.c +++ b/reactos/ntoskrnl/ke/i386/cpu.c @@ -353,6 +353,46 @@ KiGetFeatureBits(VOID) CpuFeatures = Reg[3]; } +#ifdef CPU_TRANSMETA + if (Vendor == CPU_TRANSMETA) + { + /* Enable CMPXCHG8B if the family (>= 5), model and stepping (>= 4.2) support it */ + if ((Reg[0] & 0x0F00) >= 0x0500 && (Reg[0] & 0x00FF) >= 0x0042) + { + WRMSR(0x80860004, RDMSR(0x80860004) | 0x0100); + FeatureBits |= KF_CMPXCHG8B; + } + } +#endif + +#ifdef CPU_CENTAUR + if (Vendor == CPU_CENTAUR) + { + /* If CMPXCHG8B is not detected, try to enable it */ + if (!(CpuFeatures & 0x00000100)) + { + if ((Reg[0] & 0x0F00) == 0x0500) + { + WRMSR(0x0107, RDMSR(0x0107) | 0x02); + FeatureBits |= KF_CMPXCHG8B; + } + else if ((Reg[0] & 0x0F00) >= 0x0600) + { + WRMSR(0x1107, (RDMSR(0x1107) | 0x02) & ~((LONGLONG)0x01)); + FeatureBits |= KF_CMPXCHG8B; + } + } + } +#endif + +#ifdef CPU_RISE + if (Vendor == CPU_RISE) + { + /* Windows Vista assumes CMPXCHG8B is always supported on Rise */ + FeatureBits |= KF_CMPXCHG8B; + } +#endif + /* Convert all CPUID Feature bits into our format */ if (CpuFeatures & 0x00000002) FeatureBits |= KF_V86_VIS | KF_CR4; if (CpuFeatures & 0x00000008) FeatureBits |= KF_LARGE_PAGE | KF_CR4;