posix: deprecate PTHREAD_BARRIER for POSIX_BARRIERS
The standard specifies _POSIX_BARRIERS as an Option so let's use CONFIG_POSIX_BARRIERS for consistence. This change deprecates CONFIG_PTHREAD_BARRIER. Users should instead choose CONFIG_POSIX_BARRIERS. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
parent
bc4374b5fe
commit
b639604833
7 changed files with 37 additions and 13 deletions
|
@ -62,7 +62,7 @@ POSIX System Interfaces
|
||||||
|
|
||||||
_POSIX_VERSION, 200809L,
|
_POSIX_VERSION, 200809L,
|
||||||
:ref:`_POSIX_ASYNCHRONOUS_IO<posix_option_asynchronous_io>`, 200809L, :ref:`†<posix_undefined_behaviour>`
|
:ref:`_POSIX_ASYNCHRONOUS_IO<posix_option_asynchronous_io>`, 200809L, :ref:`†<posix_undefined_behaviour>`
|
||||||
:ref:`_POSIX_BARRIERS<posix_option_group_barriers>`, 200809L, :kconfig:option:`CONFIG_PTHREAD_BARRIER`
|
:ref:`_POSIX_BARRIERS<posix_option_group_barriers>`, 200809L, :kconfig:option:`CONFIG_POSIX_BARRIERS`
|
||||||
:ref:`_POSIX_CLOCK_SELECTION<posix_option_group_clock_selection>`, 200809L, :kconfig:option:`CONFIG_POSIX_CLOCK_SELECTION`
|
:ref:`_POSIX_CLOCK_SELECTION<posix_option_group_clock_selection>`, 200809L, :kconfig:option:`CONFIG_POSIX_CLOCK_SELECTION`
|
||||||
_POSIX_MAPPED_FILES, -1, :ref:`†<posix_undefined_behaviour>`
|
_POSIX_MAPPED_FILES, -1, :ref:`†<posix_undefined_behaviour>`
|
||||||
_POSIX_MEMORY_PROTECTION, -1, :ref:`†<posix_undefined_behaviour>`
|
_POSIX_MEMORY_PROTECTION, -1, :ref:`†<posix_undefined_behaviour>`
|
||||||
|
|
|
@ -12,7 +12,6 @@ implementation of the POSIX API.
|
||||||
* :kconfig:option:`CONFIG_FNMATCH`
|
* :kconfig:option:`CONFIG_FNMATCH`
|
||||||
* :kconfig:option:`CONFIG_GETOPT`
|
* :kconfig:option:`CONFIG_GETOPT`
|
||||||
* :kconfig:option:`CONFIG_GETOPT_LONG`
|
* :kconfig:option:`CONFIG_GETOPT_LONG`
|
||||||
* :kconfig:option:`CONFIG_MAX_PTHREAD_BARRIER_COUNT`
|
|
||||||
* :kconfig:option:`CONFIG_MAX_PTHREAD_COUNT`
|
* :kconfig:option:`CONFIG_MAX_PTHREAD_COUNT`
|
||||||
* :kconfig:option:`CONFIG_MAX_PTHREAD_KEY_COUNT`
|
* :kconfig:option:`CONFIG_MAX_PTHREAD_KEY_COUNT`
|
||||||
* :kconfig:option:`CONFIG_MAX_PTHREAD_MUTEX_COUNT`
|
* :kconfig:option:`CONFIG_MAX_PTHREAD_MUTEX_COUNT`
|
||||||
|
@ -35,7 +34,6 @@ implementation of the POSIX API.
|
||||||
* :kconfig:option:`CONFIG_POSIX_UNAME_NODENAME_LEN`
|
* :kconfig:option:`CONFIG_POSIX_UNAME_NODENAME_LEN`
|
||||||
* :kconfig:option:`CONFIG_POSIX_UNAME_VERSION_LEN`
|
* :kconfig:option:`CONFIG_POSIX_UNAME_VERSION_LEN`
|
||||||
* :kconfig:option:`CONFIG_PTHREAD`
|
* :kconfig:option:`CONFIG_PTHREAD`
|
||||||
* :kconfig:option:`CONFIG_PTHREAD_BARRIER`
|
|
||||||
* :kconfig:option:`CONFIG_PTHREAD_COND`
|
* :kconfig:option:`CONFIG_PTHREAD_COND`
|
||||||
* :kconfig:option:`CONFIG_PTHREAD_CREATE_BARRIER`
|
* :kconfig:option:`CONFIG_PTHREAD_CREATE_BARRIER`
|
||||||
* :kconfig:option:`CONFIG_PTHREAD_IPC`
|
* :kconfig:option:`CONFIG_PTHREAD_IPC`
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#define _POSIX_ASYNCHRONOUS_IO _POSIX_VERSION
|
#define _POSIX_ASYNCHRONOUS_IO _POSIX_VERSION
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_PTHREAD_BARRIER
|
#ifdef CONFIG_POSIX_BARRIERS
|
||||||
#define _POSIX_BARRIERS _POSIX_VERSION
|
#define _POSIX_BARRIERS _POSIX_VERSION
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -144,7 +144,7 @@ enum {
|
||||||
#define __z_posix_sysconf_SC_ADVISORY_INFO (-1L)
|
#define __z_posix_sysconf_SC_ADVISORY_INFO (-1L)
|
||||||
#define __z_posix_sysconf_SC_ASYNCHRONOUS_IO \
|
#define __z_posix_sysconf_SC_ASYNCHRONOUS_IO \
|
||||||
COND_CODE_1(CONFIG_POSIX_ASYNCHRONOUS_IO, (_POSIX_ASYNCHRONOUS_IO), (-1L))
|
COND_CODE_1(CONFIG_POSIX_ASYNCHRONOUS_IO, (_POSIX_ASYNCHRONOUS_IO), (-1L))
|
||||||
#define __z_posix_sysconf_SC_BARRIERS COND_CODE_1(CONFIG_PTHREAD_BARRIER, (_POSIX_BARRIERS), (-1L))
|
#define __z_posix_sysconf_SC_BARRIERS COND_CODE_1(CONFIG_POSIX_BARRIERS, (_POSIX_BARRIERS), (-1L))
|
||||||
#define __z_posix_sysconf_SC_CLOCK_SELECTION \
|
#define __z_posix_sysconf_SC_CLOCK_SELECTION \
|
||||||
COND_CODE_1(CONFIG_POSIX_CLOCK_SELECTION, (_POSIX_CLOCK_SELECTION), (-1L))
|
COND_CODE_1(CONFIG_POSIX_CLOCK_SELECTION, (_POSIX_CLOCK_SELECTION), (-1L))
|
||||||
#define __z_posix_sysconf_SC_CPUTIME \
|
#define __z_posix_sysconf_SC_CPUTIME \
|
||||||
|
|
|
@ -38,6 +38,7 @@ zephyr_library_sources_ifdef(CONFIG_EVENTFD eventfd.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_FNMATCH fnmatch.c)
|
zephyr_library_sources_ifdef(CONFIG_FNMATCH fnmatch.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_GETENTROPY getentropy.c)
|
zephyr_library_sources_ifdef(CONFIG_GETENTROPY getentropy.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_POSIX_ASYNCHRONOUS_IO aio.c)
|
zephyr_library_sources_ifdef(CONFIG_POSIX_ASYNCHRONOUS_IO aio.c)
|
||||||
|
zephyr_library_sources_ifdef(CONFIG_POSIX_BARRIERS barrier.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_POSIX_CONFSTR confstr.c)
|
zephyr_library_sources_ifdef(CONFIG_POSIX_CONFSTR confstr.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_POSIX_DEVICE_IO
|
zephyr_library_sources_ifdef(CONFIG_POSIX_DEVICE_IO
|
||||||
# perror should be moved to the common libc
|
# perror should be moved to the common libc
|
||||||
|
@ -64,7 +65,6 @@ zephyr_library_sources_ifdef(CONFIG_POSIX_TIMERS
|
||||||
)
|
)
|
||||||
zephyr_library_sources_ifdef(CONFIG_POSIX_UNAME uname.c)
|
zephyr_library_sources_ifdef(CONFIG_POSIX_UNAME uname.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC _common.c)
|
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC _common.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_PTHREAD_BARRIER barrier.c)
|
|
||||||
zephyr_library_sources_ifdef(CONFIG_PTHREAD_COND cond.c)
|
zephyr_library_sources_ifdef(CONFIG_PTHREAD_COND cond.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_PTHREAD_KEY key.c)
|
zephyr_library_sources_ifdef(CONFIG_PTHREAD_KEY key.c)
|
||||||
zephyr_library_sources_ifdef(CONFIG_PTHREAD_MUTEX mutex.c)
|
zephyr_library_sources_ifdef(CONFIG_PTHREAD_MUTEX mutex.c)
|
||||||
|
|
|
@ -1,17 +1,30 @@
|
||||||
# Copyright (c) 2017 Intel Corporation
|
# Copyright (c) 2017 Intel Corporation
|
||||||
# Copyright (c) 2023 Meta
|
# Copyright (c) 2023 Meta
|
||||||
|
# Copyright (c) 2024 Tenstorrent
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
TYPE = PTHREAD_BARRIER
|
menuconfig POSIX_BARRIERS
|
||||||
type = pthread_barrier_t
|
bool "POSIX barriers"
|
||||||
type-function = pthread_barrier_wait
|
default y if POSIX_API
|
||||||
rsource "Kconfig.template.pooled_ipc_type"
|
help
|
||||||
|
Select 'y' here to enable POSIX barriers.
|
||||||
|
|
||||||
if PTHREAD_BARRIER
|
For more information please see
|
||||||
|
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html
|
||||||
|
|
||||||
|
if POSIX_BARRIERS
|
||||||
|
|
||||||
|
config MAX_PTHREAD_BARRIER_COUNT
|
||||||
|
int "Maximum number of POSIX barriers"
|
||||||
|
default 5
|
||||||
|
help
|
||||||
|
Maximum simultaneously active pthread_barrier_t in a POSIX application.
|
||||||
|
|
||||||
|
Note: this is a non-standard option.
|
||||||
|
|
||||||
config PTHREAD_CREATE_BARRIER
|
config PTHREAD_CREATE_BARRIER
|
||||||
bool "Use a pthread_barrier_t to serialize pthread_create()"
|
bool "Use a POSIX barrier to serialize pthread_create()"
|
||||||
help
|
help
|
||||||
When running several SMP applications in parallel instances of Qemu,
|
When running several SMP applications in parallel instances of Qemu,
|
||||||
e.g. via twister, explicit serialization may be required between
|
e.g. via twister, explicit serialization may be required between
|
||||||
|
@ -21,4 +34,8 @@ config PTHREAD_CREATE_BARRIER
|
||||||
On such systems, say Y here to introduce explicit serialization
|
On such systems, say Y here to introduce explicit serialization
|
||||||
via pthread_barrier_wait().
|
via pthread_barrier_wait().
|
||||||
|
|
||||||
endif
|
module = PTHREAD_BARRIER
|
||||||
|
module-str = POSIX thread barriers
|
||||||
|
source "subsys/logging/Kconfig.template.log_config"
|
||||||
|
|
||||||
|
endif # POSIX_BARRIERS
|
||||||
|
|
|
@ -57,6 +57,15 @@ config POSIX_MAX_OPEN_FILES
|
||||||
|
|
||||||
See also CONFIG_ZVFS_OPEN_MAX.
|
See also CONFIG_ZVFS_OPEN_MAX.
|
||||||
|
|
||||||
|
config PTHREAD_BARRIER
|
||||||
|
bool "pthread_barrier_t support [DEPRECATED]"
|
||||||
|
select DEPRECATED
|
||||||
|
select POSIX_BARRIERS
|
||||||
|
help
|
||||||
|
This option is deprecated.
|
||||||
|
|
||||||
|
Please use CONFIG_POSIX_BARRIERS instead.
|
||||||
|
|
||||||
config TIMER
|
config TIMER
|
||||||
bool "Timer support [DEPRECATED]"
|
bool "Timer support [DEPRECATED]"
|
||||||
select DEPRECATED
|
select DEPRECATED
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue