/* sched_plugin.c -- core infrastructure for the scheduler plugin system * * This file includes the initialization of the plugin system, the no-op Linux * scheduler plugin and some dummy functions. */ #include #include /************************************************************* * Dummy plugin functions * *************************************************************/ void litmus_dummy_finish_switch(struct task_struct * prev) { } int litmus_dummy_schedule(struct task_struct * prev, struct task_struct** next, runqueue_t* q) { return 0; } reschedule_check_t litmus_dummy_scheduler_tick(void) { return NO_RESCHED; } long litmus_dummy_prepare_task(struct task_struct *t) { return 0; } void litmus_dummy_wake_up_task(struct task_struct *task) { printk(KERN_WARNING "task %d: unhandled real-time wake up!\n", task->pid); } void litmus_dummy_task_blocks(struct task_struct *task) { } long litmus_dummy_tear_down(struct task_struct *task) { return 0; } int litmus_dummy_scheduler_setup(int cmd, void __user *parameter) { return -EPERM; } long litmus_dummy_sleep_next_period(void) { return -EPERM; } long litmus_dummy_inherit_priority(struct pi_semaphore *sem, struct task_struct *new_owner) { return -EPERM; } long litmus_dummy_return_priority(struct pi_semaphore *sem) { return -EPERM; } long litmus_dummy_pi_block(struct pi_semaphore *sem, struct task_struct *new_waiter) { return -EPERM; } /* The default scheduler plugin. It doesn't do anything and lets Linux do its * job. */ sched_plugin_t linux_sched_plugin = { .plugin_name = "Linux", .ready_to_use = 1, .scheduler_tick = litmus_dummy_scheduler_tick, .prepare_task = litmus_dummy_prepare_task, .tear_down = litmus_dummy_tear_down, .wake_up_task = litmus_dummy_wake_up_task, .task_blocks = litmus_dummy_task_blocks, .sleep_next_period = litmus_dummy_sleep_next_period, .schedule = litmus_dummy_schedule, .finish_switch = litmus_dummy_finish_switch, .scheduler_setup = litmus_dummy_scheduler_setup, .inherit_priority = litmus_dummy_inherit_priority, .return_priority = litmus_dummy_return_priority, .pi_block = litmus_dummy_pi_block }; /* * The reference to current plugin that is used to schedule tasks within * the system. It stores references to actual function implementations * Should be initialized by calling "init_***_plugin()" */ sched_plugin_t *curr_sched_plugin = &linux_sched_plugin;