From 3639da02504621e40ed8ce9a704a7a7f744f7737 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 2 Aug 2004 15:09:22 +0000 Subject: [PATCH] - Use __KeStallExecutionProcessor instead of plain loop in HalCalibratePerformanceCounter since __KeStallExecutionProcessor is safe even for optimized builds. svn path=/trunk/; revision=10361 --- reactos/hal/halx86/timer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/reactos/hal/halx86/timer.c b/reactos/hal/halx86/timer.c index 186df53c363..c2b520ebbed 100644 --- a/reactos/hal/halx86/timer.c +++ b/reactos/hal/halx86/timer.c @@ -20,7 +20,7 @@ * MA 02139, USA. * */ -/* $Id: timer.c,v 1.5 2004/07/20 21:25:36 hbirr Exp $ +/* $Id: timer.c,v 1.6 2004/08/02 15:09:22 navaraf Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/hal/x86/udelay.c @@ -97,7 +97,7 @@ static BOOLEAN UdelayCalibrated = FALSE; * also access RAM at the same time - making the delay imprecise. * 2. Use compiler-specific #pragma's to disable optimization. * 3. Use inline assembly, making it equally unportable as #2. - * For supported compilers we use incline assembler. for the others, + * For supported compilers we use inline assembler. For the others, * portable plain C. */ VOID STDCALL @@ -262,14 +262,13 @@ VOID HalpCalibrateStallExecution(VOID) VOID STDCALL HalCalibratePerformanceCounter(ULONG Count) { - ULONG i; ULONG flags; /* save flags and disable interrupts */ Ki386SaveFlags(flags); Ki386DisableInterrupts(); - for (i = 0; i < Count; i++); + __KeStallExecutionProcessor(Count); /* restore flags */ Ki386RestoreFlags(flags);