summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnand Rawat <anand.rawat@intel.com>2019-04-01 20:54:51 -0700
committerThomas Monjalon <thomas@monjalon.net>2019-04-03 01:11:56 +0200
commit428eb983f5f7614661dd5672e3a4ac51b23d6ee1 (patch)
treed4fc4b63e152fc0ee381e13b571f88af689dd7ae
parent98edcbb5ab2f06eabb691c67613e65a8405c55b1 (diff)
downloaddpdk-428eb983f5f7614661dd5672e3a4ac51b23d6ee1.zip
dpdk-428eb983f5f7614661dd5672e3a4ac51b23d6ee1.tar.gz
dpdk-428eb983f5f7614661dd5672e3a4ac51b23d6ee1.tar.xz
eal: add OS specific header file
Added rte_os.h files to support OS specific functionality. Updated build system to contain OS headers in the include path. Signed-off-by: Anand Rawat <anand.rawat@intel.com> Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com> Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
-rw-r--r--lib/librte_eal/freebsd/eal/Makefile4
-rw-r--r--lib/librte_eal/freebsd/eal/include/rte_os.h14
-rw-r--r--lib/librte_eal/freebsd/eal/meson.build4
-rw-r--r--lib/librte_eal/linux/eal/Makefile3
-rw-r--r--lib/librte_eal/linux/eal/include/rte_os.h14
-rw-r--r--lib/librte_eal/linux/eal/meson.build5
-rw-r--r--lib/librte_eal/windows/eal/include/rte_os.h14
-rw-r--r--lib/librte_eal/windows/eal/meson.build4
-rw-r--r--meson.build7
-rw-r--r--mk/exec-env/freebsd/rte.vars.mk5
-rw-r--r--mk/exec-env/linux/rte.vars.mk5
11 files changed, 69 insertions, 10 deletions
diff --git a/lib/librte_eal/freebsd/eal/Makefile b/lib/librte_eal/freebsd/eal/Makefile
index 55d476e..19854ee 100644
--- a/lib/librte_eal/freebsd/eal/Makefile
+++ b/lib/librte_eal/freebsd/eal/Makefile
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2010-2015 Intel Corporation
+# Copyright(c) 2010-2019 Intel Corporation
include $(RTE_SDK)/mk/rte.vars.mk
@@ -86,7 +86,7 @@ CFLAGS_eal_thread.o += -Wno-return-type
CFLAGS_eal_hpet.o += -Wno-return-type
endif
-INC := # no bsd specific headers
+INC := rte_os.h
SYMLINK-$(CONFIG_RTE_EXEC_ENV_FREEBSD)-include := $(addprefix include/,$(INC))
diff --git a/lib/librte_eal/freebsd/eal/include/rte_os.h b/lib/librte_eal/freebsd/eal/include/rte_os.h
new file mode 100644
index 0000000..49cd4d4
--- /dev/null
+++ b/lib/librte_eal/freebsd/eal/include/rte_os.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2019 Intel Corporation
+ */
+
+#ifndef _RTE_OS_H_
+#define _RTE_OS_H_
+
+/**
+ * This is header should contain any function/macro definition
+ * which are not supported natively or named differently in the
+ * freebsd OS. Functions will be added in future releases.
+ */
+
+#endif /* _RTE_OS_H_ */
diff --git a/lib/librte_eal/freebsd/eal/meson.build b/lib/librte_eal/freebsd/eal/meson.build
index 3945b52..1426f7e 100644
--- a/lib/librte_eal/freebsd/eal/meson.build
+++ b/lib/librte_eal/freebsd/eal/meson.build
@@ -2,7 +2,9 @@
# Copyright(c) 2017 Intel Corporation
env_objs = []
-env_headers = []
+env_headers = files(
+ 'include/rte_os.h',
+)
env_sources = files('eal_alarm.c',
'eal_cpuflags.c',
'eal_debug.c',
diff --git a/lib/librte_eal/linux/eal/Makefile b/lib/librte_eal/linux/eal/Makefile
index 2aa6e8c..6e52611 100644
--- a/lib/librte_eal/linux/eal/Makefile
+++ b/lib/librte_eal/linux/eal/Makefile
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2010-2016 Intel Corporation
+# Copyright(c) 2010-2019 Intel Corporation
include $(RTE_SDK)/mk/rte.vars.mk
@@ -94,6 +94,7 @@ CFLAGS_eal_thread.o += -Wno-return-type
endif
INC := rte_kni_common.h
+INC += rte_os.h
SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUX)-include := $(addprefix include/,$(INC))
diff --git a/lib/librte_eal/linux/eal/include/rte_os.h b/lib/librte_eal/linux/eal/include/rte_os.h
new file mode 100644
index 0000000..bc6ad14
--- /dev/null
+++ b/lib/librte_eal/linux/eal/include/rte_os.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2019 Intel Corporation
+ */
+
+#ifndef _RTE_OS_H_
+#define _RTE_OS_H_
+
+/**
+ * This is header should contain any function/macro definition
+ * which are not supported natively or named differently in the
+ * linux OS. Functions will be added in future releases.
+ */
+
+#endif /* _RTE_OS_H_ */
diff --git a/lib/librte_eal/linux/eal/meson.build b/lib/librte_eal/linux/eal/meson.build
index d223da6..b02b069 100644
--- a/lib/librte_eal/linux/eal/meson.build
+++ b/lib/librte_eal/linux/eal/meson.build
@@ -4,7 +4,10 @@
eal_inc += include_directories('include')
env_objs = []
-env_headers = files('include/rte_kni_common.h')
+env_headers = files(
+ 'include/rte_kni_common.h',
+ 'include/rte_os.h',
+)
env_sources = files('eal_alarm.c',
'eal_cpuflags.c',
'eal_debug.c',
diff --git a/lib/librte_eal/windows/eal/include/rte_os.h b/lib/librte_eal/windows/eal/include/rte_os.h
new file mode 100644
index 0000000..421ed8e
--- /dev/null
+++ b/lib/librte_eal/windows/eal/include/rte_os.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2019 Intel Corporation
+ */
+
+#ifndef _RTE_OS_H_
+#define _RTE_OS_H_
+
+/**
+ * This is header should contain any function/macro definition
+ * which are not supported natively or named differently in the
+ * Windows OS. Functions will be added in future releases.
+ */
+
+#endif /* _RTE_OS_H_ */
diff --git a/lib/librte_eal/windows/eal/meson.build b/lib/librte_eal/windows/eal/meson.build
index 8b17356..1781e60 100644
--- a/lib/librte_eal/windows/eal/meson.build
+++ b/lib/librte_eal/windows/eal/meson.build
@@ -2,7 +2,9 @@
# Copyright(c) 2019 Intel Corporation
env_objs = []
-env_headers = []
+env_headers = files(
+ 'include/rte_os.h',
+)
env_sources = files('eal.c',
'eal_debug.c',
'eal_lcore.c',
diff --git a/meson.build b/meson.build
index 6061c4b..a964865 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2017 Intel Corporation
+# Copyright(c) 2017-2019 Intel Corporation
project('DPDK', 'C',
# Get version number from file.
@@ -24,7 +24,10 @@ dpdk_app_link_libraries = []
# configure the build, and make sure configs here and in config folder are
# able to be included in any file. We also store a global array of include dirs
# for passing to pmdinfogen scripts
-global_inc = include_directories('.', 'config', 'lib/librte_eal/common/include')
+global_inc = include_directories('.', 'config',
+ 'lib/librte_eal/common/include',
+ 'lib/librte_eal/@0@/eal/include'.format(host_machine.system()),
+)
subdir('config')
# build libs and drivers
diff --git a/mk/exec-env/freebsd/rte.vars.mk b/mk/exec-env/freebsd/rte.vars.mk
index c6be560..3608530 100644
--- a/mk/exec-env/freebsd/rte.vars.mk
+++ b/mk/exec-env/freebsd/rte.vars.mk
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2010-2014 Intel Corporation
+# Copyright(c) 2010-2019 Intel Corporation
#
# exec-env:
@@ -17,6 +17,9 @@ else
EXECENV_CFLAGS = -pthread
endif
+# include in every library to build
+EXECENV_CFLAGS += -I$(RTE_SDK)/lib/librte_eal/freebsd/eal/include
+
EXECENV_LDFLAGS =
EXECENV_LDLIBS = -lexecinfo
EXECENV_ASFLAGS =
diff --git a/mk/exec-env/linux/rte.vars.mk b/mk/exec-env/linux/rte.vars.mk
index d04d0e2..bea3f76 100644
--- a/mk/exec-env/linux/rte.vars.mk
+++ b/mk/exec-env/linux/rte.vars.mk
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2010-2014 Intel Corporation
+# Copyright(c) 2010-2019 Intel Corporation
#
# exec-env:
@@ -17,6 +17,9 @@ else
EXECENV_CFLAGS = -pthread
endif
+# include in every library to build
+EXECENV_CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linux/eal/include
+
EXECENV_LDLIBS =
EXECENV_ASFLAGS =