It's really not good coding style to pass an OUT parameter "by value" to a macro like Ke386GetGlobalDescriptorTable. The Funny thing is that due to a missing memory barrier this macro actually handled this like a "by value" parameter. Of cause this is totally incorrect and led to the strange results I was experiencing.

Use __sgdt and __sidt instead and remove the old hack.

svn path=/branches/ros-amd64-bringup/; revision=35620
This commit is contained in:
Timo Kreuzer
2008-08-25 00:25:49 +00:00
parent 001f91468e
commit 20ad38dd8e
+4 -10
View File
@@ -497,7 +497,7 @@ KiInitializeKernel(IN PKPROCESS InitProcess,
DPRINT1("SMP Boot support not yet present\n");
}
FrLdrDbgPrint("before KeInitializeThread\n");
for(;;);
/* Setup the Idle Thread */
KeInitializeThread(InitProcess,
InitThread,
@@ -507,6 +507,7 @@ for(;;);
NULL,
NULL,
IdleStack);
FrLdrDbgPrint("after KeInitializeThread\n");
InitThread->NextProcessor = Number;
InitThread->Priority = HIGH_PRIORITY;
InitThread->State = Running;
@@ -596,15 +597,8 @@ KiGetMachineBootPointers(IN PKGDTENTRY *Gdt,
USHORT Tr = 0;
/* Get GDT and IDT descriptors */
Ke386GetGlobalDescriptorTable(GdtDescriptor.Limit);
Ke386GetInterruptDescriptorTable(IdtDescriptor.Limit);
// FIXME: for some strange reason the gdt needs some time before it's finished...
if (!GdtDescriptor.Base)
{
FrLdrDbgPrint("1. Base = %p, Limit = 0x%x\n", GdtDescriptor.Base, GdtDescriptor.Limit);
}
FrLdrDbgPrint("2. Base = %p, Limit = 0x%x\n", GdtDescriptor.Base, GdtDescriptor.Limit);
__sgdt(&GdtDescriptor.Limit);
__sidt(&IdtDescriptor.Limit);
/* Save IDT and GDT */
*Gdt = (PKGDTENTRY)GdtDescriptor.Base;