From patchwork Fri Mar 1 07:18:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Rawat X-Patchwork-Id: 50698 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2B0844C77; Fri, 1 Mar 2019 08:18:54 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D0EA02BB5 for ; Fri, 1 Mar 2019 08:18:50 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2019 23:18:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,426,1544515200"; d="scan'208";a="120044712" Received: from anandraw-devbx.amr.corp.intel.com ([10.19.242.57]) by orsmga006.jf.intel.com with ESMTP; 28 Feb 2019 23:18:48 -0800 From: Anand Rawat To: dev@dpdk.org Date: Thu, 28 Feb 2019 23:18:43 -0800 Message-Id: <20190301071847.13376-3-anand.rawat@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 In-Reply-To: <20190301071847.13376-1-anand.rawat@intel.com> References: <20190301071847.13376-1-anand.rawat@intel.com> Subject: [dpdk-dev] [PATCH 2/6] eal: Add header files to support windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Kadam, Pallavi Reviewed-by: Jeffrey B Shaw Reviewed-by: Ranjit Menon --- 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 +#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