[XDK/DDK]

- Remove useless inline definition of InterlockedBitTestAnd(Re)Set, which was not used anyway.
- Update template for ntdef.h

svn path=/trunk/; revision=64046
This commit is contained in:
Timo Kreuzer 2014-09-05 21:54:49 +00:00
parent b411c4825b
commit c8e3595247
4 changed files with 8 additions and 93 deletions

View file

@ -235,51 +235,6 @@ inline int IsEqualGUIDAligned(REFGUID guid1, REFGUID guid2)
/****************************************************************************** /******************************************************************************
* INTERLOCKED Functions * * INTERLOCKED Functions *
******************************************************************************/ ******************************************************************************/
//
// Intrinsics (note: taken from our winnt.h)
// FIXME: 64-bit
//
#if defined(__GNUC__)
static __inline__ BOOLEAN
InterlockedBitTestAndSet(
_Inout_updates_bytes_((Bit+7)/8) _Interlocked_operand_ LONG volatile *Base,
_In_ LONG Bit)
{
#if defined(_M_IX86)
LONG OldBit;
__asm__ __volatile__("lock "
"btsl %2,%1\n\t"
"sbbl %0,%0\n\t"
:"=r" (OldBit),"+m" (*Base)
:"Ir" (Bit)
: "memory");
return OldBit;
#else
return (_InterlockedOr(Base, 1 << Bit) >> Bit) & 1;
#endif
}
static __inline__ BOOLEAN
InterlockedBitTestAndReset(
_Inout_updates_bytes_((Bit+7)/8) _Interlocked_operand_ LONG volatile *Base,
_In_ LONG Bit)
{
#if defined(_M_IX86)
LONG OldBit;
__asm__ __volatile__("lock "
"btrl %2,%1\n\t"
"sbbl %0,%0\n\t"
:"=r" (OldBit),"+m" (*Base)
:"Ir" (Bit)
: "memory");
return OldBit;
#else
return (_InterlockedAnd(Base, ~(1 << Bit)) >> Bit) & 1;
#endif
}
#endif /* defined(__GNUC__) */
#define BitScanForward _BitScanForward #define BitScanForward _BitScanForward
#define BitScanReverse _BitScanReverse #define BitScanReverse _BitScanReverse
@ -16136,6 +16091,7 @@ typedef struct _TRANSACTIONMANAGER_RECOVERY_INFORMATION {
ULONGLONG LastRecoveredLsn; ULONGLONG LastRecoveredLsn;
} TRANSACTIONMANAGER_RECOVERY_INFORMATION, *PTRANSACTIONMANAGER_RECOVERY_INFORMATION; } TRANSACTIONMANAGER_RECOVERY_INFORMATION, *PTRANSACTIONMANAGER_RECOVERY_INFORMATION;
typedef struct _TRANSACTION_PROPERTIES_INFORMATION { typedef struct _TRANSACTION_PROPERTIES_INFORMATION {
ULONG IsolationLevel; ULONG IsolationLevel;
ULONG IsolationFlags; ULONG IsolationFlags;
@ -16184,7 +16140,7 @@ typedef enum _KTMOBJECT_TYPE {
typedef struct _KTMOBJECT_CURSOR { typedef struct _KTMOBJECT_CURSOR {
GUID LastQuery; GUID LastQuery;
ULONG ObjectIdCount; unsigned long ObjectIdCount;
GUID ObjectIds[1]; GUID ObjectIds[1];
} KTMOBJECT_CURSOR, *PKTMOBJECT_CURSOR; } KTMOBJECT_CURSOR, *PKTMOBJECT_CURSOR;
@ -16192,14 +16148,14 @@ typedef enum _TRANSACTION_INFORMATION_CLASS {
TransactionBasicInformation, TransactionBasicInformation,
TransactionPropertiesInformation, TransactionPropertiesInformation,
TransactionEnlistmentInformation, TransactionEnlistmentInformation,
TransactionSuperiorEnlistmentInformation TransactionSuperiorEnlistmentInformation,
} TRANSACTION_INFORMATION_CLASS; } TRANSACTION_INFORMATION_CLASS;
typedef enum _TRANSACTIONMANAGER_INFORMATION_CLASS { typedef enum _TRANSACTIONMANAGER_INFORMATION_CLASS {
TransactionManagerBasicInformation, TransactionManagerBasicInformation,
TransactionManagerLogInformation, TransactionManagerLogInformation,
TransactionManagerLogPathInformation, TransactionManagerLogPathInformation,
TransactionManagerRecoveryInformation = 4 TransactionManagerRecoveryInformation = 4,
} TRANSACTIONMANAGER_INFORMATION_CLASS; } TRANSACTIONMANAGER_INFORMATION_CLASS;
typedef enum _RESOURCEMANAGER_INFORMATION_CLASS { typedef enum _RESOURCEMANAGER_INFORMATION_CLASS {

View file

@ -4,3 +4,5 @@ hpp.exe wdm.template.h wdm.h
hpp.exe ntddk.template.h ntddk.h hpp.exe ntddk.template.h ntddk.h
hpp.exe ntifs.template.h ntifs.h hpp.exe ntifs.template.h ntifs.h
hpp.exe devioctl.template.h devioctl.h hpp.exe devioctl.template.h devioctl.h
hpp.exe ntdef.template.h ..\psdk\ntdef.h
hpp.exe winnt.template.h ..\psdk\winnt.h

View file

@ -1,51 +1,6 @@
/****************************************************************************** /******************************************************************************
* INTERLOCKED Functions * * INTERLOCKED Functions *
******************************************************************************/ ******************************************************************************/
//
// Intrinsics (note: taken from our winnt.h)
// FIXME: 64-bit
//
#if defined(__GNUC__)
static __inline__ BOOLEAN
InterlockedBitTestAndSet(
_Inout_updates_bytes_((Bit+7)/8) _Interlocked_operand_ LONG volatile *Base,
_In_ LONG Bit)
{
#if defined(_M_IX86)
LONG OldBit;
__asm__ __volatile__("lock "
"btsl %2,%1\n\t"
"sbbl %0,%0\n\t"
:"=r" (OldBit),"+m" (*Base)
:"Ir" (Bit)
: "memory");
return OldBit;
#else
return (_InterlockedOr(Base, 1 << Bit) >> Bit) & 1;
#endif
}
static __inline__ BOOLEAN
InterlockedBitTestAndReset(
_Inout_updates_bytes_((Bit+7)/8) _Interlocked_operand_ LONG volatile *Base,
_In_ LONG Bit)
{
#if defined(_M_IX86)
LONG OldBit;
__asm__ __volatile__("lock "
"btrl %2,%1\n\t"
"sbbl %0,%0\n\t"
:"=r" (OldBit),"+m" (*Base)
:"Ir" (Bit)
: "memory");
return OldBit;
#else
return (_InterlockedAnd(Base, ~(1 << Bit)) >> Bit) & 1;
#endif
}
#endif /* defined(__GNUC__) */
#define BitScanForward _BitScanForward #define BitScanForward _BitScanForward
#define BitScanReverse _BitScanReverse #define BitScanReverse _BitScanReverse

View file

@ -24,7 +24,9 @@
/* Dependencies */ /* Dependencies */
#include <ctype.h> #include <ctype.h>
$if(0)
//#include <winapifamily.h> //#include <winapifamily.h>
$endif()
#include <basetsd.h> #include <basetsd.h>
#include <guiddef.h> #include <guiddef.h>
#include <excpt.h> #include <excpt.h>