Author: sginsberg Date: Sat Aug 8 20:27:01 2009 New Revision: 42531
URL: http://svn.reactos.org/svn/reactos?rev=42531&view=rev Log: Fix Uniata for msvc: - Add missing msvc intrinsics to winddk.h - Don't assume compiler means a specific header set, and don't rely on the default calling convention being stdcall. - Disable a warning spotted by MSVC -- requesting anyone with understanding of the code to have a look.
Modified: trunk/reactos/drivers/storage/ide/uniata/config.h trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp trunk/reactos/drivers/storage/ide/uniata/ntddk_ex.h trunk/reactos/include/ddk/winddk.h
Modified: trunk/reactos/drivers/storage/ide/uniata/config.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata/... ============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/config.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/config.h [iso-8859-1] Sat Aug 8 20:27:01 2009 @@ -86,47 +86,21 @@ /* Compiler dependencies */ /***************************************************/
-/* ReactOS-specific defines */ -#ifdef DDKAPI - #define USE_REACTOS_DDK -#endif //DDKAPI +#define DDKAPI __stdcall +#define DDKFASTAPI __fastcall +#define DDKCDECLAPI __cdecl
/* Are we under GNU C (mingw) ??? */ -#if __GNUC__ >=3 +#ifdef __GNUC__
#define DEF_U64(x) (x##ULL) #define DEF_I64(x) (x##LL) - - /* ReactOS-specific defines */ - #ifdef USE_REACTOS_DDK - #define DDKFASTAPI __attribute__((fastcall)) - #else //USE_REACTOS_DDK - - #define DDKAPI __attribute__((stdcall)) - #define DDKFASTAPI __attribute__((fastcall)) - #define DDKCDECLAPI __attribute__((cdecl)) - - #endif //DDKAPI - - #define DECLSPEC_NAKED __attribute__((naked))
#else // !__GNUC__ => MSVC/Intel
#define DEF_U64(x) (x##UI64) #define DEF_I64(x) (x##I64)
- /* ReactOS-specific defines */ - #ifdef USE_REACTOS_DDK - #else //USE_REACTOS_DDK - - #define DDKAPI __stdcall - #define DDKFASTAPI __fastcall - #define DDKCDECLAPI _cdecl - - #endif //DDKAPI - - #define DECLSPEC_NAKED __declspec(naked) - #endif //__GNUC__
Modified: trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata/... ============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp [iso-8859-1] Sat Aug 8 20:27:01 2009 @@ -425,7 +425,15 @@ deviceExtension->lun[ldev].IdentifyData.FeaturesSupport.Address48) { i++; } else { +#ifdef _MSC_VER +#pragma message ("HACK HACK HACK Disabling warning HACK HACK HACK") +#pragma warning(push) +#pragma warning(disable:4333) +#endif fis[7] |= (plba[3] >> 24) & 0x0f; +#ifdef _MSC_VER +#pragma warning(pop) +#endif }
fis[8] = plba[3];
Modified: trunk/reactos/drivers/storage/ide/uniata/ntddk_ex.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata/... ============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/ntddk_ex.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/ntddk_ex.h [iso-8859-1] Sat Aug 8 20:27:01 2009 @@ -629,12 +629,14 @@
NTHALAPI VOID +NTAPI HalDisplayString ( PUCHAR String );
NTHALAPI VOID +NTAPI HalQueryDisplayParameters ( OUT PULONG WidthInCharacters, OUT PULONG HeightInLines, @@ -644,6 +646,7 @@
NTHALAPI VOID +NTAPI HalSetDisplayParameters ( IN ULONG CursorColumn, IN ULONG CursorRow
Modified: trunk/reactos/include/ddk/winddk.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=42... ============================================================================== --- trunk/reactos/include/ddk/winddk.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/winddk.h [iso-8859-1] Sat Aug 8 20:27:01 2009 @@ -33,6 +33,24 @@
#ifdef __GNUC__ #include "intrin.h" +#endif + +#ifdef _MSC_VER +// +// FIXME: MSVC Intrinsics +// +unsigned char __readfsbyte(const unsigned long Offset); +#pragma intrinsic(__readfsbyte) +long _InterlockedExchange(volatile long * const Target, const long Value); +#pragma intrinsic(_InterlockedExchange) +long _InterlockedExchangeAdd(volatile long * const Addend, const long Value); +#pragma intrinsic(_InterlockedExchangeAdd) +long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand); +#pragma intrinsic(_InterlockedCompareExchange) +long _InterlockedDecrement(volatile long * const lpAddend); +#pragma intrinsic(_InterlockedDecrement) +long _InterlockedIncrement(volatile long * const lpAddend); +#pragma intrinsic(_InterlockedIncrement) #endif
#if !defined(_NTHAL_) @@ -5116,15 +5134,6 @@ ULONG Spare1; } KFLOATING_SAVE, *PKFLOATING_SAVE;
-#ifdef _MSC_VER -// -// FIXME: Intrinsics -// -unsigned char __readfsbyte(const unsigned long Offset); -#pragma intrinsic(__readfsbyte) -#endif - - FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)