From: Anand Rawat <anand.rawat@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/6] eal: Add header files to support windows
Date: Thu, 28 Feb 2019 23:18:43 -0800 [thread overview]
Message-ID: <20190301071847.13376-3-anand.rawat@intel.com> (raw)
In-Reply-To: <20190301071847.13376-1-anand.rawat@intel.com>
Added header files to support windows on x86 platforms.
Updated rte_config to include rte_windows.h for windows
build.
Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Signed-off-by: Kadam, Pallavi <pallavi.kadam@intel.com>
Reviewed-by: Jeffrey B Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
config/rte_config.h | 15 +++++++++++-
.../common/include/arch/x86/meson.build | 7 ++++++
.../include/arch/x86/winapp/rte_atomic.h | 19 +++++++++++++++
.../include/arch/x86/winapp/rte_pause.h | 22 ++++++++++++++++++
.../winapp/eal/include/exec-env/rte_windows.h | 23 +++++++++++++++++++
lib/librte_eal/winapp/eal/meson.build | 5 +++-
6 files changed, 89 insertions(+), 2 deletions(-)
create mode 100644 lib/librte_eal/common/include/arch/x86/winapp/rte_atomic.h
create mode 100644 lib/librte_eal/common/include/arch/x86/winapp/rte_pause.h
create mode 100644 lib/librte_eal/winapp/eal/include/exec-env/rte_windows.h
diff --git a/config/rte_config.h b/config/rte_config.h
index 7606f5d7b..af4d06878 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2017 Intel Corporation
+ * Copyright(c) 2019 Intel Corporation
*/
/**
@@ -20,6 +20,10 @@
/****** library defines ********/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* compat defines */
#define RTE_BUILD_SHARED_LIB
@@ -118,4 +122,13 @@
/* QEDE PMD defines */
#define RTE_LIBRTE_QEDE_FW ""
+/* windows specific*/
+#ifdef RTE_EXEC_ENV_WINDOWS
+#include <rte_windows.h>
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_CONFIG_H_ */
diff --git a/lib/librte_eal/common/include/arch/x86/meson.build b/lib/librte_eal/common/include/arch/x86/meson.build
index 25b73b8d6..7426d35a6 100644
--- a/lib/librte_eal/common/include/arch/x86/meson.build
+++ b/lib/librte_eal/common/include/arch/x86/meson.build
@@ -21,4 +21,11 @@ if host_machine.system() != 'windows'
'rte_vect.h',
subdir: get_option('include_subdir_arch')
)
+else
+ # get and install the architecture specific windows headers
+ windows_headers = files(
+ 'winapp/rte_atomic.h',
+ 'winapp/rte_pause.h'
+ )
+ install_headers(windows_headers, subdir: 'winapp')
endif
diff --git a/lib/librte_eal/common/include/arch/x86/winapp/rte_atomic.h b/lib/librte_eal/common/include/arch/x86/winapp/rte_atomic.h
new file mode 100644
index 000000000..9ca630f71
--- /dev/null
+++ b/lib/librte_eal/common/include/arch/x86/winapp/rte_atomic.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Intel Corporation
+ */
+
+#ifndef _ATOMIC_H_
+#define _ATOMIC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define rte_rmb() _mm_lfence()
+#define rte_wmb() _mm_sfence()
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ATOMIC_H_ */
diff --git a/lib/librte_eal/common/include/arch/x86/winapp/rte_pause.h b/lib/librte_eal/common/include/arch/x86/winapp/rte_pause.h
new file mode 100644
index 000000000..12762a5cd
--- /dev/null
+++ b/lib/librte_eal/common/include/arch/x86/winapp/rte_pause.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Intel Corporation
+ */
+
+#ifndef _PAUSE_H_
+#define _PAUSE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static inline void
+rte_pause(void)
+{
+ _mm_pause();
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PAUSE_H_ */
diff --git a/lib/librte_eal/winapp/eal/include/exec-env/rte_windows.h b/lib/librte_eal/winapp/eal/include/exec-env/rte_windows.h
new file mode 100644
index 000000000..8e4dc72bb
--- /dev/null
+++ b/lib/librte_eal/winapp/eal/include/exec-env/rte_windows.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Intel Corporation
+ */
+
+#ifndef _RTE_WINDOWS_H_
+#define _RTE_WINDOWS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define __extension__
+#define __thread __declspec(thread)
+
+#define strerror_r(a, b, c) strerror_s(b, c, a)
+
+typedef void *ssize_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_WINDOWS_H_ */
diff --git a/lib/librte_eal/winapp/eal/meson.build b/lib/librte_eal/winapp/eal/meson.build
index 8b1735623..487055f80 100644
--- a/lib/librte_eal/winapp/eal/meson.build
+++ b/lib/librte_eal/winapp/eal/meson.build
@@ -1,10 +1,13 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2019 Intel Corporation
+eal_inc += include_directories('include/exec-env')
+install_subdir('include/exec-env', install_dir: get_option('includedir'))
+
env_objs = []
env_headers = []
env_sources = files('eal.c',
'eal_debug.c',
'eal_lcore.c',
'eal_thread.c',
-)
+)
\ No newline at end of file
--
2.17.1.windows.2
next prev parent reply other threads:[~2019-03-01 7:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-01 7:18 [dpdk-dev] [PATCH 0/6] HelloWorld example for Windows Anand Rawat
2019-03-01 7:18 ` [dpdk-dev] [PATCH 1/6] eal: eal stub to add windows support Anand Rawat
2019-03-01 14:03 ` Thomas Monjalon
2019-03-01 14:17 ` Bruce Richardson
2019-03-01 14:30 ` Thomas Monjalon
2019-03-01 15:19 ` Luca Boccassi
2019-03-01 7:18 ` Anand Rawat [this message]
2019-03-01 7:18 ` [dpdk-dev] [PATCH 3/6] eal: Add headers for compatibility with windows environment Anand Rawat
2019-03-01 7:18 ` [dpdk-dev] [PATCH 4/6] eal: add minimum viable code for eal on windows Anand Rawat
2019-03-01 7:18 ` [dpdk-dev] [PATCH 5/6] examples: Add meson changes for windows Anand Rawat
2019-03-01 7:18 ` [dpdk-dev] [PATCH 6/6] doc: add documention " Anand Rawat
2019-03-01 19:02 ` Stephen Hemminger
2019-03-02 2:41 ` Ranjit Menon
2019-03-06 8:33 ` Thomas Monjalon
2019-03-01 13:47 ` [dpdk-dev] [PATCH 0/6] HelloWorld example for Windows Bruce Richardson
2019-03-04 10:13 ` David Marchand
2019-03-04 10:14 ` David Marchand
2019-03-05 23:43 ` Anand Rawat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190301071847.13376-3-anand.rawat@intel.com \
--to=anand.rawat@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).