From 97f449127c0ea1c9e8a361e40e6179565e453d93 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Tue, 18 Jul 2006 16:36:54 +0000 Subject: [PATCH] pathc from w3seek : bug 1702 : Fix BitScanReverse() svn path=/trunk/; revision=23156 --- reactos/include/psdk/winnt.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 5fb86b005d1..eadddf10071 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -3818,13 +3818,13 @@ static __inline__ BOOLEAN 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