diff --git a/arch/sparc/kernel/irqtrap.S b/arch/sparc/kernel/irqtrap.S index 8d1e0a9b3716884d6c591a957b75765c2dd85730..b1bb5d8d6bdb32f75be791a437dfc25681103bce 100644 --- a/arch/sparc/kernel/irqtrap.S +++ b/arch/sparc/kernel/irqtrap.S @@ -51,8 +51,10 @@ __interrupt_entry: #else /* CONFIG_SPARC_NESTED_IRQ */ or %t_psr, PSR_PIL, %t_tmp +#ifndef CONFIG_TASK_PREEMPTION_DISABLE call schedule nop +#endif wr %t_tmp, PSR_ET, %psr ! we can't be preemted here, so set PIL ! to max and xor ET to enable ! delayed-write; nops not needed if diff --git a/kernel/Kconfig b/kernel/Kconfig index eb60f3cf5e964219f2ab385f9afeacfcfc31dd10..51bf1e7011dd39e3503c2de47d02fdfd51633e91 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -26,6 +26,19 @@ config IRQ_STATS_COLLECT Collect interrupt statistics and expose them in the systl tree. +config TASK_PREEMPTION_DISABLE + bool "Disable forced preemption of tasks" + default n + help + Say Y here to change the task system to be collaborative, i.e. + for voluntary yields and run-to-completion. Note that this does not + mean that tasks can not be preempted at all, just that there will + be no supervisor to instigate such an event. Any IRQs will still + preempt a running task, as will blocked I/O and locking operations. + The latter may result in a rescheduling events to prevent priority + inversion etc. + WARNING: Currently unstable. Use for development only. You have been warned. + config SOC bool "Enable System-On-Chip configurations" default n