From 52436562f4d8ba0c7e40e4bd3db68ddab6c314db Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 6 Jul 2013 10:11:21 +0000 Subject: [PATCH] =?UTF-8?q?[INCLUDE]=20-=20Properly=20declare=20and=20use?= =?UTF-8?q?=20DECLSPEC=5FCACHEALIGN.=20Patch=20by=20Samuel=20Serapi=C3=B3n?= =?UTF-8?q?.=20CORE-7139=20#resolve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=59431 --- reactos/include/ddk/wdm.h | 4 ++-- reactos/include/psdk/ntdef.h | 12 ++++++++++++ reactos/include/xdk/extypes.h | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/reactos/include/ddk/wdm.h b/reactos/include/ddk/wdm.h index 2f0785c8df4..b7c9a63a563 100644 --- a/reactos/include/ddk/wdm.h +++ b/reactos/include/ddk/wdm.h @@ -1878,7 +1878,7 @@ typedef enum _EX_POOL_PRIORITY { #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; @@ -8333,7 +8333,7 @@ KeRestoreFloatingPointState(PVOID FloatingState) #define HIGH_LEVEL 15 #define KI_USER_SHARED_DATA ((ULONG_PTR)(KADDRESS_BASE + 0xFFFE0000)) -extern volatile LARGE_INTEGER KeTickCount; +extern DECLSPEC_CACHEALIGN volatile LARGE_INTEGER KeTickCount; #define PAUSE_PROCESSOR __yield(); diff --git a/reactos/include/psdk/ntdef.h b/reactos/include/psdk/ntdef.h index 5f6a2583a32..d88b02b3dde 100644 --- a/reactos/include/psdk/ntdef.h +++ b/reactos/include/psdk/ntdef.h @@ -299,6 +299,18 @@ #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) diff --git a/reactos/include/xdk/extypes.h b/reactos/include/xdk/extypes.h index 4d9bcb952c7..ae252d375ed 100644 --- a/reactos/include/xdk/extypes.h +++ b/reactos/include/xdk/extypes.h @@ -51,7 +51,7 @@ typedef enum _EX_POOL_PRIORITY { #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;