00001
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __DISPATCH_NEW_H__
00025 #define __DISPATCH_NEW_H__
00026
00027 #include "rres_config.h"
00028 #include <linux/sched.h>
00029 #include <linux/aquosa/qos_debug.h>
00030
00032 static inline int task_ready(struct task_struct * task) {
00033 return (task->state == TASK_RUNNING);
00034 }
00035
00036 #define rres_init_sched_param(task) \
00037 set_task_rr_prio(task, RRES_DISPATCH_PRIORITY)
00038
00039 #define rres_task_sched_default(task) \
00040 set_task_rr_prio(task, -1)
00041
00042 #define SCHED_OTHER SCHED_NORMAL
00043
00044 extern void activate_task_local(struct task_struct *task);
00045 extern void deactivate_task_local(struct task_struct *task);
00046
00048 static inline void stop_task(struct task_struct *t) {
00049
00050
00051
00052 if (t->array) {
00053 qos_log_debug("Deactivating task %d", t->pid);
00054 deactivate_task_local(t);
00055 } else {
00056 qos_log_debug("Skipping deactivation of task %d", t->pid);
00057 }
00058
00059 }
00060
00062 static inline void dispatch_task(struct task_struct *t) {
00063
00064
00065
00066 if (! t->array) {
00067 qos_log_debug("Activating task %d", t->pid);
00068 activate_task_local(t);
00069 } else {
00070 qos_log_debug("Skipping activation of task %d", t->pid);
00071 }
00072
00073 }
00074
00076
00077
00078
00079
00080
00081
00082
00083
00084 #endif
00085