31 lines
901 B
C
31 lines
901 B
C
#include "extern.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "scheduler_data_c/scheduler_data_types.h"
|
|
|
|
void Extern__deadline_miss_log_step(int data, int task_id, Extern__deadline_miss_log_out *_out)
|
|
{
|
|
printf("Deadline missed: task: %i, data: %i\n", task_id, data);
|
|
}
|
|
|
|
int Extern__random_step(int max, Extern__random_out *_out)
|
|
{
|
|
_out->v = (rand() % max) + 1;
|
|
/* _out->v = max; */
|
|
return _out->v;
|
|
}
|
|
|
|
void Extern__print_scheduler_state_step(Scheduler_data__scheduler_state s, Extern__print_scheduler_state_out *_out)
|
|
{
|
|
printf("Scheduler state - current_date: %i\n", s.current_date);
|
|
for (size_t i = 0; i < Scheduler_data__ntasks; i++) {
|
|
int left = s.tasks[i].left;
|
|
if (s.tasks[i].status == 2)
|
|
left = 0;
|
|
printf("[%li] Task - status: %d - current_deadline: %i - left: %i\n",
|
|
i, s.tasks[i].status, s.tasks[i].current_deadline, left);
|
|
}
|
|
printf("\n");
|
|
|
|
}
|