Author: tkreuzer
Date: Tue Feb 3 13:55:11 2009
New Revision: 39347
URL:
http://svn.reactos.org/svn/reactos?rev=39347&view=rev
Log:
[DDK] Move rtl byteswap functions to wdm.h and add intrinsic definitions
Modified:
branches/ros-amd64-bringup/reactos/include/ddk/wdm.h
branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
Modified: branches/ros-amd64-bringup/reactos/include/ddk/wdm.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ddk/wdm.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/ddk/wdm.h [iso-8859-1] Tue Feb 3 13:55:11
2009
@@ -630,5 +630,48 @@
#define QUOTA_LIMITS_USE_DEFAULT_LIMITS 0x00000010
+//
+// Byte Swap Functions
+//
+#if (defined(_M_IX86) && (_MSC_FULL_VER > 13009037)) || \
+ ((defined(_M_AMD64) || \
+ defined(_M_IA64)) && (_MSC_FULL_VER > 13009175))
+
+unsigned short __cdecl _byteswap_ushort(unsigned short);
+unsigned long __cdecl _byteswap_ulong (unsigned long);
+unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64);
+#pragma intrinsic(_byteswap_ushort)
+#pragma intrinsic(_byteswap_ulong)
+#pragma intrinsic(_byteswap_uint64)
+#define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x))
+#define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
+#define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
+
+#elif defined(__GNUC__)
+
+#define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x))
+#define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
+#define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
+
+#else
+
+#if (NTDDI_VERSION >= NTDDI_WIN2K)
+NTSYSAPI
+USHORT
+FASTCALL
+RtlUshortByteSwap(IN USHORT Source);
+
+NTSYSAPI
+ULONG
+FASTCALL
+RtlUlongByteSwap(IN ULONG Source);
+
+NTSYSAPI
+ULONGLONG
+FASTCALL
+RtlUlonglongByteSwap(IN ULONGLONG Source);
+#endif
+
+#endif
#endif // _WDMDDK_
Modified: branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ddk/winddk.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/ddk/winddk.h [iso-8859-1] Tue Feb 3
13:55:11 2009
@@ -7183,16 +7183,6 @@
IN PLARGE_INTEGER Time,
IN PTIME_FIELDS TimeFields);
-ULONG
-FASTCALL
-RtlUlongByteSwap(
- IN ULONG Source);
-
-ULONGLONG
-FASTCALL
-RtlUlonglongByteSwap(
- IN ULONGLONG Source);
-
#define RtlUnicodeStringToAnsiSize(STRING) ( \
NLS_MB_CODE_PAGE_TAG ? \
RtlxUnicodeStringToAnsiSize(STRING) : \
@@ -7263,11 +7253,6 @@
RtlUpperString(
IN OUT PSTRING DestinationString,
IN PSTRING SourceString);
-
-USHORT
-FASTCALL
-RtlUshortByteSwap(
- IN USHORT Source);
NTSYSAPI
BOOLEAN