Commit 555c07ef authored by TaiJu Wu's avatar TaiJu Wu Committed by Anas Nashif
Browse files

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: default avatarTaiJu Wu <tjwu1217@gmail.com>
parent ea3a47e3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;