From b44c2454052fb4b9137f7acf8dd1be2805f74a65 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 21 Sep 2022 17:30:23 +0200 Subject: [PATCH] Use 6t events for subsystem transition No longer mix task state transitions (6T) with subsystem changes. --- doc/emulation/events.md | 6 ++++++ emu_nanos6.c | 28 +--------------------------- 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/doc/emulation/events.md b/doc/emulation/events.md index 52097d9..952b831 100644 --- a/doc/emulation/events.md +++ b/doc/emulation/events.md @@ -178,6 +178,12 @@ KCI Is back in the CPU due to a context switch 6F[ Begins to spawn a function via spawnFunction() 6F] Ends spawning a function +6t[ Begins running the task body +6t] Ends running the task body + +6O[ Begins running the task body as taskfor collaborator +6O] Ends running the task body as taskfor collaborator + 6Dr Begins the registration of a task's accesses 6DR Ends the registration of a task's accesses 6Du Begins the unregistration of a task's accesses diff --git a/emu_nanos6.c b/emu_nanos6.c index f34c22e..7ba676b 100644 --- a/emu_nanos6.c +++ b/emu_nanos6.c @@ -77,30 +77,6 @@ hook_init_nanos6(struct ovni_emu *emu) /* --------------------------- pre ------------------------------- */ -static void -update_ss_channel(struct ovni_emu *emu, int tr) -{ - struct ovni_ethread *th = emu->cur_thread; - struct ovni_chan *chan = &th->chan[CHAN_NANOS6_SUBSYSTEM]; - - switch(tr) - { - case 'x': - case 'X': - chan_push(chan, ST_NANOS6_TASK_BODY); - break; - case 'e': - case 'E': - chan_pop(chan, ST_NANOS6_TASK_BODY); - break; - case 'r': - case 'p': - break; - default: - edie(emu, "unexpected transition value %c\n", tr); - } -} - static void chan_task_stopped(struct ovni_emu *emu) { @@ -287,9 +263,6 @@ update_task(struct ovni_emu *emu) /* Update the task related channels now */ update_task_channels(emu, tr, prev, next); - /* Update the subsystem channel */ - update_ss_channel(emu, tr); - enforce_task_rules(emu, tr, prev, next); } @@ -552,6 +525,7 @@ hook_pre_nanos6(struct ovni_emu *emu) case 'U': pre_ss(emu, ST_NANOS6_TASK_SUBMIT); break; case 'F': pre_ss(emu, ST_NANOS6_TASK_SPAWNING); break; case 'O': pre_ss(emu, ST_NANOS6_TASK_FOR); break; + case 't': pre_ss(emu, ST_NANOS6_TASK_BODY); break; case 'H': pre_thread(emu); break; case 'D': pre_deps(emu); break; case 'B': pre_blocking(emu); break;