sched: Limit deadline scheduler parameter

The deadline of deadline scheduler should lager than zero
because if deadline is negative, it menas the task should
be finished in past.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
This commit is contained in:
TaiJu Wu 2024-03-14 03:09:41 +08:00 committed by Anas Nashif
commit 555c07ef08

View file

@ -1058,6 +1058,9 @@ static inline void z_vrfy_k_thread_priority_set(k_tid_t thread, int prio)
#ifdef CONFIG_SCHED_DEADLINE
void z_impl_k_thread_deadline_set(k_tid_t tid, int deadline)
{
deadline = CLAMP(deadline, 0, INT_MAX);
struct k_thread *thread = tid;
int32_t newdl = k_cycle_get_32() + deadline;