[v8,01/10] eal: eal stub to add windows support

Message ID 20190402035458.14664-2-anand.rawat@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series HelloWorld example for Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Anand Rawat April 2, 2019, 3:54 a.m. UTC
  Added initial stub source files for windows support.
Updated the MAINTAINERS list for windows support.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 MAINTAINERS                             |  7 ++++++
 lib/librte_eal/windows/eal/eal.c        | 14 +++++++++++
 lib/librte_eal/windows/eal/eal_debug.c  | 15 ++++++++++++
 lib/librte_eal/windows/eal/eal_lcore.c  | 32 +++++++++++++++++++++++++
 lib/librte_eal/windows/eal/eal_thread.c | 18 ++++++++++++++
 5 files changed, 86 insertions(+)
 create mode 100644 lib/librte_eal/windows/eal/eal.c
 create mode 100644 lib/librte_eal/windows/eal/eal_debug.c
 create mode 100644 lib/librte_eal/windows/eal/eal_lcore.c
 create mode 100644 lib/librte_eal/windows/eal/eal_thread.c
  

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index 9f34f905f..5d70fba9b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -283,6 +283,13 @@  FreeBSD UIO
 M: Bruce Richardson <bruce.richardson@intel.com>
 F: kernel/freebsd/nic_uio/
 
+Windows support
+M: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
+M: Omar Cardona <ocardona@microsoft.com>
+M: Anand Rawat <anand.rawat@intel.com>
+M: Ranjit Menon <ranjit.menon@intel.com>
+F: lib/librte_eal/windows/
+
 
 Core Libraries
 --------------
diff --git a/lib/librte_eal/windows/eal/eal.c b/lib/librte_eal/windows/eal/eal.c
new file mode 100644
index 000000000..37ed42233
--- /dev/null
+++ b/lib/librte_eal/windows/eal/eal.c
@@ -0,0 +1,14 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Intel Corporation
+ */
+
+#include <rte_common.h>
+
+ /* Launch threads, called at application init(). */
+int
+rte_eal_init(int argc __rte_unused, char **argv __rte_unused)
+{
+	/* TODO */
+	/* This is a stub, not the expected result */
+	return 0;
+}
diff --git a/lib/librte_eal/windows/eal/eal_debug.c b/lib/librte_eal/windows/eal/eal_debug.c
new file mode 100644
index 000000000..a9705e257
--- /dev/null
+++ b/lib/librte_eal/windows/eal/eal_debug.c
@@ -0,0 +1,15 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Intel Corporation
+ */
+
+#include <rte_common.h>
+
+ /* call abort(), it will generate a coredump if enabled */
+void
+__rte_panic(const char *funcname __rte_unused,
+		const char *format __rte_unused, ...)
+{
+	/* TODO */
+	/* This is a stub, not the expected result */
+	abort();
+}
diff --git a/lib/librte_eal/windows/eal/eal_lcore.c b/lib/librte_eal/windows/eal/eal_lcore.c
new file mode 100644
index 000000000..e4fcb2615
--- /dev/null
+++ b/lib/librte_eal/windows/eal/eal_lcore.c
@@ -0,0 +1,32 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Intel Corporation
+ */
+
+#include <rte_common.h>
+
+ /* Get the cpu core id value */
+unsigned int
+eal_cpu_core_id(unsigned int lcore_id)
+{
+	/* TODO */
+	/* This is a stub, not the expected result */
+	return lcore_id;
+}
+
+/* Check if a cpu is present by the presence of the cpu information for it */
+int
+eal_cpu_detected(unsigned int lcore_id __rte_unused)
+{
+	/* TODO */
+	/* This is a stub, not the expected result */
+	return 1;
+}
+
+/* Get CPU socket id (NUMA node) for a logical core */
+unsigned int
+eal_cpu_socket_id(unsigned int cpu_id __rte_unused)
+{
+	/* TODO */
+	/* This is a stub, not the expected result */
+	return 0;
+}
diff --git a/lib/librte_eal/windows/eal/eal_thread.c b/lib/librte_eal/windows/eal/eal_thread.c
new file mode 100644
index 000000000..f701443c3
--- /dev/null
+++ b/lib/librte_eal/windows/eal/eal_thread.c
@@ -0,0 +1,18 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Intel Corporation
+ */
+
+#include <windows.h>
+
+#include <rte_common.h>
+
+typedef uintptr_t eal_thread_t;
+
+/* function to create threads */
+int
+eal_thread_create(eal_thread_t *thread __rte_unused)
+{
+	/* TODO */
+	/* This is a stub, not the expected result */
+	return 0;
+}