Frank Singhoff
Université of Brest, Lab-STICC UMR CNRS 6285
tsim> load init.exe tsim> run
typedef struct nonpreemptive_entry_t { int duration; function_type entrypoint; void* arg; } nonpreemptive_entry_t;where:
extern void nonpreemptive_init(void)Perform all initializations needed by the dispatcher. Must be called before any interaction with the dispatcher.
extern void nonpreemptive_active_wait(uint32_t duration)This function produces an active wait for the current function/task of at least duration microseconds.
extern void nonpreemptive_add_function(nonpreemptive_entry_t entry)This function adds one function/task entry in the scheduling table.
extern void nonpreemptive_add_array_function(nonpreemptive_entry_t entries [], int size)This function adds size function/task entries in the scheduling table. The entries to add are stored in a table (the entries argument).
extern void nonpreemptive_start(int iteration)Start to run tasks/functions declared in the scheduling table. Tasks/functions are run according to their order in the scheduling table. If iteration is equal to 0, then the dispatcher restarts at the beginning of the scheduling table when it achieves the end of the scheduling table. If iteration is a positive integer, then the dispatcher runs the scheduling table iteration times and stops.
extern void nonpreemptive_stop(void)Stop the dispatcher, i.e stop to run tasks/functions of the scheduling table.
extern uint32_t nonpreemptive_get_start_time(void)Return the time at which the dispatcher starts to run functions.
extern uint32_t nonpreemptive_get_current_time(void)Return the current time (which is relative to the scheduling starting time).
extern int nonpreemptive_get_current_entry(void)Return the entry that is currently running.
extern int nonpreemptive_get_current_release_time(void)Return the release time of the current running function/task. Release time is relative to scheduling starting time.