From 26a29d3edacf05797ed8827890d9e3e7165438b0 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 30 May 2022 15:11:58 +0200 Subject: [PATCH] Emit the rank too when the task ends --- emu_nosv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emu_nosv.c b/emu_nosv.c index 8d5ef8e..1d09782 100644 --- a/emu_nosv.c +++ b/emu_nosv.c @@ -251,6 +251,9 @@ pre_task_not_running(struct ovni_emu *emu) chan_set(&th->chan[CHAN_NOSV_TYPEID], 0); chan_set(&th->chan[CHAN_NOSV_APPID], 0); + if(emu->cur_loom->rank_enabled) + chan_set(&th->chan[CHAN_NOSV_RANK], 0); + chan_pop(&th->chan[CHAN_NOSV_SUBSYSTEM], ST_NOSV_TASK_RUNNING); } @@ -304,6 +307,9 @@ pre_task_switch(struct ovni_emu *emu, struct nosv_task *prev_task, chan_set(&th->chan[CHAN_NOSV_TASKID], next_task->id); + /* No need to change the rank, as we can only switch to tasks of + * the same loom (with same rank) */ + /* Only emit the new type if necessary */ if(prev_task->type_id != next_task->type_id) chan_set(&th->chan[CHAN_NOSV_TYPEID], next_task->type_id);