Author: greatlrd Date: Tue Jul 18 20:36:54 2006 New Revision: 23156
URL: http://svn.reactos.org/svn/reactos?rev=23156&view=rev Log: pathc from w3seek : bug 1702 : Fix BitScanReverse()
Modified: trunk/reactos/include/psdk/winnt.h
Modified: trunk/reactos/include/psdk/winnt.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=23... ============================================================================== --- trunk/reactos/include/psdk/winnt.h (original) +++ trunk/reactos/include/psdk/winnt.h Tue Jul 18 20:36:54 2006 @@ -3818,13 +3818,13 @@ BitScanReverse(OUT ULONG *Index, IN ULONG Mask) { - LONG OldBit; - __asm__ __volatile__("bsrl %1,%2\n\t" - "sbbl %0,%0\n\t" - :"=r" (OldBit),"=m" (*Index) - :"Ir" (Mask) - : "memory"); - return OldBit; + BOOLEAN BitPosition = 0; + __asm__ __volatile__("bsrl %2,%0\n\t" + "setnz %1\n\t" + :"=&r" (*Index), "=r" (BitPosition) + :"rm" (Mask) + :"memory"); + return BitPosition; }
#endif