diff --git a/doc/services/portability/posix/aep/index.rst b/doc/services/portability/posix/aep/index.rst index 55a841dd56..5e28fa1039 100644 --- a/doc/services/portability/posix/aep/index.rst +++ b/doc/services/portability/posix/aep/index.rst @@ -52,7 +52,7 @@ Minimal Realtime System Profile (PSE51) _POSIX_THREAD_CPUTIME, -1, _POSIX_THREAD_PRIO_INHERIT, 200809L, :kconfig:option:`CONFIG_PTHREAD_MUTEX` _POSIX_THREAD_PRIO_PROTECT, -1, - _POSIX_THREAD_PRIORITY_SCHEDULING, -1, + _POSIX_THREAD_PRIORITY_SCHEDULING, -1, :kconfig:option:`CONFIG_POSIX_PRIORITY_SCHEDULING` (will fail with ``ENOSYS``:ref:`†`) _POSIX_THREAD_SPORADIC_SERVER, -1, _POSIX_TIMEOUTS, 200809L, :kconfig:option:`CONFIG_PTHREAD_IPC` _POSIX_TIMERS, 200809L, :kconfig:option:`CONFIG_POSIX_CLOCK` diff --git a/doc/services/portability/posix/conformance/index.rst b/doc/services/portability/posix/conformance/index.rst index 53f3113ca6..0c38955337 100644 --- a/doc/services/portability/posix/conformance/index.rst +++ b/doc/services/portability/posix/conformance/index.rst @@ -87,7 +87,7 @@ POSIX System Interfaces :ref:`_POSIX_MESSAGE_PASSING`, 200809L, :kconfig:option:`CONFIG_POSIX_MQUEUE` _POSIX_MONOTONIC_CLOCK, 200809L, :kconfig:option:`CONFIG_POSIX_CLOCK` _POSIX_PRIORITIZED_IO, -1, - :ref:`_POSIX_PRIORITY_SCHEDULING`, -1, :kconfig:option:`CONFIG_PTHREAD` + :ref:`_POSIX_PRIORITY_SCHEDULING`, -1, :kconfig:option:`CONFIG_POSIX_PRIORITY_SCHEDULING` (will fail with ``ENOSYS``:ref:`†`) _POSIX_RAW_SOCKETS, 200809L, :kconfig:option:`CONFIG_NET_SOCKETS` _POSIX_SHARED_MEMORY_OBJECTS, -1, _POSIX_SPAWN, -1, diff --git a/lib/posix/CMakeLists.txt b/lib/posix/CMakeLists.txt index e73c78d40e..21d25580aa 100644 --- a/lib/posix/CMakeLists.txt +++ b/lib/posix/CMakeLists.txt @@ -54,7 +54,7 @@ zephyr_library_sources_ifdef(CONFIG_PTHREAD_KEY key.c) zephyr_library_sources_ifdef(CONFIG_PTHREAD_MUTEX mutex.c) zephyr_library_sources_ifdef(CONFIG_PTHREAD pthread.c) zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC rwlock.c) -zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC sched.c) +zephyr_library_sources_ifdef(CONFIG_POSIX_PRIORITY_SCHEDULING sched.c) zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC semaphore.c) zephyr_library_sources_ifdef(CONFIG_PTHREAD_SPINLOCK spinlock.c) diff --git a/lib/posix/Kconfig b/lib/posix/Kconfig index 3fd0131347..3202c13b7d 100644 --- a/lib/posix/Kconfig +++ b/lib/posix/Kconfig @@ -49,6 +49,7 @@ source "lib/posix/Kconfig.limits" source "lib/posix/Kconfig.mqueue" source "lib/posix/Kconfig.mutex" source "lib/posix/Kconfig.pthread" +source "lib/posix/Kconfig.sched" source "lib/posix/Kconfig.semaphore" source "lib/posix/Kconfig.signal" source "lib/posix/Kconfig.spinlock" diff --git a/lib/posix/Kconfig.sched b/lib/posix/Kconfig.sched new file mode 100644 index 0000000000..62e7541c8e --- /dev/null +++ b/lib/posix/Kconfig.sched @@ -0,0 +1,11 @@ +# Copyright (c) 2023 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +config POSIX_PRIORITY_SCHEDULING + bool "_POSIX_PRIORITY_SCHEDULING API support" + default y if PTHREAD + default y if POSIX_API + depends on PTHREAD + help + This enables POSIX scheduling APIs (_POSIX_PRIORITY_SCHEDULING). diff --git a/tests/posix/common/prj.conf b/tests/posix/common/prj.conf index 6c0b9153b6..67dab816dc 100644 --- a/tests/posix/common/prj.conf +++ b/tests/posix/common/prj.conf @@ -4,6 +4,7 @@ CONFIG_MAX_PTHREAD_COUNT=10 CONFIG_ZTEST=y CONFIG_SEM_VALUE_MAX=32767 CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_PRIORITY_SCHEDULING=y CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_MAX_THREAD_BYTES=4 CONFIG_THREAD_NAME=y