Author: tkreuzer
Date: Fri Feb 6 18:20:25 2009
New Revision: 39446
URL:
http://svn.reactos.org/svn/reactos?rev=39446&view=rev
Log:
define BitScanReverse to _BitScanReverse, add BitScanForeward the same way, add 64 bit
InterlockedBittest intrinsics
Modified:
trunk/reactos/include/ddk/wdm.h
Modified: trunk/reactos/include/ddk/wdm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=3944…
==============================================================================
--- trunk/reactos/include/ddk/wdm.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/wdm.h [iso-8859-1] Fri Feb 6 18:20:25 2009
@@ -181,30 +181,14 @@
#endif
}
-static __inline__ BOOLEAN
-BitScanReverse(OUT ULONG *Index,
- IN ULONG Mask)
-{
- BOOLEAN BitPosition = 0;
-#if defined(_M_IX86)
- __asm__ __volatile__("bsrl %2,%0\n\t"
- "setnz %1\n\t"
- :"=&r" (*Index), "=q" (BitPosition)
- :"rm" (Mask)
- :"memory");
- return BitPosition;
-#else
- /* Slow implementation for now */
- for( *Index = 31; *Index; (*Index)-- ) {
- if( (1<<*Index) & Mask ) {
- return TRUE;
- }
- }
-
- return FALSE;
-#endif
-}
-
+#endif
+
+#define BitScanForward _BitScanForward
+#define BitScanReverse _BitScanReverse
+
+#ifdef _M_AMD64
+#define InterlockedBitTestAndSet64 _interlockedbittestandset64
+#define InterlockedBitTestAndReset64 _interlockedbittestandreset64
#endif