mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
modified ke/i386/cpu.c
Added CMPXCHG8B enabling/detection code for TransMeta, Centaur and Rise (source: <URL: http://www.geoffchappell.com/notes/windows/kernel/cpu/cx8.htm>). Code dead until each vendor will be officially supported Alex and others: please review svn path=/trunk/; revision=36610
This commit is contained in:
parent
ac197ef4f3
commit
58fef1577f
1 changed files with 40 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue