From 1db081075bc74fdb7cb20f8960556aa4708022d9 Mon Sep 17 00:00:00 2001 From: Curtis Millar Date: Wed, 7 Oct 2020 12:37:21 +1100 Subject: [PATCH] mcs: Fix time consumed time overflow case We must store the consumed time in us rather than in ticks into message registers. In the overflow case, the time being stored was the maximum US time in ticks, this fix converts it to US before being stored. Signed-off-by: Curtis Millar --- src/object/schedcontext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/object/schedcontext.c b/src/object/schedcontext.c index d94ffe23d..03fef31f9 100644 --- a/src/object/schedcontext.c +++ b/src/object/schedcontext.c @@ -363,7 +363,7 @@ time_t schedContext_updateConsumed(sched_context_t *sc) ticks_t consumed = sc->scConsumed; if (consumed >= getMaxTicksToUs()) { sc->scConsumed -= getMaxTicksToUs(); - return getMaxTicksToUs(); + return ticksToUs(getMaxTicksToUs()); } else { sc->scConsumed = 0; return ticksToUs(consumed);