Skip to content

Commit 7e8953e

Browse files
Christopher Friedtcfriedt
authored andcommitted
posix: ensure that pooled ipc type is user-configurable
Previously it was not possible to n-select e.g. CONFIG_PTHREAD_BARRIER because the Kconfig template for it lacked a prompt. This made it impossible to disable some unused POSIX features and unnecessarily increased code size if unused code sections were not discarded by the linker. Add a prompt so that each pooled IPC type is user-configurable and can be disabled if unneeded. Further, ensure that only the selected sources from lib/posix are included in the cmake build. Signed-off-by: Christopher Friedt <[email protected]>
1 parent d661c86 commit 7e8953e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/posix/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ zephyr_library_sources_ifdef(CONFIG_POSIX_MQUEUE mqueue.c)
4848
zephyr_library_sources_ifdef(CONFIG_POSIX_SIGNAL signal.c ${STRSIGNAL_TABLE_H})
4949
zephyr_library_sources_ifdef(CONFIG_POSIX_UNAME uname.c)
5050
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC _common.c)
51-
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC barrier.c)
52-
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC cond.c)
53-
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC key.c)
54-
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC mutex.c)
55-
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC pthread.c)
51+
zephyr_library_sources_ifdef(CONFIG_PTHREAD_BARRIER barrier.c)
52+
zephyr_library_sources_ifdef(CONFIG_PTHREAD_COND cond.c)
53+
zephyr_library_sources_ifdef(CONFIG_PTHREAD_KEY key.c)
54+
zephyr_library_sources_ifdef(CONFIG_PTHREAD_MUTEX mutex.c)
55+
zephyr_library_sources_ifdef(CONFIG_PTHREAD pthread.c)
5656
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC rwlock.c)
5757
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC sched.c)
5858
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC semaphore.c)
59-
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC spinlock.c)
59+
zephyr_library_sources_ifdef(CONFIG_PTHREAD_SPINLOCK spinlock.c)
6060

6161
zephyr_library_include_directories(
6262
${ZEPHYR_BASE}/kernel/include

lib/posix/Kconfig.template.pooled_ipc_type

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ source "lib/posix/Kconfig.template.with_logging"
77

88
# Not user configurable (i.e. private for now)
99
config $(TYPE)
10-
bool
11-
default y
10+
bool "POSIX $(type) support"
1211
depends on PTHREAD_IPC
12+
default y
1313
help
1414
Support for $(TYPE)
1515
For more info, see

0 commit comments

Comments
 (0)