forked from Imagelibrary/seL4
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 <curtis.millar@data61.csiro.au>
This commit is contained in:
committed by
Curtis Millar
parent
7e1047af05
commit
1db081075b
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user