Author: tkreuzer
Date: Sat Jan 22 19:17:10 2011
New Revision: 50470
URL:
http://svn.reactos.org/svn/reactos?rev=50470&view=rev
Log:
- _mingw.h: Don't define USE_MINGW_SETJMP_TWO_ARGS for MSVC
- _mingw.h: Fix definition of _CRT_ALIGN for MSVC
- intrin.h: _InterlockedAddLargeStatistic is not an intrinsic on MSVC for x64
- intrin.h: Fix return type of _InterlockedOr64
- wdm.h: Fix warnings in KfRaiseIrql and RtlExtendedMagicDivide inline implementations
- winnt.h: Simplify definition of GetCurrentFiber
Modified:
branches/cmake-bringup/include/crt/_mingw.h
branches/cmake-bringup/include/crt/crtdefs.h
branches/cmake-bringup/include/crt/msc/intrin.h
branches/cmake-bringup/include/ddk/wdm.h
branches/cmake-bringup/include/psdk/winnt.h
branches/cmake-bringup/include/xdk/amd64/ke.h
branches/cmake-bringup/include/xdk/rtlfuncs.h
Modified: branches/cmake-bringup/include/crt/_mingw.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/crt/_ming…
==============================================================================
--- branches/cmake-bringup/include/crt/_mingw.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/crt/_mingw.h [iso-8859-1] Sat Jan 22 19:17:10 2011
@@ -187,7 +187,7 @@
#endif
#endif
-#ifdef _WIN64
+#if defined(_WIN64) && !defined(_MSC_VER)
#undef USE_MINGW_SETJMP_TWO_ARGS
#define USE_MINGW_SETJMP_TWO_ARGS
#endif
Modified: branches/cmake-bringup/include/crt/crtdefs.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/crt/crtde…
==============================================================================
--- branches/cmake-bringup/include/crt/crtdefs.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/crt/crtdefs.h [iso-8859-1] Sat Jan 22 19:17:10 2011
@@ -133,7 +133,13 @@
#endif
#ifndef _CRT_ALIGN
+#if defined (__midl) || defined(__WIDL__)
+#define _CRT_ALIGN(x)
+#elif defined(_MSC_VER)
+#define _CRT_ALIGN(x) __declspec(align(x))
+#else
#define _CRT_ALIGN(x) __attribute__ ((aligned(x)))
+#endif
#endif
#ifndef _CRTNOALIAS
Modified: branches/cmake-bringup/include/crt/msc/intrin.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/crt/msc/i…
==============================================================================
--- branches/cmake-bringup/include/crt/msc/intrin.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/crt/msc/intrin.h [iso-8859-1] Sat Jan 22 19:17:10 2011
@@ -45,8 +45,6 @@
#pragma intrinsic(_InterlockedXor16)
long _InterlockedXor(volatile long * const value, const long mask);
#pragma intrinsic(_InterlockedXor)
-long _InterlockedAddLargeStatistic(volatile __int64 * const Addend, const long Value);
-#pragma intrinsic(_InterlockedAddLargeStatistic)
long _InterlockedDecrement(volatile long * const lpAddend);
#pragma intrinsic(_InterlockedDecrement)
long _InterlockedIncrement(volatile long * const lpAddend);
@@ -60,7 +58,10 @@
unsigned char _interlockedbittestandset(volatile long * a, const long b);
#pragma intrinsic(_interlockedbittestandset)
-#if defined(_M_AMD64)
+#if defined(_M_IX86)
+long _InterlockedAddLargeStatistic(volatile __int64 * const Addend, const long Value);
+#pragma intrinsic(_InterlockedAddLargeStatistic)
+#elif defined(_M_AMD64)
__int64 _InterlockedExchange64(volatile __int64 * const Target, const __int64 Value);
#pragma intrinsic(_InterlockedExchange64)
__int64 _InterlockedExchangeAdd64(volatile __int64 * const Addend, const __int64 Value);
@@ -71,7 +72,7 @@
#pragma intrinsic(_InterlockedExchangePointer)
__int64 _InterlockedAnd64(volatile __int64 * const value, const __int64 mask);
#pragma intrinsic(_InterlockedAnd64)
-long _InterlockedOr64(volatile __int64 * const value, const __int64 mask);
+__int64 _InterlockedOr64(volatile __int64 * const value, const __int64 mask);
#pragma intrinsic(_InterlockedOr64)
__int64 _InterlockedCompareExchange64(volatile __int64 * const Destination, const __int64
Exchange, const __int64 Comperand);
#pragma intrinsic(_InterlockedCompareExchange64)
@@ -133,7 +134,7 @@
#pragma intrinsic(__addgsqword)
#endif
-//#if defined(_M_IX86)
+#if defined(_M_IX86)
/*** FS segment addressing ***/
void __writefsbyte(const unsigned long Offset, const unsigned char Data);
#pragma intrinsic(__writefsbyte)
@@ -159,7 +160,7 @@
#pragma intrinsic(__addfsword)
void __addfsdword(const unsigned long Offset, const unsigned int Data);
#pragma intrinsic(__addfsdword)
-//#endif
+#endif
/*** Bit manipulation ***/
Modified: branches/cmake-bringup/include/ddk/wdm.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/ddk/wdm.h…
==============================================================================
--- branches/cmake-bringup/include/ddk/wdm.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/ddk/wdm.h [iso-8859-1] Sat Jan 22 19:17:10 2011
@@ -7897,7 +7897,7 @@
{
KIRQL OldIrql;
- OldIrql = __readcr8();
+ OldIrql = (KIRQL)__readcr8();
//ASSERT(OldIrql <= NewIrql);
__writecr8(NewIrql);
return OldIrql;
@@ -9309,7 +9309,7 @@
ret64 = UnsignedMultiplyHigh(Pos ? Dividend.QuadPart : -Dividend.QuadPart,
MagicDivisor.QuadPart);
ret64 >>= ShiftCount;
- ret.QuadPart = Pos ? ret64 : -ret64;
+ ret.QuadPart = Pos ? ret64 : -(LONG64)ret64;
return ret;
}
#endif
Modified: branches/cmake-bringup/include/psdk/winnt.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/psdk/winn…
==============================================================================
--- branches/cmake-bringup/include/psdk/winnt.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/psdk/winnt.h [iso-8859-1] Sat Jan 22 19:17:10 2011
@@ -1361,7 +1361,7 @@
#define SEC_RESERVE 0x04000000
#define SEC_COMMIT 0x08000000
#define SEC_NOCACHE 0x10000000
-#define SEC_WRITECOMBINE 0x40000000
+#define SEC_WRITECOMBINE 0x40000000
#define SEC_LARGE_PAGES 0x80000000
#define SECTION_EXTEND_SIZE 16
#define SECTION_MAP_READ 4
@@ -5097,18 +5097,12 @@
GUID *ObjectType;
} OBJECT_TYPE_LIST, *POBJECT_TYPE_LIST;
-#if defined(__GNUC__)
-
#if defined(_M_IX86)
-static __inline__ PVOID GetCurrentFiber(void)
+FORCEINLINE PVOID GetCurrentFiber(VOID)
{
- void* ret;
- __asm__ __volatile__ (
- "movl %%fs:0x10,%0"
- : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
- );
- return ret;
+ return (PVOID)(ULONG_PTR)__readfsdword(0x10);
}
+
#elif defined (_M_AMD64)
FORCEINLINE PVOID GetCurrentFiber(VOID)
{
@@ -5118,10 +5112,11 @@
return (PVOID)__readgsqword(FIELD_OFFSET(NT_TIB, FiberData));
#endif
}
+
#elif defined (_M_ARM)
PVOID WINAPI GetCurrentFiber(VOID);
-#else
-#if defined(_M_PPC)
+
+#elif defined(_M_PPC)
static __inline__ __attribute__((always_inline)) unsigned long __readfsdword_winnt(const
unsigned long Offset)
{
unsigned long result;
@@ -5133,42 +5128,15 @@
return result;
}
-#else
-#error Unknown architecture
-#endif
static __inline__ PVOID GetCurrentFiber(void)
{
return __readfsdword_winnt(0x10);
}
-#endif
-
-#elif defined(__WATCOMC__)
-
-extern PVOID GetCurrentFiber(void);
-#pragma aux GetCurrentFiber = \
- "mov eax, dword ptr fs:0x10" \
- value [eax] \
- modify [eax];
-
-#elif defined(_MSC_VER)
-
-#if (_MSC_FULL_VER >= 13012035)
-
-__inline PVOID GetCurrentFiber(void) { return (PVOID)(ULONG_PTR)__readfsdword(0x10); }
-
#else
-
-static __inline PVOID GetCurrentFiber(void)
-{
- PVOID p;
- __asm mov eax, fs:[10h]
- __asm mov [p], eax
- return p;
-}
-
-#endif /* _MSC_FULL_VER */
-
-#endif /* __GNUC__/__WATCOMC__/_MSC_VER */
+#error Unknown architecture
+#endif
+
+
#include "inline_ntcurrentteb.h"
Modified: branches/cmake-bringup/include/xdk/amd64/ke.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/xdk/amd64…
==============================================================================
--- branches/cmake-bringup/include/xdk/amd64/ke.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/xdk/amd64/ke.h [iso-8859-1] Sat Jan 22 19:17:10 2011
@@ -67,7 +67,7 @@
{
KIRQL OldIrql;
- OldIrql = __readcr8();
+ OldIrql = (KIRQL)__readcr8();
//ASSERT(OldIrql <= NewIrql);
__writecr8(NewIrql);
return OldIrql;
Modified: branches/cmake-bringup/include/xdk/rtlfuncs.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/xdk/rtlfu…
==============================================================================
--- branches/cmake-bringup/include/xdk/rtlfuncs.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/xdk/rtlfuncs.h [iso-8859-1] Sat Jan 22 19:17:10 2011
@@ -2630,7 +2630,7 @@
ret64 = UnsignedMultiplyHigh(Pos ? Dividend.QuadPart : -Dividend.QuadPart,
MagicDivisor.QuadPart);
ret64 >>= ShiftCount;
- ret.QuadPart = Pos ? ret64 : -ret64;
+ ret.QuadPart = Pos ? ret64 : -(LONG64)ret64;
return ret;
}
#endif