@@ -18,6 +18,7 @@
extern C {
#endif
+#include <odp/drv/align.h>
#include <odp/drv/byteorder.h>
#include <odp/drv/compiler.h>
#include <odp/drv/std_types.h>
@@ -93,6 +93,7 @@ odpapiplatinclude_HEADERS = \
odpdrvincludedir = $(includedir)/odp/drv
odpdrvinclude_HEADERS = \
+ $(srcdir)/include/odp/drv/align.h \
$(srcdir)/include/odp/drv/byteorder.h \
$(srcdir)/include/odp/drv/compiler.h \
$(srcdir)/include/odp/drv/std_types.h \
new file mode 100644
@@ -0,0 +1,60 @@
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODPDRV alignments
+ */
+
+#ifndef ODPDRV_PLAT_ALIGN_H_
+#define ODPDRV_PLAT_ALIGN_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @ingroup odpdrv_compiler_optim
+ * @{
+ */
+
+#ifdef __GNUC__
+
+#define ODPDRV_ALIGNED(x) __attribute__((__aligned__(x)))
+
+#define ODPDRV_PACKED __attribute__((__packed__))
+
+#define ODPDRV_OFFSETOF(type, member) __builtin_offsetof(type, member)
+
+#define ODPDRV_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member)
+
+#if defined __arm__ || defined __aarch64__
+
+#define ODPDRV_CACHE_LINE_SIZE 64
+
+#endif
+
+#else
+#error Non-gcc compatible compiler
+#endif
+
+#define ODPDRV_PAGE_SIZE 4096
+
+#define ODPDRV_ALIGNED_CACHE ODPDRV_ALIGNED(ODPDRV_CACHE_LINE_SIZE)
+
+#define ODPDRV_ALIGNED_PAGE ODPDRV_ALIGNED(ODPDRV_PAGE_SIZE)
+
+/**
+ * @}
+ */
+
+#include <odp/drv/spec/align.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Based on API interface file. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- include/odp_drv.h | 1 + platform/linux-generic/Makefile.am | 1 + platform/linux-generic/include/odp/drv/align.h | 60 ++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 platform/linux-generic/include/odp/drv/align.h -- 2.7.4