Author: tkreuzer Date: Fri Jan 1 13:17:24 2010 New Revision: 44849
URL: http://svn.reactos.org/svn/reactos?rev=44849&view=rev Log: [HAL] Don't spin with an interlocked operation.
Modified: branches/ros-amd64-bringup/reactos/hal/halx86/generic/cmos.c
Modified: branches/ros-amd64-bringup/reactos/hal/halx86/generic/cmos.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/ha... ============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/generic/cmos.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/generic/cmos.c [iso-8859-1] Fri Jan 1 13:17:24 2010 @@ -35,8 +35,9 @@ /* Try to acquire the lock */ while (InterlockedBitTestAndSet((PLONG)&HalpSystemHardwareLock, 0)) { - /* Lock is held, short wait and try again */ - YieldProcessor(); + /* Lock is held, spin until it's free */ + while (*(volatile ULONG*)HalpSystemHardwareLock & 1) + YieldProcessor(); }
/* We have the lock, save the flags now */