clocksource: Get rid of the hardcoded 5 seconds sleep time limit
[linux-2.6/linux-mips.git] / kernel / sched_stoptask.c
blob1ba2bd40fdacf3f89e0b71f0f8c1020c0151a05c
1 /*
2 * stop-task scheduling class.
4 * The stop task is the highest priority task in the system, it preempts
5 * everything and will be preempted by nothing.
7 * See kernel/stop_machine.c
8 */
10 #ifdef CONFIG_SMP
11 static int
12 select_task_rq_stop(struct rq *rq, struct task_struct *p,
13 int sd_flag, int flags)
15 return task_cpu(p); /* stop tasks as never migrate */
17 #endif /* CONFIG_SMP */
19 static void
20 check_preempt_curr_stop(struct rq *rq, struct task_struct *p, int flags)
22 /* we're never preempted */
25 static struct task_struct *pick_next_task_stop(struct rq *rq)
27 struct task_struct *stop = rq->stop;
29 if (stop && stop->se.on_rq)
30 return stop;
32 return NULL;
35 static void
36 enqueue_task_stop(struct rq *rq, struct task_struct *p, int flags)
40 static void
41 dequeue_task_stop(struct rq *rq, struct task_struct *p, int flags)
45 static void yield_task_stop(struct rq *rq)
47 BUG(); /* the stop task should never yield, its pointless. */
50 static void put_prev_task_stop(struct rq *rq, struct task_struct *prev)
54 static void task_tick_stop(struct rq *rq, struct task_struct *curr, int queued)
58 static void set_curr_task_stop(struct rq *rq)
62 static void switched_to_stop(struct rq *rq, struct task_struct *p)
64 BUG(); /* its impossible to change to this class */
67 static void
68 prio_changed_stop(struct rq *rq, struct task_struct *p, int oldprio)
70 BUG(); /* how!?, what priority? */
73 static unsigned int
74 get_rr_interval_stop(struct rq *rq, struct task_struct *task)
76 return 0;
80 * Simple, special scheduling class for the per-CPU stop tasks:
82 static const struct sched_class stop_sched_class = {
83 .next = &rt_sched_class,
85 .enqueue_task = enqueue_task_stop,
86 .dequeue_task = dequeue_task_stop,
87 .yield_task = yield_task_stop,
89 .check_preempt_curr = check_preempt_curr_stop,
91 .pick_next_task = pick_next_task_stop,
92 .put_prev_task = put_prev_task_stop,
94 #ifdef CONFIG_SMP
95 .select_task_rq = select_task_rq_stop,
96 #endif
98 .set_curr_task = set_curr_task_stop,
99 .task_tick = task_tick_stop,
101 .get_rr_interval = get_rr_interval_stop,
103 .prio_changed = prio_changed_stop,
104 .switched_to = switched_to_stop,