Author: tkreuzer Date: Sun Aug 24 19:25:49 2008 New Revision: 35620
URL: http://svn.reactos.org/svn/reactos?rev=35620&view=rev Log: 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.
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntoskr... ============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] Sun Aug 24 19:25:49 2008 @@ -497,7 +497,7 @@ DPRINT1("SMP Boot support not yet present\n"); } FrLdrDbgPrint("before KeInitializeThread\n"); -for(;;); + /* Setup the Idle Thread */ KeInitializeThread(InitProcess, InitThread, @@ -507,6 +507,7 @@ NULL, NULL, IdleStack); +FrLdrDbgPrint("after KeInitializeThread\n"); InitThread->NextProcessor = Number; InitThread->Priority = HIGH_PRIORITY; InitThread->State = Running; @@ -596,15 +597,8 @@ 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;