#ifndef _LINUX_SCHED_MC_H_ #define _LINUX_SCHED_MC_H_ /* criticality levels */ enum crit_level { /* probably don't need to assign these (paranoid) */ CRIT_LEVEL_A = 0, CRIT_LEVEL_B = 1, CRIT_LEVEL_C = 2, NUM_CRIT_LEVELS = 3, }; struct mc_task { enum crit_level crit; int lvl_a_id; }; struct mc_job { int is_ghost:1; lt_t ghost_budget; }; #ifdef __KERNEL__ /* only used in the kernel (no user space) */ struct mc_data { struct mc_task mc_task; struct mc_job mc_job; }; #define tsk_mc_data(t) (tsk_rt(t)->mc_data) #define tsk_mc_crit(t) (tsk_mc_data(t)->mc_task.crit) #define is_ghost(t) (tsk_mc_data(t)->mc_job.is_ghost) /* * Cache the budget along with the struct PID for a task so that we don't need * to fetch its task_struct every time we check to see what should be * scheduled. */ struct ce_dom_pid_entry { struct pid *pid; lt_t budget; /* accumulated (summed) budgets, including this one */ lt_t acc_time; int expected_job; }; struct ce_dom_data { int cpu; struct task_struct *scheduled, *should_schedule; /* * Each CPU needs a mapping of level A ID (integer) to struct pid so * that we can get its task struct. */ struct ce_dom_pid_entry pid_entries[CONFIG_PLUGIN_MC_LEVEL_A_MAX_TASKS]; int num_pid_entries; lt_t cycle_time; struct hrtimer_start_on_info timer_info; struct hrtimer timer; }; #endif /* __KERNEL__ */ #endif