Do not crash on Pentium.

svn path=/trunk/; revision=39959
This commit is contained in:
Dmitry Gorbachev 2009-03-11 20:34:34 +00:00
parent 5d5bd6fb04
commit a8274cb5f7

View file

@ -107,6 +107,17 @@ NTAPI
HalpSwitchToRealModeTrapHandlers(VOID)
{
ULONG Handler;
PHARDWARE_PTE IdtPte;
/* On i586, the first 7 entries of IDT are write-protected, unprotect them. */
if (KeGetCurrentPrcb()->CpuType == 5)
{
IdtPte = GetPteAddress(((PKIPCR)KeGetPcr())->IDT);
IdtPte->Write = 1;
/* Flush the TLB by resetting CR3 */
__writecr3(__readcr3());
}
/* Save the current Invalid Opcode and General Protection Fault Handlers */
HalpGpfHandler = ((((PKIPCR)KeGetPcr())->IDT[13].ExtendedOffset << 16) &