diff mbox

[API-NEXT,PATCHv3,11/18] drv: adding align.h

Message ID 1469102786-65530-12-git-send-email-christophe.milard@linaro.org
State New
Headers show

Commit Message

Christophe Milard July 21, 2016, 12:06 p.m. UTC
Based on API interface file.

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>

---
 include/odp/drv/spec/align.h | 78 ++++++++++++++++++++++++++++++++++++++++++++
 platform/Makefile.inc        |  1 +
 2 files changed, 79 insertions(+)
 create mode 100644 include/odp/drv/spec/align.h

-- 
2.7.4
diff mbox

Patch

diff --git a/include/odp/drv/spec/align.h b/include/odp/drv/spec/align.h
new file mode 100644
index 0000000..2b2f32c
--- /dev/null
+++ b/include/odp/drv/spec/align.h
@@ -0,0 +1,78 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODPDRV alignments
+ */
+
+#ifndef ODPDRV_API_ALIGN_H_
+#define ODPDRV_API_ALIGN_H_
+#include <odp/visibility_begin.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @addtogroup odpdrv_compiler_optim
+ *  Macros that allow cache line size configuration, check that
+ *  alignment is a power of two etc.
+ *  @{
+ */
+
+/* Checkpatch complains, but cannot use __aligned(size) for this purpose. */
+
+/**
+ * @def ODPDRV_ALIGNED
+ * Defines type/struct/variable alignment in bytes
+ */
+
+/**
+ * @def ODPDRV_PACKED
+ * Defines type/struct to be packed
+ */
+
+/**
+ * @def ODPDRV_OFFSETOF
+ * Returns offset of member in type
+ */
+
+/**
+ * @def ODPDRV_FIELD_SIZEOF
+ * Returns sizeof member
+ */
+
+/**
+ * @def ODPDRV_CACHE_LINE_SIZE
+ * Cache line size
+ */
+
+/**
+ * @def ODPDRV_PAGE_SIZE
+ * Page size
+ */
+
+/**
+ * @def ODPDRV_ALIGNED_CACHE
+ * Defines type/struct/variable to be cache line size aligned
+ */
+
+/**
+ * @def ODPDRV_ALIGNED_PAGE
+ * Defines type/struct/variable to be page size aligned
+ */
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <odp/visibility_end.h>
+#endif
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index dd3b376..edb598f 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -63,6 +63,7 @@  odpapispecinclude_HEADERS = \
 
 odpdrvspecincludedir= $(includedir)/odp/drv/spec
 odpdrvspecinclude_HEADERS = \
+		  $(top_srcdir)/include/odp/drv/spec/align.h \
 		  $(top_srcdir)/include/odp/drv/spec/byteorder.h \
 		  $(top_srcdir)/include/odp/drv/spec/compiler.h \
 		  $(top_srcdir)/include/odp/drv/spec/std_types.h \