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>
30 lines
545 B
C
30 lines
545 B
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright (c) 2020 Dmitry Kozlyuk
|
|
*/
|
|
|
|
#ifndef _EAL_WINDOWS_H_
|
|
#define _EAL_WINDOWS_H_
|
|
|
|
/**
|
|
* @file Facilities private to Windows EAL
|
|
*/
|
|
|
|
#include <rte_windows.h>
|
|
|
|
/**
|
|
* Create a map of processors and cores on the system.
|
|
*/
|
|
void eal_create_cpu_map(void);
|
|
|
|
/**
|
|
* Create a thread.
|
|
*
|
|
* @param thread
|
|
* The location to store the thread id if successful.
|
|
* @return
|
|
* 0 for success, -1 if the thread is not created.
|
|
*/
|
|
int eal_thread_create(pthread_t *thread);
|
|
|
|
#endif /* _EAL_WINDOWS_H_ */
|