@@ -57,6 +57,7 @@ odpplatinclude_HEADERS = \
$(top_srcdir)/platform/linux-generic/include/odp/plat/queue_types.h \
$(top_srcdir)/platform/linux-generic/include/odp/plat/schedule_types.h \
$(top_srcdir)/platform/linux-generic/include/odp/plat/shared_memory_types.h \
+ $(top_srcdir)/platform/linux-generic/include/odp/plat/strong_types.h \
$(top_srcdir)/platform/linux-generic/include/odp/plat/version_types.h
odpapiincludedir= $(includedir)/odp/api
new file mode 100644
@@ -0,0 +1,38 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+
+/**
+ * @file
+ *
+ * ODP Strong Types. Common macros for implementing strong typing
+ * for ODP abstract data types
+ */
+
+#ifndef STRONG_TYPES_H_
+#define STRONG_TYPES_H_
+
+/** Use strong typing for ODP types */
+#define odp_handle_t struct {} *
+
+/** Internal typedefs for ODP strong type manipulation */
+typedef odp_handle_t _odp_handle_t;
+
+typedef union {
+ _odp_handle_t hdl;
+ uint32_t val;
+} _odp_handle_u;
+
+/** Internal macro to get value of an ODP handle */
+#define _odp_typeval(handle) (((_odp_handle_u)(_odp_handle_t)handle).val)
+
+/** Internal macro to get printable value of an ODP handle */
+#define _odp_pri(handle) ((uint64_t)_odp_typeval(handle))
+
+/** Internal macro to convert a scalar to a typed handle */
+#define _odp_cast_scalar(type, val) ((type)(size_t)(val))
+
+#endif
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- platform/linux-generic/Makefile.am | 1 + .../linux-generic/include/odp/plat/strong_types.h | 38 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 platform/linux-generic/include/odp/plat/strong_types.h