[API-NEXT,PATCHv9,2/5] linux-gen: adding enum, devio and driver registration interface (stub)

Message ID 1483373401-20012-3-git-send-email-christophe.milard@linaro.org
State New
Headers show

Commit Message

Christophe Milard Jan. 2, 2017, 4:09 p.m.
The linux implementation for the enumerator class registration function,
enumerator instance registration function,
devio and driver registration functions (stub)

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

---
 include/odp_drv.h                               |  1 +
 platform/linux-generic/Makefile.am              |  2 ++
 platform/linux-generic/drv_driver.c             | 44 +++++++++++++++++++++++++
 platform/linux-generic/include/odp/drv/driver.h | 27 +++++++++++++++
 4 files changed, 74 insertions(+)
 create mode 100644 platform/linux-generic/drv_driver.c
 create mode 100644 platform/linux-generic/include/odp/drv/driver.h

-- 
2.7.4

Patch

diff --git a/include/odp_drv.h b/include/odp_drv.h
index 0959879..96d81ba 100644
--- a/include/odp_drv.h
+++ b/include/odp_drv.h
@@ -23,6 +23,7 @@  extern C {
 #include <odp/drv/barrier.h>
 #include <odp/drv/byteorder.h>
 #include <odp/drv/compiler.h>
+#include <odp/drv/driver.h>
 #include <odp/drv/shm.h>
 #include <odp/drv/spinlock.h>
 #include <odp/drv/std_types.h>
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 999a7f5..9d219da 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -109,6 +109,7 @@  odpdrvinclude_HEADERS = \
 		  $(srcdir)/include/odp/drv/barrier.h \
 		  $(srcdir)/include/odp/drv/byteorder.h \
 		  $(srcdir)/include/odp/drv/compiler.h \
+		  $(srcdir)/include/odp/drv/driver.h \
 		  $(srcdir)/include/odp/drv/shm.h \
 		  $(srcdir)/include/odp/drv/spinlock.h \
 		  $(srcdir)/include/odp/drv/std_types.h \
@@ -227,6 +228,7 @@  __LIB__libodp_linux_la_SOURCES = \
 			   odp_weak.c \
 			   drv_atomic.c \
 			   drv_barrier.c \
+			   drv_driver.c \
 			   drv_shm.c \
 			   drv_spinlock.c \
 			   arch/@ARCH_DIR@/odp_cpu_arch.c \
diff --git a/platform/linux-generic/drv_driver.c b/platform/linux-generic/drv_driver.c
new file mode 100644
index 0000000..533ffd0
--- /dev/null
+++ b/platform/linux-generic/drv_driver.c
@@ -0,0 +1,44 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp_config_internal.h>
+
+#include <odp/api/std_types.h>
+#include <odp/api/debug.h>
+#include <odp/drv/driver.h>
+#include <odp_debug_internal.h>
+
+int odpdrv_enumr_class_register(odpdrv_enumr_class_t *enumr_class)
+{
+	ODP_ERR("NOT Supported yet! Enumerator Class %s Registration!\n.",
+		enumr_class->name);
+
+	return 0;
+}
+
+int odpdrv_enumr_register(odpdrv_enumr_t *enumerator)
+{
+	ODP_ERR("NOT Supported yet! Enumerator instance %s Registration!\n.",
+		enumerator->class_name);
+
+	return 0;
+}
+
+int odpdrv_devio_register(odpdrv_devio_t *devio)
+{
+	ODP_ERR("NOT Supported yet! Driver %s Registration!\n.",
+		devio->api_name);
+
+	return 0;
+}
+
+int odpdrv_driver_register(odpdrv_driver_t *driver)
+{
+	ODP_ERR("NOT Supported yet! Driver %s Registration!\n.",
+		driver->name);
+
+	return 0;
+}
diff --git a/platform/linux-generic/include/odp/drv/driver.h b/platform/linux-generic/include/odp/drv/driver.h
new file mode 100644
index 0000000..31d5063
--- /dev/null
+++ b/platform/linux-generic/include/odp/drv/driver.h
@@ -0,0 +1,27 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODPDRV drivers
+ */
+
+#ifndef ODPDRV_PLAT_DRIVER_H_
+#define ODPDRV_PLAT_DRIVER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/drv/std_types.h>
+#include <odp/drv/spec/driver.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif