Commit in reactos/ntoskrnl/ke/i386 on MAIN
gdt.c+7-51.17 -> 1.18
- Queried some values from pcr at DISPATCH_LEVEL to prevent from changing the processor after a thread switch.  
- Changed from bx to dx within inline assembler, because the ebx register must be saved.

reactos/ntoskrnl/ke/i386
gdt.c 1.17 -> 1.18
diff -u -r1.17 -r1.18
--- gdt.c	15 Aug 2004 16:39:05 -0000	1.17
+++ gdt.c	31 Oct 2004 14:02:20 -0000	1.18
@@ -134,7 +134,7 @@
 	   "movl %1, %%fs\n\t"
 	   "movl %0, %%gs\n\t"
 	   : /* no output */
-	   : "a" (KERNEL_DS), "b" (PCR_SELECTOR));
+	   : "a" (KERNEL_DS), "d" (PCR_SELECTOR));
   __asm__ ("pushl %0\n\t"
 	   "pushl $.l4\n\t"
 	   "lret\n\t"
@@ -146,10 +146,10 @@
   {
     lgdt Descriptor;
     mov ax, KERNEL_DS;
-    mov bx, PCR_SELECTOR;
+    mov dx, PCR_SELECTOR;
     mov ds, ax;
     mov es, ax;
-    mov fs, bx;
+    mov fs, dx;
     mov gs, ax;
     push KERNEL_CS;
     push offset l4 ;
@@ -207,13 +207,14 @@
 		     PVOID Base)
 {
    KIRQL oldIrql;
-   PUSHORT Gdt = KeGetCurrentKPCR()->GDT;
+   PUSHORT Gdt;
    
    DPRINT("KeSetBaseGdtSelector(Entry %x, Base %x)\n",
 	   Entry, Base);
    
    KeAcquireSpinLock(&GdtLock, &oldIrql);
    
+   Gdt = KeGetCurrentKPCR()->GDT;
    Entry = (Entry & (~0x3)) / 2;
    
    Gdt[Entry + 1] = (USHORT)(((ULONG)Base) & 0xffff);
@@ -241,13 +242,14 @@
                  ULONG Value2)
 {
    KIRQL oldIrql;
-   PULONG Gdt = (PULONG) KeGetCurrentKPCR()->GDT;
+   PULONG Gdt; 
    
    DPRINT("KeSetGdtSelector(Entry %x, Value1 %x, Value2 %x)\n",
 	   Entry, Value1, Value2);
    
    KeAcquireSpinLock(&GdtLock, &oldIrql);
    
+   Gdt = (PULONG) KeGetCurrentKPCR()->GDT;;
    Entry = (Entry & (~0x3)) / 4;
 
    Gdt[Entry] = Value1;
CVSspam 0.2.8