From 20ad38dd8ec4842d9cf77a3eaf76366c9c381fa3 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 25 Aug 2008 00:25:49 +0000 Subject: [PATCH] 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 --- reactos/ntoskrnl/ke/amd64/kiinit.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/reactos/ntoskrnl/ke/amd64/kiinit.c b/reactos/ntoskrnl/ke/amd64/kiinit.c index 116c77bbd58..0e4a27765ca 100644 --- a/reactos/ntoskrnl/ke/amd64/kiinit.c +++ b/reactos/ntoskrnl/ke/amd64/kiinit.c @@ -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;