diff mbox

[RFC,02/17] Split out platform-specific part of odp_align.h

Message ID 1398685276-4610-3-git-send-email-taras.kondratiuk@linaro.org
State RFC
Headers show

Commit Message

Taras Kondratiuk April 28, 2014, 11:41 a.m. UTC
---
 include/odp_align.h                             |   39 +--------------
 platform/linux-generic/include/plat/odp_align.h |   61 +++++++++++++++++++++++
 2 files changed, 63 insertions(+), 37 deletions(-)
 create mode 100644 platform/linux-generic/include/plat/odp_align.h
diff mbox

Patch

diff --git a/include/odp_align.h b/include/odp_align.h
index ce72f01..241b58a 100644
--- a/include/odp_align.h
+++ b/include/odp_align.h
@@ -14,6 +14,8 @@ 
 #ifndef ODP_ALIGN_H_
 #define ODP_ALIGN_H_
 
+#include <plat/odp_align.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -43,38 +45,10 @@  extern "C" {
  */
 #define ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member)
 
-#if defined __x86_64__ || defined __i386__
-
-/** Cache line size */
-#define ODP_CACHE_LINE_SIZE 64
-
-#elif defined __arm__
-
-/** Cache line size */
-#define ODP_CACHE_LINE_SIZE 64
-
-#elif defined __OCTEON__
-
-/** Cache line size */
-#define ODP_CACHE_LINE_SIZE 128
-
-#elif defined __powerpc__
-
-/** Cache line size */
-#define ODP_CACHE_LINE_SIZE 64
-
-#else
-#error GCC target not found
-#endif
-
 #else
 #error Non-gcc compatible compiler
 #endif
 
-/** Page size */
-#define ODP_PAGE_SIZE       4096
-
-
 /*
  * Round up
  */
@@ -155,7 +129,6 @@  extern "C" {
 #define ODP_ALIGNED_PAGE    ODP_ALIGNED(ODP_PAGE_SIZE)
 
 
-
 /*
  * Check align
  */
@@ -174,16 +147,8 @@  extern "C" {
 #define ODP_VAL_IS_POWER_2(x) ((((x)-1) & (x)) == 0)
 
 
-
 #ifdef __cplusplus
 }
 #endif
 
 #endif
-
-
-
-
-
-
-
diff --git a/platform/linux-generic/include/plat/odp_align.h b/platform/linux-generic/include/plat/odp_align.h
new file mode 100644
index 0000000..78f3b38
--- /dev/null
+++ b/platform/linux-generic/include/plat/odp_align.h
@@ -0,0 +1,61 @@ 
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+
+
+/**
+ * @file
+ *
+ * ODP alignments
+ */
+
+#ifndef ODP_ALIGN_H_
+#error This file should be included only into corresponding top level header
+#else
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifdef __GNUC__
+
+#if defined __x86_64__ || defined __i386__
+
+/** Cache line size */
+#define ODP_CACHE_LINE_SIZE 64
+
+#elif defined __arm__
+
+/** Cache line size */
+#define ODP_CACHE_LINE_SIZE 64
+
+#elif defined __OCTEON__
+
+/** Cache line size */
+#define ODP_CACHE_LINE_SIZE 128
+
+#elif defined __powerpc__
+
+/** Cache line size */
+#define ODP_CACHE_LINE_SIZE 64
+
+#else
+#error GCC target not found
+#endif
+
+#else
+#error Non-gcc compatible compiler
+#endif
+
+/** Page size */
+#define ODP_PAGE_SIZE       4096
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif