Skip to content

Commit e67bea5

Browse files
committed
posix: sched: Add CONFIG_POSIX_PRIORITY_SCHEDULING
Add `CONFIG_POSIX_PRIORITY_SCHEDULING` Kconfig option to select APIs from PSE53 `_POSIX_PRIORITY_SCHEDULING` option group. Signed-off-by: Dmitrii Golovanov <[email protected]>
1 parent 0a8d03b commit e67bea5

File tree

6 files changed

+16
-3
lines changed

6 files changed

+16
-3
lines changed

doc/services/portability/posix/aep/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Minimal Realtime System Profile (PSE51)
5252
_POSIX_THREAD_CPUTIME, -1,
5353
_POSIX_THREAD_PRIO_INHERIT, 200809L, :kconfig:option:`CONFIG_PTHREAD_MUTEX`
5454
_POSIX_THREAD_PRIO_PROTECT, -1,
55-
_POSIX_THREAD_PRIORITY_SCHEDULING, -1,
55+
_POSIX_THREAD_PRIORITY_SCHEDULING, -1, :kconfig:option:`CONFIG_POSIX_PRIORITY_SCHEDULING` (will fail with ``ENOSYS``:ref:`†<posix_undefined_behaviour>`)
5656
_POSIX_THREAD_SPORADIC_SERVER, -1,
5757
_POSIX_TIMEOUTS, 200809L, :kconfig:option:`CONFIG_PTHREAD_IPC`
5858
_POSIX_TIMERS, 200809L, :kconfig:option:`CONFIG_POSIX_CLOCK`

doc/services/portability/posix/conformance/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ POSIX System Interfaces
8787
:ref:`_POSIX_MESSAGE_PASSING<posix_option_message_passing>`, 200809L, :kconfig:option:`CONFIG_POSIX_MQUEUE`
8888
_POSIX_MONOTONIC_CLOCK, 200809L, :kconfig:option:`CONFIG_POSIX_CLOCK`
8989
_POSIX_PRIORITIZED_IO, -1,
90-
:ref:`_POSIX_PRIORITY_SCHEDULING<posix_option_priority_scheduling>`, -1, :kconfig:option:`CONFIG_PTHREAD`
90+
:ref:`_POSIX_PRIORITY_SCHEDULING<posix_option_priority_scheduling>`, -1, :kconfig:option:`CONFIG_POSIX_PRIORITY_SCHEDULING` (will fail with ``ENOSYS``:ref:`†<posix_undefined_behaviour>`)
9191
_POSIX_RAW_SOCKETS, 200809L, :kconfig:option:`CONFIG_NET_SOCKETS`
9292
_POSIX_SHARED_MEMORY_OBJECTS, -1,
9393
_POSIX_SPAWN, -1,

lib/posix/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ zephyr_library_sources_ifdef(CONFIG_PTHREAD_KEY key.c)
5454
zephyr_library_sources_ifdef(CONFIG_PTHREAD_MUTEX mutex.c)
5555
zephyr_library_sources_ifdef(CONFIG_PTHREAD pthread.c)
5656
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC rwlock.c)
57-
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC sched.c)
57+
zephyr_library_sources_ifdef(CONFIG_POSIX_PRIORITY_SCHEDULING sched.c)
5858
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC semaphore.c)
5959
zephyr_library_sources_ifdef(CONFIG_PTHREAD_SPINLOCK spinlock.c)
6060

lib/posix/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ source "lib/posix/Kconfig.limits"
4949
source "lib/posix/Kconfig.mqueue"
5050
source "lib/posix/Kconfig.mutex"
5151
source "lib/posix/Kconfig.pthread"
52+
source "lib/posix/Kconfig.sched"
5253
source "lib/posix/Kconfig.semaphore"
5354
source "lib/posix/Kconfig.signal"
5455
source "lib/posix/Kconfig.spinlock"

lib/posix/Kconfig.sched

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2023 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config POSIX_PRIORITY_SCHEDULING
6+
bool "_POSIX_PRIORITY_SCHEDULING API support"
7+
default y if PTHREAD
8+
default y if POSIX_API
9+
depends on PTHREAD
10+
help
11+
This enables POSIX scheduling APIs (_POSIX_PRIORITY_SCHEDULING).

tests/posix/common/prj.conf

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CONFIG_MAX_PTHREAD_COUNT=10
44
CONFIG_ZTEST=y
55
CONFIG_SEM_VALUE_MAX=32767
66
CONFIG_POSIX_MQUEUE=y
7+
CONFIG_POSIX_PRIORITY_SCHEDULING=y
78
CONFIG_HEAP_MEM_POOL_SIZE=4096
89
CONFIG_MAX_THREAD_BYTES=4
910
CONFIG_THREAD_NAME=y

0 commit comments

Comments
 (0)