Author: tkreuzer
Date: Tue Aug 23 08:42:13 2011
New Revision: 53397
URL:
http://svn.reactos.org/svn/reactos?rev=53397&view=rev
Log:
[INTRIN]
- Deconstify most parameters in the intrinsics.
- add __movsq, _bittest64, __umulh
Modified:
trunk/reactos/include/crt/msc/intrin.h
Modified: trunk/reactos/include/crt/msc/intrin.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/msc/intrin.h?r…
==============================================================================
--- trunk/reactos/include/crt/msc/intrin.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/msc/intrin.h [iso-8859-1] Tue Aug 23 08:42:13 2011
@@ -32,160 +32,164 @@
#endif
/*** Atomic operations ***/
-long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange,
const long Comperand);
+long _InterlockedCompareExchange(volatile long * Destination, long Exchange, long
Comperand);
#pragma intrinsic(_InterlockedCompareExchange)
-long _InterlockedExchange(volatile long * const Target, const long Value);
+long _InterlockedExchange(volatile long * Target, long Value);
#pragma intrinsic(_InterlockedExchange)
-long _InterlockedExchangeAdd(volatile long * const Addend, const long Value);
+long _InterlockedExchangeAdd(volatile long * Addend, long Value);
#pragma intrinsic(_InterlockedExchangeAdd)
-char _InterlockedAnd8(volatile char * const value, const char mask);
+char _InterlockedAnd8(volatile char * value, char mask);
#pragma intrinsic(_InterlockedAnd8)
-short _InterlockedAnd16(volatile short * const value, const short mask);
+short _InterlockedAnd16(volatile short * value, short mask);
#pragma intrinsic(_InterlockedAnd16)
-long _InterlockedAnd(volatile long * const value, const long mask);
+long _InterlockedAnd(volatile long * value, long mask);
#pragma intrinsic(_InterlockedAnd)
-char _InterlockedOr8(volatile char * const value, const char mask);
+char _InterlockedOr8(volatile char * value, char mask);
#pragma intrinsic(_InterlockedOr8)
-short _InterlockedOr16(volatile short * const value, const short mask);
+short _InterlockedOr16(volatile short * value, short mask);
#pragma intrinsic(_InterlockedOr16)
-long _InterlockedOr(volatile long * const value, const long mask);
+long _InterlockedOr(volatile long * value, long mask);
#pragma intrinsic(_InterlockedOr)
-char _InterlockedXor8(volatile char * const value, const char mask);
+char _InterlockedXor8(volatile char * value, char mask);
#pragma intrinsic(_InterlockedXor8)
-short _InterlockedXor16(volatile short * const value, const short mask);
+short _InterlockedXor16(volatile short * value, short mask);
#pragma intrinsic(_InterlockedXor16)
-long _InterlockedXor(volatile long * const value, const long mask);
+long _InterlockedXor(volatile long * value, long mask);
#pragma intrinsic(_InterlockedXor)
-long _InterlockedDecrement(volatile long * const lpAddend);
+long _InterlockedDecrement(volatile long * lpAddend);
#pragma intrinsic(_InterlockedDecrement)
-long _InterlockedIncrement(volatile long * const lpAddend);
+long _InterlockedIncrement(volatile long * lpAddend);
#pragma intrinsic(_InterlockedIncrement)
-short _InterlockedDecrement16(volatile short * const lpAddend);
+short _InterlockedDecrement16(volatile short * lpAddend);
#pragma intrinsic(_InterlockedDecrement16)
-short _InterlockedIncrement16(volatile short * const lpAddend);
+short _InterlockedIncrement16(volatile short * lpAddend);
#pragma intrinsic(_InterlockedIncrement16)
-unsigned char _interlockedbittestandreset(volatile long * a, const long b);
+unsigned char _interlockedbittestandreset(volatile long * a, long b);
#pragma intrinsic(_interlockedbittestandreset)
-unsigned char _interlockedbittestandset(volatile long * a, const long b);
+unsigned char _interlockedbittestandset(volatile long * a, long b);
#pragma intrinsic(_interlockedbittestandset)
#if defined(_M_IX86)
-long _InterlockedAddLargeStatistic(volatile __int64 * const Addend, const long Value);
+long _InterlockedAddLargeStatistic(volatile __int64 * Addend, long Value);
#pragma intrinsic(_InterlockedAddLargeStatistic)
#elif defined(_M_AMD64)
-__int64 _InterlockedExchange64(volatile __int64 * const Target, const __int64 Value);
+__int64 _InterlockedExchange64(volatile __int64 * Target, __int64 Value);
#pragma intrinsic(_InterlockedExchange64)
-__int64 _InterlockedExchangeAdd64(volatile __int64 * const Addend, const __int64 Value);
+__int64 _InterlockedExchangeAdd64(volatile __int64 * Addend, __int64 Value);
#pragma intrinsic(_InterlockedExchangeAdd64)
-void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void *
const Exchange, void * const Comperand);
+void * _InterlockedCompareExchangePointer(void * volatile * Destination, void * Exchange,
void * Comperand);
#pragma intrinsic(_InterlockedCompareExchangePointer)
-void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value);
+void * _InterlockedExchangePointer(void * volatile * Target, void * Value);
#pragma intrinsic(_InterlockedExchangePointer)
-__int64 _InterlockedAnd64(volatile __int64 * const value, const __int64 mask);
+__int64 _InterlockedAnd64(volatile __int64 * value, __int64 mask);
#pragma intrinsic(_InterlockedAnd64)
-__int64 _InterlockedOr64(volatile __int64 * const value, const __int64 mask);
+__int64 _InterlockedOr64(volatile __int64 * value, __int64 mask);
#pragma intrinsic(_InterlockedOr64)
-__int64 _InterlockedCompareExchange64(volatile __int64 * const Destination, const __int64
Exchange, const __int64 Comperand);
+__int64 _InterlockedCompareExchange64(volatile __int64 * Destination, __int64 Exchange,
__int64 Comperand);
#pragma intrinsic(_InterlockedCompareExchange64)
-__int64 _InterlockedDecrement64(volatile __int64 * const lpAddend);
+__int64 _InterlockedDecrement64(volatile __int64 * lpAddend);
#pragma intrinsic(_InterlockedDecrement64)
-__int64 _InterlockedIncrement64(volatile __int64 * const lpAddend);
+__int64 _InterlockedIncrement64(volatile __int64 * lpAddend);
#pragma intrinsic(_InterlockedIncrement64)
-unsigned char _interlockedbittestandreset64(volatile __int64 * a, const __int64 b);
+unsigned char _interlockedbittestandreset64(volatile __int64 * a, __int64 b);
#pragma intrinsic(_interlockedbittestandreset64)
-unsigned char _interlockedbittestandset64(volatile __int64 * a, const __int64 b);
+unsigned char _interlockedbittestandset64(volatile __int64 * a, __int64 b);
#pragma intrinsic(_interlockedbittestandset64)
#endif
/*** String operations ***/
-void __stosb(unsigned char * Dest, const unsigned char Data, size_t Count);
+void __stosb(unsigned char * Dest, unsigned char Data, size_t Count);
#pragma intrinsic(__stosb)
-void __stosw(unsigned short * Dest, const unsigned short Data, size_t Count);
+void __stosw(unsigned short * Dest, unsigned short Data, size_t Count);
#pragma intrinsic(__stosw)
-void __stosd(unsigned long * Dest, const unsigned long Data, size_t Count);
+void __stosd(unsigned long * Dest, unsigned long Data, size_t Count);
#pragma intrinsic(__stosd)
-void __movsb(unsigned char * Destination, const unsigned char * Source, size_t Count);
+void __movsb(unsigned char * Destination, unsigned char const * Source, size_t Count);
#pragma intrinsic(__movsb)
-void __movsw(unsigned short * Destination, const unsigned short * Source, size_t Count);
+void __movsw(unsigned short * Destination, unsigned short const * Source, size_t Count);
#pragma intrinsic(__movsw)
-void __movsd(unsigned long * Destination, const unsigned long * Source, size_t Count);
+void __movsd(unsigned long * Destination, unsigned long const * Source, size_t Count);
#pragma intrinsic(__movsd)
+#ifdef _M_AMD64
+void __movsq(unsigned __int64 * Destination, unsigned __int64 const * Source, size_t
Count);
+#pragma intrinsic(__movsq)
+#endif
#if defined(_M_AMD64)
/*** GS segment addressing ***/
-void __writegsbyte(const unsigned long Offset, const unsigned char Data);
+void __writegsbyte(unsigned long Offset, unsigned char Data);
#pragma intrinsic(__writegsbyte)
-void __writegsword(const unsigned long Offset, const unsigned short Data);
+void __writegsword(unsigned long Offset, unsigned short Data);
#pragma intrinsic(__writegsword)
-void __writegsdword(const unsigned long Offset, const unsigned long Data);
+void __writegsdword(unsigned long Offset, unsigned long Data);
#pragma intrinsic(__writegsdword)
-void __writegsqword(const unsigned long Offset, const unsigned __int64 Data);
+void __writegsqword(unsigned long Offset, unsigned __int64 Data);
#pragma intrinsic(__writegsqword)
-unsigned char __readgsbyte(const unsigned long Offset);
+unsigned char __readgsbyte(unsigned long Offset);
#pragma intrinsic(__readgsbyte)
-unsigned short __readgsword(const unsigned long Offset);
+unsigned short __readgsword(unsigned long Offset);
#pragma intrinsic(__readgsword)
-unsigned long __readgsdword(const unsigned long Offset);
+unsigned long __readgsdword(unsigned long Offset);
#pragma intrinsic(__readgsdword)
-unsigned __int64 __readgsqword(const unsigned long Offset);
+unsigned __int64 __readgsqword(unsigned long Offset);
#pragma intrinsic(__readgsqword)
-void __incgsbyte(const unsigned long Offset);
+void __incgsbyte(unsigned long Offset);
#pragma intrinsic(__incgsbyte)
-void __incgsword(const unsigned long Offset);
+void __incgsword(unsigned long Offset);
#pragma intrinsic(__incgsword)
-void __incgsdword(const unsigned long Offset);
+void __incgsdword(unsigned long Offset);
#pragma intrinsic(__incgsdword)
-void __addgsbyte(const unsigned long Offset, const unsigned char Data);
+void __addgsbyte(unsigned long Offset, unsigned char Data);
#pragma intrinsic(__addgsbyte)
-void __addgsword(const unsigned long Offset, const unsigned short Data);
+void __addgsword(unsigned long Offset, unsigned short Data);
#pragma intrinsic(__addgsword)
-void __addgsdword(const unsigned long Offset, const unsigned int Data);
+void __addgsdword(unsigned long Offset, unsigned int Data);
#pragma intrinsic(__addgsdword)
-void __addgsqword(const unsigned long Offset, const unsigned __int64 Data);
+void __addgsqword(unsigned long Offset, unsigned __int64 Data);
#pragma intrinsic(__addgsqword)
#endif
#if defined(_M_IX86)
/*** FS segment addressing ***/
-void __writefsbyte(const unsigned long Offset, const unsigned char Data);
+void __writefsbyte(unsigned long Offset, unsigned char Data);
#pragma intrinsic(__writefsbyte)
-void __writefsword(const unsigned long Offset, const unsigned short Data);
+void __writefsword(unsigned long Offset, unsigned short Data);
#pragma intrinsic(__writefsword)
-void __writefsdword(const unsigned long Offset, const unsigned long Data);
+void __writefsdword(unsigned long Offset, unsigned long Data);
#pragma intrinsic(__writefsdword)
-unsigned char __readfsbyte(const unsigned long Offset);
+unsigned char __readfsbyte(unsigned long Offset);
#pragma intrinsic(__readfsbyte)
-unsigned short __readfsword(const unsigned long Offset);
+unsigned short __readfsword(unsigned long Offset);
#pragma intrinsic(__readfsword)
-unsigned long __readfsdword(const unsigned long Offset);
+unsigned long __readfsdword(unsigned long Offset);
#pragma intrinsic(__readfsdword)
-void __incfsbyte(const unsigned long Offset);
+void __incfsbyte(unsigned long Offset);
#pragma intrinsic(__incfsbyte)
-void __incfsword(const unsigned long Offset);
+void __incfsword(unsigned long Offset);
#pragma intrinsic(__incfsword)
-void __incfsdword(const unsigned long Offset);
+void __incfsdword(unsigned long Offset);
#pragma intrinsic(__incfsdword)
-void __addfsbyte(const unsigned long Offset, const unsigned char Data);
+void __addfsbyte(unsigned long Offset, unsigned char Data);
#pragma intrinsic(__addfsbyte)
-void __addfsword(const unsigned long Offset, const unsigned short Data);
+void __addfsword(unsigned long Offset, unsigned short Data);
#pragma intrinsic(__addfsword)
-void __addfsdword(const unsigned long Offset, const unsigned int Data);
+void __addfsdword(unsigned long Offset, unsigned int Data);
#pragma intrinsic(__addfsdword)
#endif
/*** Bit manipulation ***/
-unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask);
+unsigned char _BitScanForward(unsigned long * Index, unsigned long Mask);
#pragma intrinsic(_BitScanForward)
-unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask);
+unsigned char _BitScanReverse(unsigned long * Index, unsigned long Mask);
#pragma intrinsic(_BitScanReverse)
-unsigned char _bittest(const long * const a, const long b);
+unsigned char _bittest(const long * a, long b);
#pragma intrinsic(_bittest)
-unsigned char _bittestandcomplement(long * const a, const long b);
+unsigned char _bittestandcomplement(long * a, long b);
#pragma intrinsic(_bittestandcomplement)
-unsigned char _bittestandreset(long * const a, const long b);
+unsigned char _bittestandreset(long * a, long b);
#pragma intrinsic(_bittestandreset)
-unsigned char _bittestandset(long * const a, const long b);
+unsigned char _bittestandset(long * a, long b);
#pragma intrinsic(_bittestandset)
unsigned char _rotl8(unsigned char value, unsigned char shift);
#pragma intrinsic(_rotl8)
@@ -199,11 +203,11 @@
#pragma intrinsic(_rotr8)
unsigned short _rotr16(unsigned short value, unsigned char shift);
#pragma intrinsic(_rotr16)
-unsigned __int64 __ll_lshift(const unsigned __int64 Mask, const int Bit);
+unsigned __int64 __ll_lshift(unsigned __int64 Mask, int Bit);
#pragma intrinsic(__ll_lshift)
-__int64 __ll_rshift(const __int64 Mask, const int Bit);
+__int64 __ll_rshift(__int64 Mask, int Bit);
#pragma intrinsic(__ll_rshift)
-unsigned __int64 __ull_rshift(const unsigned __int64 Mask, int Bit);
+unsigned __int64 __ull_rshift(unsigned __int64 Mask, int Bit);
#pragma intrinsic(__ull_rshift)
unsigned short _byteswap_ushort(unsigned short value);
#pragma intrinsic(_byteswap_ushort)
@@ -211,19 +215,27 @@
#pragma intrinsic(_byteswap_ulong)
unsigned __int64 _byteswap_uint64(unsigned __int64 value);
#pragma intrinsic(_byteswap_uint64)
+#ifdef _M_AMD64
+unsigned char _bittest64(__int64 *a, __int64 b);
+#pragma intrinsic(_bittest64)
+#endif
/*** 64-bit math ***/
-__int64 __emul(const int a, const int b);
+__int64 __emul(int a, int b);
#pragma intrinsic(__emul)
-unsigned __int64 __emulu(const unsigned int a, const unsigned int b);
+unsigned __int64 __emulu(unsigned int a, unsigned int b);
#pragma intrinsic(__emulu)
+#ifdef _M_AMD64
+unsigned __int64 __umulh(unsigned __int64 a, unsigned __int64 b);
+#pragma intrinsic(__umulh)
+#endif
/*** Port I/O ***/
-unsigned char __inbyte(const unsigned short Port);
+unsigned char __inbyte(unsigned short Port);
#pragma intrinsic(__inbyte)
-unsigned short __inword(const unsigned short Port);
+unsigned short __inword(unsigned short Port);
#pragma intrinsic(__inword)
-unsigned long __indword(const unsigned short Port);
+unsigned long __indword(unsigned short Port);
#pragma intrinsic(__indword)
void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count);
#pragma intrinsic(__inbytestring)
@@ -231,21 +243,21 @@
#pragma intrinsic(__inwordstring)
void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count);
#pragma intrinsic(__indwordstring)
-void __outbyte(unsigned short const Port, const unsigned char Data);
+void __outbyte(unsigned short Port, unsigned char Data);
#pragma intrinsic(__outbyte)
-void __outword(unsigned short const Port, const unsigned short Data);
+void __outword(unsigned short Port, unsigned short Data);
#pragma intrinsic(__outword)
-void __outdword(unsigned short const Port, const unsigned long Data);
+void __outdword(unsigned short Port, unsigned long Data);
#pragma intrinsic(__outdword)
-void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const
unsigned long Count);
+void __outbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count);
#pragma intrinsic(__outbytestring)
-void __outwordstring(unsigned short const Port, const unsigned short * const Buffer,
const unsigned long Count);
+void __outwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count);
#pragma intrinsic(__outwordstring)
-void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer,
const unsigned long Count);
+void __outdwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count);
#pragma intrinsic(__outdwordstring)
/*** System information ***/
-void __cpuid(int CPUInfo[], const int InfoType);
+void __cpuid(int CPUInfo[], int InfoType);
#pragma intrinsic(__cpuid)
unsigned __int64 __rdtsc(void);
#pragma intrinsic(__rdtsc)
@@ -267,15 +279,15 @@
#pragma intrinsic(__halt)
/*** Protected memory management ***/
-void __writecr0(const unsigned __int64 Data);
+void __writecr0(unsigned __int64 Data);
#pragma intrinsic(__writecr0)
-void __writecr3(const unsigned __int64 Data);
+void __writecr3(unsigned __int64 Data);
#pragma intrinsic(__writecr3)
-void __writecr4(const unsigned __int64 Data);
+void __writecr4(unsigned __int64 Data);
#pragma intrinsic(__writecr4)
#ifdef _M_AMD64
-void __writecr8(const unsigned __int64 Data);
+void __writecr8(unsigned __int64 Data);
#pragma intrinsic(__writecr8)
unsigned __int64 __readcr0(void);
#pragma intrinsic(__readcr0)
@@ -305,7 +317,7 @@
void __writedr(unsigned reg, unsigned int value);
#endif
-void __invlpg(void * const Address);
+void __invlpg(void * Address);
#pragma intrinsic(__invlpg)
#ifdef _M_IX86
@@ -313,7 +325,7 @@
// when optimization is enabled!
#pragma warning(push)
#pragma warning(disable:4711)
-void __forceinline __invlpg_fixed(void * const Address)
+void __forceinline __invlpg_fixed(void * Address)
{
_ReadWriteBarrier();
__asm
@@ -328,13 +340,13 @@
#endif
/*** System operations ***/
-unsigned __int64 __readmsr(const int reg);
+unsigned __int64 __readmsr(int reg);
#pragma intrinsic(__readmsr)
-void __writemsr(const unsigned long Register, const unsigned __int64 Value);
+void __writemsr(unsigned long Register, unsigned __int64 Value);
#pragma intrinsic(__writemsr)
-unsigned __int64 __readpmc(const int counter);
+unsigned __int64 __readpmc(int counter);
#pragma intrinsic(__readpmc)
-unsigned long __segmentlimit(const unsigned long a);
+unsigned long __segmentlimit(unsigned long a);
#pragma intrinsic(__segmentlimit)
void __wbinvd(void);
#pragma intrinsic(__wbinvd)