zephyr/drivers/net/CMakeLists.txt
Marcin Niestroj 8487fcca5b drivers: net: nsos: implement poll() syscall
Use NSI_HW_EVENT() in order to periodically check for events in host
sockets. Whenever there is a socket event ready to be processed by Zephyr,
raise native_sim (newly introduced) CPU interrupt, so that Zephyr driver
can signal readiness with k_poll().

Maintain a list of Zephyr poll() executions in Zephyr context. Iterate
through them whenever there is some event to be processed.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-03-22 14:39:27 +01:00

30 lines
1,001 B
CMake

# SPDX-License-Identifier: Apache-2.0
zephyr_library()
zephyr_library_sources_ifdef(CONFIG_NET_LOOPBACK loopback.c)
zephyr_library_sources_ifdef(CONFIG_NET_CANBUS canbus.c)
if(CONFIG_NET_NATIVE)
zephyr_library_sources_ifdef(CONFIG_SLIP slip.c)
zephyr_library_sources_ifdef(CONFIG_NET_PPP ppp.c)
endif()
if(CONFIG_NET_NATIVE_OFFLOADED_SOCKETS)
zephyr_library_include_directories(
${ZEPHYR_BASE}/subsys/net/lib/sockets
)
zephyr_library_sources(nsos_errno.c)
zephyr_library_sources(nsos_fcntl.c)
zephyr_library_sources(nsos_netdb.c)
zephyr_library_sources(nsos_sockets.c)
target_compile_options(native_simulator BEFORE INTERFACE
-I${BOARD_DIR}
-DNSOS_EPOLL_WAIT_INTERVAL=${CONFIG_NET_NATIVE_OFFLOADED_SOCKETS_EPOLL_WAIT_INTERVAL}
)
target_sources(native_simulator INTERFACE nsos_adapt.c)
target_sources(native_simulator INTERFACE nsos_errno.c)
target_sources(native_simulator INTERFACE nsos_fcntl.c)
target_sources(native_simulator INTERFACE nsos_netdb.c)
endif()