Add another subsystem between nested tasks

This commit is contained in:
Rodrigo Arias 2023-02-16 16:07:19 +01:00 committed by Rodrigo Arias Mallo
parent e22e6a21e0
commit 28517c2000
3 changed files with 11 additions and 1 deletions

View File

@ -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_resume, "VTr", int32_t, id)
INSTR_1ARG(instr_nosv_task_end, "VTe", 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 */ #endif /* INSTR_NOSV_H */

View File

@ -14,6 +14,8 @@ main(void)
uint32_t taskid = 1; uint32_t taskid = 1;
instr_nosv_task_create(taskid, typeid); instr_nosv_task_create(taskid, typeid);
instr_nosv_task_execute(taskid); instr_nosv_task_execute(taskid);
/* Change subsystem to prevent duplicates */
instr_nosv_submit_enter();
/* Run another nested task with same id (should fail) */ /* Run another nested task with same id (should fail) */
instr_nosv_task_execute(taskid); instr_nosv_task_execute(taskid);

View File

@ -7,6 +7,8 @@ static void
create_and_run(int32_t id, uint32_t typeid, int us) create_and_run(int32_t id, uint32_t typeid, int us)
{ {
instr_nosv_task_create(id, typeid); instr_nosv_task_create(id, typeid);
/* Change subsystem to prevent duplicates */
instr_nosv_submit_enter();
instr_nosv_task_execute(id); instr_nosv_task_execute(id);
usleep(us); usleep(us);
} }
@ -26,8 +28,11 @@ main(void)
create_and_run(i + 1, typeid, 500); create_and_run(i + 1, typeid, 500);
/* End the tasks in the opposite order */ /* 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); instr_nosv_task_end(i + 1);
/* Change subsystem to prevent duplicates */
instr_nosv_submit_exit();
}
instr_end(); instr_end();