From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anJa2-0001eP-00 for qemu-devel@nongnu.org; Tue, 05 Apr 2016 01:31:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anJZz-0005U7-21 for qemu-devel@nongnu.org; Tue, 05 Apr 2016 01:31:09 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:32847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anJZx-0005Sj-RU for qemu-devel@nongnu.org; Tue, 05 Apr 2016 01:31:06 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9A0B320D61 for ; Tue, 5 Apr 2016 01:31:04 -0400 (EDT) From: "Emilio G. Cota" Date: Tue, 5 Apr 2016 01:30:45 -0400 Message-Id: <1459834253-8291-3-git-send-email-cota@braap.org> In-Reply-To: <1459834253-8291-1-git-send-email-cota@braap.org> References: <1459834253-8291-1-git-send-email-cota@braap.org> Subject: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers , MTTCG Devel Cc: Peter Maydell , Peter Crosthwaite , Sergey Fedorov , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson I'm assuming windows compilers don't support this attribute. Signed-off-by: Emilio G. Cota --- include/qemu/compiler.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 8f1cc7b..fb946f1 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -41,6 +41,16 @@ # define QEMU_PACKED __attribute__((packed)) #endif +#define QEMU_CACHELINE (64) + +#if defined(_WIN32) +#define QEMU_ALIGN(B) +#else +#define QEMU_ALIGN(B) __attribute__((aligned(B))) +#endif + +#define QEMU_CACHELINE_ALIGNED QEMU_ALIGN(QEMU_CACHELINE) + #ifndef glue #define xglue(x, y) x ## y #define glue(x, y) xglue(x, y) -- 2.5.0