@@ -31,6 +31,7 @@ odpapiinclude_HEADERS = \
$(srcdir)/include/odp/api/cpumask.h \
$(srcdir)/include/odp/api/crypto.h \
$(srcdir)/include/odp/api/debug.h \
+ $(srcdir)/include/odp/api/dev.h \
$(srcdir)/include/odp/api/errno.h \
$(srcdir)/include/odp/api/event.h \
$(srcdir)/include/odp/api/hash.h \
@@ -75,6 +76,7 @@ odpapiplatinclude_HEADERS = \
$(srcdir)/include/odp/api/plat/classification_types.h \
$(srcdir)/include/odp/api/plat/cpumask_types.h \
$(srcdir)/include/odp/api/plat/crypto_types.h \
+ $(srcdir)/include/odp/api/plat/dev_types.h \
$(srcdir)/include/odp/api/plat/event_types.h \
$(srcdir)/include/odp/api/plat/init_types.h \
$(srcdir)/include/odp/api/plat/packet_types.h \
@@ -178,6 +180,7 @@ __LIB__libodp_linux_la_SOURCES = \
odp_cpumask.c \
odp_cpumask_task.c \
odp_crypto.c \
+ odp_dev.c \
odp_errno.c \
odp_event.c \
odp_hash.c \
new file mode 100644
@@ -0,0 +1,37 @@
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP Device
+ */
+
+#ifndef ODP_PLAT_DEV_H_
+#define ODP_PLAT_DEV_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/std_types.h>
+#include <odp/api/plat/dev_types.h>
+
+/** @ingroup odp_dev
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+#include <odp/api/spec/dev.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
new file mode 100644
@@ -0,0 +1,49 @@
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP device
+ */
+
+#ifndef ODP_DEV_TYPES_H_
+#define ODP_DEV_TYPES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/std_types.h>
+#include <odp/api/plat/strong_types.h>
+
+/** @addtogroup odp_dev ODP DEVICE
+ * Macros and operation on a device.
+ * @{
+ */
+
+typedef ODP_HANDLE_T(odp_dev_t);
+
+#define ODP_DEV_DEFAULT _odp_cast_scalar(odp_dev_t, 0)
+#define ODP_DEV_INVALID _odp_cast_scalar(odp_dev_t, 0xffffffff)
+
+#define ODP_DEV_NAME_LEN 32
+
+/** Get printable format of odp_dev_t */
+static inline uint64_t odp_dev_id_to_u64(odp_dev_t dev)
+{
+ return _odp_pri(dev);
+}
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
new file mode 100644
@@ -0,0 +1,13 @@
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <odp/api/dev.h>
+#include <odp/api/hints.h>
+
+odp_dev_t odp_dev_id(const char *name ODP_UNUSED)
+{
+ return ODP_DEV_DEFAULT;
+}
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- Changes for v2: - incorporate changes suggested by Petri platform/linux-generic/Makefile.am | 3 ++ platform/linux-generic/include/odp/api/dev.h | 37 ++++++++++++++++ .../linux-generic/include/odp/api/plat/dev_types.h | 49 ++++++++++++++++++++++ platform/linux-generic/odp_dev.c | 13 ++++++ 4 files changed, 102 insertions(+) create mode 100644 platform/linux-generic/include/odp/api/dev.h create mode 100644 platform/linux-generic/include/odp/api/plat/dev_types.h create mode 100644 platform/linux-generic/odp_dev.c -- 2.7.4