Commit ca7dcefb authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka
Browse files

cobalt/sched: weak: add early parameter checking handler

This is actually a plain conversion of the former sched_declare()
handler to the recently introduced sched_chkparam(), which only checks
the weak scheduling parameters.

By doing so, we ensure that those checks are done early and
unconditionally in xnsched_set_policy().
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <>
parent ce176805
......@@ -76,8 +76,8 @@ static void xnsched_weak_protectprio(struct xnthread *thread, int prio)
thread->cprio = prio;
static int xnsched_weak_declare(struct xnthread *thread,
const union xnsched_policy_param *p)
static int xnsched_weak_chkparam(struct xnthread *thread,
const union xnsched_policy_param *p)
if (p->weak.prio < XNSCHED_WEAK_MIN_PRIO ||
p->weak.prio > XNSCHED_WEAK_MAX_PRIO)
......@@ -208,7 +208,7 @@ struct xnsched_class xnsched_class_weak = {
.sched_rotate = NULL,
.sched_forget = NULL,
.sched_kick = NULL,
.sched_declare = xnsched_weak_declare,
.sched_chkparam = xnsched_weak_chkparam,
.sched_setparam = xnsched_weak_setparam,
.sched_trackprio = xnsched_weak_trackprio,
.sched_protectprio = xnsched_weak_protectprio,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment