From: <se...@us...> - 2013-07-07 09:12:50
|
Revision: 5936 http://sourceforge.net/p/mingw-w64/code/5936 Author: sezero Date: 2013-07-07 09:12:42 +0000 (Sun, 07 Jul 2013) Log Message: ----------- * ntdef.h: add missing MAX_NATURAL_ALIGNMENT, MEMORY_ALLOCATION_ALIGNMENT, SYSTEM_CACHE_ALIGNMENT_SIZE, DECLSPEC_CACHEALIGN, DECLSPEC_SELECTANY, RTL_FIELD_TYPE, RTL_BITS_OF and RTL_BITS_OF_FIELD macros from r/os svn. * wdm.h: define LOOKASIDE_ALIGN as DECLSPEC_CACHEALIGN (r/os svn: r59431.) Revision Links: -------------- http://sourceforge.net/p/mingw-w64/code/59431 Modified Paths: -------------- trunk/mingw-w64-headers/ddk/include/ddk/wdm.h trunk/mingw-w64-headers/include/ntdef.h Modified: trunk/mingw-w64-headers/ddk/include/ddk/wdm.h =================================================================== --- trunk/mingw-w64-headers/ddk/include/ddk/wdm.h 2013-07-05 09:14:56 UTC (rev 5935) +++ trunk/mingw-w64-headers/ddk/include/ddk/wdm.h 2013-07-07 09:12:42 UTC (rev 5936) @@ -1749,7 +1749,7 @@ #if !defined(_WIN64) && (defined(_NTDDK_) || defined(_NTIFS_) || defined(_NDIS_)) #define LOOKASIDE_ALIGN #else -#define LOOKASIDE_ALIGN /* FIXME: DECLSPEC_CACHEALIGN */ +#define LOOKASIDE_ALIGN DECLSPEC_CACHEALIGN #endif typedef struct _LOOKASIDE_LIST_EX *PLOOKASIDE_LIST_EX; Modified: trunk/mingw-w64-headers/include/ntdef.h =================================================================== --- trunk/mingw-w64-headers/include/ntdef.h 2013-07-05 09:14:56 UTC (rev 5935) +++ trunk/mingw-w64-headers/include/ntdef.h 2013-07-07 09:12:42 UTC (rev 5936) @@ -131,6 +131,14 @@ #define UNALIGNED64 #endif +#if defined(_WIN64) || defined(_M_ALPHA) +#define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG) +#define MEMORY_ALLOCATION_ALIGNMENT 16 +#else +#define MAX_NATURAL_ALIGNMENT sizeof(ULONG) +#define MEMORY_ALLOCATION_ALIGNMENT 8 +#endif + #if defined(_M_MRX000) && !(defined(MIDL_PASS) || defined(RC_INVOKED)) && defined(ENABLE_RESTRICTED) #define RESTRICTED_POINTER __restrict #else @@ -247,6 +255,26 @@ #endif #endif /* DECLSPEC_ALIGN */ +#ifndef SYSTEM_CACHE_ALIGNMENT_SIZE +#if defined(_AMD64_) || defined(_X86_) +#define SYSTEM_CACHE_ALIGNMENT_SIZE 64 +#else +#define SYSTEM_CACHE_ALIGNMENT_SIZE 128 +#endif +#endif + +#ifndef DECLSPEC_CACHEALIGN +#define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE) +#endif + +#ifndef DECLSPEC_SELECTANY +#if (_MSC_VER >= 1100) || defined(__GNUC__) +#define DECLSPEC_SELECTANY __declspec(selectany) +#else +#define DECLSPEC_SELECTANY +#endif +#endif + /* Use to silence unused variable warnings when it is intentional */ #define UNREFERENCED_PARAMETER(P) {(P) = (P);} #define UNREFERENCED_LOCAL_VARIABLE(L) {(L) = (L);} @@ -629,6 +657,10 @@ #endif /* !___GROUP_AFFINITY_DEFINED */ /* Helper Macros */ +#define RTL_FIELD_TYPE(type, field) (((type*)0)->field) +#define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8) +#define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field))) + #define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s } #define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |