mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:23:34 +00:00
[NTOS:KE]
- Load LDT on context switch if required. CORE-11511 #resolve svn path=/trunk/; revision=71967
This commit is contained in:
parent
280b976e35
commit
4bcb47a522
3 changed files with 23 additions and 6 deletions
|
@ -34,9 +34,17 @@ KiSwapProcess(IN PKPROCESS NewProcess,
|
||||||
/* Check for new LDT */
|
/* Check for new LDT */
|
||||||
if (NewProcess->LdtDescriptor.LimitLow != OldProcess->LdtDescriptor.LimitLow)
|
if (NewProcess->LdtDescriptor.LimitLow != OldProcess->LdtDescriptor.LimitLow)
|
||||||
{
|
{
|
||||||
/* Not handled yet */
|
if (NewProcess->LdtDescriptor.LimitLow)
|
||||||
UNIMPLEMENTED_DBGBREAK();
|
{
|
||||||
return;
|
KeSetGdtSelector(KGDT_LDT,
|
||||||
|
((PULONG)&NewProcess->LdtDescriptor)[0],
|
||||||
|
((PULONG)&NewProcess->LdtDescriptor)[1]);
|
||||||
|
Ke386SetLocalDescriptorTable(KGDT_LDT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ke386SetLocalDescriptorTable(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update CR3 */
|
/* Update CR3 */
|
||||||
|
|
|
@ -167,7 +167,7 @@ BOOLEAN PspIsDescriptorValid(PLDT_ENTRY ldt_entry)
|
||||||
if ((Base + SegLimit > (ULONG_PTR) MmHighestUserAddress) ||
|
if ((Base + SegLimit > (ULONG_PTR) MmHighestUserAddress) ||
|
||||||
(Base > Base+SegLimit))
|
(Base > Base+SegLimit))
|
||||||
{
|
{
|
||||||
DPRINT1("WARNING: Windows would mark this descriptor invalid!");
|
DPRINT1("WARNING: Windows would mark this descriptor invalid!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -345,8 +345,17 @@ KiSwapContextExit(IN PKTHREAD OldThread,
|
||||||
/* Check if there is a different LDT */
|
/* Check if there is a different LDT */
|
||||||
if (*(PULONGLONG)&OldProcess->LdtDescriptor != *(PULONGLONG)&NewProcess->LdtDescriptor)
|
if (*(PULONGLONG)&OldProcess->LdtDescriptor != *(PULONGLONG)&NewProcess->LdtDescriptor)
|
||||||
{
|
{
|
||||||
DPRINT1("LDT switch not implemented\n");
|
if (NewProcess->LdtDescriptor.LimitLow)
|
||||||
ASSERT(FALSE);
|
{
|
||||||
|
KeSetGdtSelector(KGDT_LDT,
|
||||||
|
((PULONG)&NewProcess->LdtDescriptor)[0],
|
||||||
|
((PULONG)&NewProcess->LdtDescriptor)[1]);
|
||||||
|
Ke386SetLocalDescriptorTable(KGDT_LDT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ke386SetLocalDescriptorTable(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Switch address space and flush TLB */
|
/* Switch address space and flush TLB */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue