eal/windows: introduce Windows support

Added initial stub source files and required meson changes
for Windows support.

kernel/windows/meson is a stub file added to support
Windows specific source in future releases.

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>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
This commit is contained in:
Anand Rawat 2019-04-01 20:54:49 -07:00 committed by Thomas Monjalon
parent 3c45889189
commit 98edcbb5ab
10 changed files with 130 additions and 14 deletions

View File

@ -283,6 +283,14 @@ FreeBSD UIO
M: Bruce Richardson <bruce.richardson@intel.com> M: Bruce Richardson <bruce.richardson@intel.com>
F: kernel/freebsd/nic_uio/ 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: kernel/windows/
F: lib/librte_eal/windows/
Core Libraries Core Libraries
-------------- --------------

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation # Copyright(c) 2017-2019 Intel Corporation
# set the major version, which might be used by drivers and libraries # set the major version, which might be used by drivers and libraries
# depending on the configuration options # depending on the configuration options
@ -80,18 +80,27 @@ dpdk_extra_ldflags += '-Wl,--no-as-needed'
add_project_link_arguments('-pthread', language: 'c') add_project_link_arguments('-pthread', language: 'c')
dpdk_extra_ldflags += '-pthread' dpdk_extra_ldflags += '-pthread'
# some libs depend on maths lib # on some OS, maths functions are in a separate library
add_project_link_arguments('-lm', language: 'c') if cc.find_library('libm', required : false).found()
dpdk_extra_ldflags += '-lm' # some libs depend on maths lib
add_project_link_arguments('-lm', language: 'c')
dpdk_extra_ldflags += '-lm'
endif
# for linux link against dl, for bsd execinfo # for linux link against dl, for bsd execinfo
if host_machine.system() == 'linux' if host_machine.system() == 'linux'
link_lib = 'dl' link_lib = 'dl'
else elif host_machine.system() == 'freebsd'
link_lib = 'execinfo' link_lib = 'execinfo'
else
link_lib = ''
endif
# if link_lib is empty, do not add it to project properties
if link_lib != ''
add_project_link_arguments('-l' + link_lib, language: 'c')
dpdk_extra_ldflags += '-l' + link_lib
endif endif
add_project_link_arguments('-l' + link_lib, language: 'c')
dpdk_extra_ldflags += '-l' + link_lib
# check for libraries used in multiple places in DPDK # check for libraries used in multiple places in DPDK
has_libnuma = 0 has_libnuma = 0

View File

@ -1,15 +1,17 @@
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation # Copyright(c) 2017-2019 Intel Corporation
# for checking defines we need to use the correct compiler flags # for checking defines we need to use the correct compiler flags
march_opt = ['-march=@0@'.format(machine)] march_opt = ['-march=@0@'.format(machine)]
# get binutils version for the workaround of Bug 97 # get binutils version for the workaround of Bug 97
ldver = run_command('ld', '-v').stdout().strip() if host_machine.system() != 'windows'
if ldver.contains('2.30') ldver = run_command('ld', '-v').stdout().strip()
if cc.has_argument('-mno-avx512f') if ldver.contains('2.30')
march_opt += '-mno-avx512f' if cc.has_argument('-mno-avx512f')
message('Binutils 2.30 detected, disabling AVX512 support as workaround for bug #97') march_opt += '-mno-avx512f'
message('Binutils 2.30 detected, disabling AVX512 support as workaround for bug #97')
endif
endif endif
endif endif

View File

@ -0,0 +1,4 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2019 Intel Corporation
# stub file for supporting Windows logic in future release

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation # Copyright(c) 2017-2019 Intel Corporation
# Custom EAL processing. EAL is complicated enough that it can't just # Custom EAL processing. EAL is complicated enough that it can't just
# have a straight list of headers and source files. # have a straight list of headers and source files.
@ -17,6 +17,10 @@ elif host_machine.system() == 'freebsd'
dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1) dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1)
subdir('freebsd/eal') subdir('freebsd/eal')
elif host_machine.system() == 'windows'
dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1)
subdir('windows/eal')
else else
error('unsupported system type "@0@"'.format(host_machine.system())) error('unsupported system type "@0@"'.format(host_machine.system()))
endif endif

View File

@ -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;
}

View File

@ -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();
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -0,0 +1,10 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2019 Intel Corporation
env_objs = []
env_headers = []
env_sources = files('eal.c',
'eal_debug.c',
'eal_lcore.c',
'eal_thread.c',
)