Commit ec45b29e authored by Luis Ubieda's avatar Luis Ubieda Committed by Benjamin Cabé
Browse files

p4wq: Add Kconfig to perform early init on threads

In order to make them functional for devices during init. Default
behavior is to keep late initialization, as before.

Signed-off-by: default avatarLuis Ubieda <luisf@croxel.com>
parent 5a31ac1d
Loading
Loading
Loading
Loading
+10 −0
Changes for lib/os/Kconfig: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -106,6 +106,16 @@ config MPSC_CLEAR_ALLOCATED
	  When enabled packet space is zeroed before returning from allocation.
endif

if SCHED_DEADLINE

config P4WQ_INIT_STAGE_EARLY
	bool "Early initialization of P4WQ threads"
	help
	  Initialize P4WQ threads early so that the P4WQ can be used on devices
	  initialization sequence.

endif

config REBOOT
	bool "Reboot functionality"
	help
+4 −0
Changes for lib/os/p4wq.c: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -218,7 +218,11 @@ void k_p4wq_enable_static_thread(struct k_p4wq *queue, struct k_thread *thread,
 * so they can initialize in parallel instead of serially on the main
 * CPU.
 */
#if defined(CONFIG_P4WQ_INIT_STAGE_EARLY)
SYS_INIT(static_init, POST_KERNEL, 1);
#else
SYS_INIT(static_init, APPLICATION, 99);
#endif

void k_p4wq_submit(struct k_p4wq *queue, struct k_p4wq_work *item)
{