eal/windows: do not expose private facilities
authorDmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tue, 14 Apr 2020 19:44:17 +0000 (22:44 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 21 Apr 2020 22:49:50 +0000 (00:49 +0200)
commit1db72630da0c95952e78d46a45d72d6944e4940c
treea9c913755cb7c102d677e6ee3d60684a2b4c9050
parentd6298844da7e3e83034f1af196bdfddf388f979e
eal/windows: do not expose private facilities

The goal of rte_os.h is to mitigate OS differences for EAL users.
In Windows EAL, rte_os.h did excessive things:

1. It included platform SDK headers (windows.h, etc). Those files are
   huge, require specific inclusion order, and are generally unused by
   the code including rte_os.h. Declarations from platform SDK may
   break otherwise platform-independent code, e.g. min, max, ERROR.

2. It included pthread.h, which is clearly not always required.

3. It defined functions private to Windows EAL.

Reorganize Windows EAL includes in the following way:

1. Create rte_windows.h to properly import Windows-specific facilities.
   Primary users are bus drivers, tests, and external applications.

2. Remove platform SDK includes from rte_os.h to prevent breaking
   otherwise portable code by including rte_os.h on Windows.
   Copy necessary definitions to avoid including those headers.

3. Remove pthread.h include from rte_os.h.

4. Move declarations private to Windows EAL into eal_windows.h.

Fixes: 428eb983f5f7 ("eal: add OS specific header file")

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
lib/librte_eal/windows/eal.c
lib/librte_eal/windows/eal_lcore.c
lib/librte_eal/windows/eal_thread.c
lib/librte_eal/windows/eal_windows.h [new file with mode: 0644]
lib/librte_eal/windows/include/meson.build
lib/librte_eal/windows/include/pthread.h
lib/librte_eal/windows/include/rte_os.h
lib/librte_eal/windows/include/rte_windows.h [new file with mode: 0644]