sched-idle.c 1.96 KB
Newer Older
1
/*
Philippe Gerum's avatar
Philippe Gerum committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 * Copyright (C) 2008 Philippe Gerum <rpm@xenomai.org>.
 *
 * Xenomai is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation; either version 2 of the License,
 * or (at your option) any later version.
 *
 * Xenomai is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Xenomai; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */
19
#include <cobalt/kernel/sched.h>
Philippe Gerum's avatar
Philippe Gerum committed
20
21
22
23
24
25

static struct xnthread *xnsched_idle_pick(struct xnsched *sched)
{
	return &sched->rootcb;
}

26
27
static bool xnsched_idle_setparam(struct xnthread *thread,
				  const union xnsched_policy_param *p)
28
{
29
	return __xnsched_idle_setparam(thread, p);
30
31
}

32
33
static void xnsched_idle_getparam(struct xnthread *thread,
				  union xnsched_policy_param *p)
34
35
36
37
{
	__xnsched_idle_getparam(thread, p);
}

38
39
static void xnsched_idle_trackprio(struct xnthread *thread,
				   const union xnsched_policy_param *p)
40
{
41
42
43
	__xnsched_idle_trackprio(thread, p);
}

44
static void xnsched_idle_protectprio(struct xnthread *thread, int prio)
45
46
{
	__xnsched_idle_protectprio(thread, prio);
47
48
}

Philippe Gerum's avatar
Philippe Gerum committed
49
struct xnsched_class xnsched_class_idle = {
50
51
52
53
54
55
56
	.sched_init		=	NULL,
	.sched_enqueue		=	NULL,
	.sched_dequeue		=	NULL,
	.sched_requeue		=	NULL,
	.sched_tick		=	NULL,
	.sched_rotate		=	NULL,
	.sched_forget		=	NULL,
57
	.sched_kick		=	NULL,
58
	.sched_declare		=	NULL,
59
60
61
62
	.sched_pick		=	xnsched_idle_pick,
	.sched_setparam		=	xnsched_idle_setparam,
	.sched_getparam		=	xnsched_idle_getparam,
	.sched_trackprio	=	xnsched_idle_trackprio,
63
	.sched_protectprio	=	xnsched_idle_protectprio,
64
	.weight			=	XNSCHED_CLASS_WEIGHT(0),
65
	.policy			=	SCHED_IDLE,
66
	.name			=	"idle"
Philippe Gerum's avatar
Philippe Gerum committed
67
};