From 28517c2000f19c3102b25bb3724c3958135d58f3 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Thu, 16 Feb 2023 16:07:19 +0100 Subject: [PATCH] Add another subsystem between nested tasks --- test/emu/nosv/instr_nosv.h | 3 +++ test/emu/nosv/nested-tasks-bad.c | 2 ++ test/emu/nosv/nested-tasks.c | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/test/emu/nosv/instr_nosv.h b/test/emu/nosv/instr_nosv.h index 48e90f5..ea0c187 100644 --- a/test/emu/nosv/instr_nosv.h +++ b/test/emu/nosv/instr_nosv.h @@ -33,5 +33,8 @@ INSTR_1ARG(instr_nosv_task_pause, "VTp", int32_t, id) INSTR_1ARG(instr_nosv_task_resume, "VTr", int32_t, id) INSTR_1ARG(instr_nosv_task_end, "VTe", int32_t, id) +INSTR_0ARG(instr_nosv_submit_enter, "VAs") +INSTR_0ARG(instr_nosv_submit_exit, "VAS") + #endif /* INSTR_NOSV_H */ diff --git a/test/emu/nosv/nested-tasks-bad.c b/test/emu/nosv/nested-tasks-bad.c index 7618ca7..dfb6d8f 100644 --- a/test/emu/nosv/nested-tasks-bad.c +++ b/test/emu/nosv/nested-tasks-bad.c @@ -14,6 +14,8 @@ main(void) uint32_t taskid = 1; instr_nosv_task_create(taskid, typeid); instr_nosv_task_execute(taskid); + /* Change subsystem to prevent duplicates */ + instr_nosv_submit_enter(); /* Run another nested task with same id (should fail) */ instr_nosv_task_execute(taskid); diff --git a/test/emu/nosv/nested-tasks.c b/test/emu/nosv/nested-tasks.c index 4fdbbab..5814a91 100644 --- a/test/emu/nosv/nested-tasks.c +++ b/test/emu/nosv/nested-tasks.c @@ -7,6 +7,8 @@ static void create_and_run(int32_t id, uint32_t typeid, int us) { instr_nosv_task_create(id, typeid); + /* Change subsystem to prevent duplicates */ + instr_nosv_submit_enter(); instr_nosv_task_execute(id); usleep(us); } @@ -26,8 +28,11 @@ main(void) create_and_run(i + 1, typeid, 500); /* End the tasks in the opposite order */ - for (int i = ntasks - 1; i >= 0; i--) + for (int i = ntasks - 1; i >= 0; i--) { instr_nosv_task_end(i + 1); + /* Change subsystem to prevent duplicates */ + instr_nosv_submit_exit(); + } instr_end();