From 70da417c027031de23cbea18ce845c3ff3ed05a0 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Sun, 1 Oct 2006 14:02:08 +0000 Subject: [PATCH] Fix usage of a uninitialized variable, unnecessary goto not replaced by a if(...) statement svn path=/trunk/; revision=24342 --- reactos/ntoskrnl/ke/i386/kiinit.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/ntoskrnl/ke/i386/kiinit.c b/reactos/ntoskrnl/ke/i386/kiinit.c index 44df101b8f7..0b8f006a7a7 100644 --- a/reactos/ntoskrnl/ke/i386/kiinit.c +++ b/reactos/ntoskrnl/ke/i386/kiinit.c @@ -311,12 +311,13 @@ KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* Initialize the machine type */ KiInitializeMachineType(); - /* Skip initial setup if this isn't the Boot CPU */ - if (Cpu) goto AppCpuInit; - /* Get GDT, IDT, PCR and TSS pointers */ KiGetMachineBootPointers(&Gdt, &Idt, &Pcr, &Tss); + /* Skip initial setup if this isn't the Boot CPU */ + if (Cpu) + goto AppCpuInit; + /* Setup the TSS descriptors and entries */ Ki386InitializeTss(Tss, Idt, Gdt); @@ -347,8 +348,8 @@ AppCpuInit: do { /* Loop until execution can continue */ - while (KiFreezeExecutionLock == 1); - } while(InterlockedBitTestAndSet(&KiFreezeExecutionLock, 0)); + while ((volatile KSPIN_LOCK)KiFreezeExecutionLock == 1); + } while(InterlockedBitTestAndSet((PLONG)&KiFreezeExecutionLock, 0)); /* Setup CPU-related fields */ __writefsdword(KPCR_NUMBER, Cpu);