Commit Graph

11 Commits

Author SHA1 Message Date
Robin Kastberg ad34c07fbe kernel: make z_is_idle_thread_entry take code ptr
This is causing errors on IAR toolchain.

Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
2026-04-20 17:58:06 +08:00
Peter Mitsis 92e5e006de kernel: Re-order should_preempt() checks
Re-orders the checks in should_preempt() tests so that the
z_is_thread_timeout_active() check is done last.

This change has been observed to give a +7% performance boost on
the thread_metric benchmark's preemptive scheduling test.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2026-04-20 17:51:23 +08:00
Hess Nathan 4196aae76b coding guidelines: comply with MISRA Rule 20.9
- avoid to use undefined macros in #if expressions

Signed-off-by: Hess Nathan <nhess@baumer.com>
2026-04-20 17:14:33 +08:00
Anas Nashif 49f0a635dc kernel: move nothread support to own file
Do not build threading support when CONFIG_MULTITHREADING=n is set and
move needed calls to a new file with the changes needed instead of the
ifdef party in sched.c

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-04-20 17:10:46 +08:00
Anas Nashif d6c57ea8f2 kernel: thread: move thread states to header
Move state string defines into thread header.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-04-20 17:10:05 +08:00
Anas Nashif 4df581abcb kernel: thread: rename is_preempt
Trivila rename to thread_is_preempt.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-04-20 17:10:05 +08:00
Anas Nashif 456e36510a kernel: thread: rename is_metairq
Trivial rename of is_metairq to thread_is_metairq.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-04-20 17:10:05 +08:00
Anas Nashif 71e07b46c8 kernel: move thread related helper function kthread.h
Move some helper functions to inernal kthread.h, to offload crowded
sched.c

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-04-20 17:10:04 +08:00
Simon Hein 844ccf8267 kernel: add closing comments to config endifs
Add a closing comment to the endif with the configuration
information to which the endif belongs too.
To make the code more clearer if the configs need adaptions.

Signed-off-by: Simon Hein <Shein@baumer.com>
2026-04-20 17:08:35 +08:00
Anas Nashif 58ba62698d kernel: split thread monitor
Move thread monitor related functions, not enabled in most cases outside
of thread.c and cleanup headers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-04-20 17:04:57 +08:00
Anas Nashif 79d739f939 kernel: move z_init_static_threads to where it is being used
Move out of thread and put directly in init.c where it is being used.
Also remove definition from kernel.h, this is an internal function and
should not be in a public header.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-04-20 17:04:56 +08:00