Some build fixes for ReactOS ARM. Credits go to Alex Ionescu and Timo Kreuzer while...
authorDaniel Reimer <reimer.daniel@freenet.de>
Wed, 16 Dec 2009 20:59:06 +0000 (20:59 +0000)
committerDaniel Reimer <reimer.daniel@freenet.de>
Wed, 16 Dec 2009 20:59:06 +0000 (20:59 +0000)
- Undefine Unicode which is defined by default in cegcc.
- Add a missing include in ke.h
- Implement _CountLeadingZeros, _CountTrailingZeros, _BitScanForward for ARM.

svn path=/trunk/; revision=44625

reactos/ReactOS-arm.rbuild
reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h
reactos/include/crt/mingw32/intrin_arm.h
reactos/ntoskrnl/include/internal/arm/ke.h

index aac72e0..204b4a4 100644 (file)
@@ -29,6 +29,8 @@
                        <compilerflag>-ftracer</compilerflag>
                </if>
         <compilerflag>-Wno-attributes</compilerflag>
+        <compilerflag>-U_UNICODE</compilerflag>
+        <compilerflag>-UUNICODE</compilerflag>
        </group>
 
 
index 549eefe..7d6fae6 100644 (file)
@@ -67,7 +67,7 @@ FldrCreateSystemKey(
 VOID
 NTAPI
 FldrCreateComponentKey(
-    IN PCONFIGURATION_COMPONENT_DATA SystemKey,,
+    IN PCONFIGURATION_COMPONENT_DATA SystemKey,
     IN CONFIGURATION_CLASS Class,
     IN CONFIGURATION_TYPE Type,
     IN IDENTIFIER_FLAG Flags,
index 066c641..99ddb47 100644 (file)
 #define _ReturnAddress() (__builtin_return_address(0))
 #define _ReadWriteBarrier() __sync_synchronize()
 
+__INTRIN_INLINE unsigned _CountLeadingZeros(long Mask)
+{
+    return Mask ? __builtin_clz(Mask) : 32;
+}
+
+__INTRIN_INLINE unsigned _CountTrailingZeros(long Mask)
+{
+    return Mask ? __builtin_ctz(Mask) : 32;
+}
+
+__INTRIN_INLINE unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask)
+{
+       *Index = __builtin_ctz(Mask);
+       return Mask ? 1 : 0;
+}
+
 __INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand)
 {
        return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
index f539cf4..67b8bef 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARM_KE_H
 #define __NTOSKRNL_INCLUDE_INTERNAL_ARM_KE_H
 
+#include "intrin_i.h"
+
 //
 //Lockdown TLB entries
 //
@@ -38,7 +40,7 @@
 // Returns the Interrupt State from a Trap Frame.
 // ON = TRUE, OFF = FALSE
 //
-//#define KeGetTrapFrameInterruptState(TrapFrame) \
+//#define KeGetTrapFrameInterruptState(TrapFrame)
 
 //
 // Invalidates the TLB entry for a specified address