Xenomai 3.3.2
Loading...
Searching...
No Matches
sched-idle.h
1/*
2 * Copyright (C) 2008 Philippe Gerum <rpm@xenomai.org>.
3 *
4 * Xenomai is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published
6 * by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
8 *
9 * Xenomai is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Xenomai; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 * 02111-1307, USA.
18 */
19#ifndef _COBALT_KERNEL_SCHED_IDLE_H
20#define _COBALT_KERNEL_SCHED_IDLE_H
21
22#ifndef _COBALT_KERNEL_SCHED_H
23#error "please don't include cobalt/kernel/sched-idle.h directly"
24#endif
25
31/* Idle priority level - actually never used for indexing. */
32#define XNSCHED_IDLE_PRIO -1
33
34extern struct xnsched_class xnsched_class_idle;
35
36static inline bool __xnsched_idle_setparam(struct xnthread *thread,
37 const union xnsched_policy_param *p)
38{
39 xnthread_clear_state(thread, XNWEAK);
40 return xnsched_set_effective_priority(thread, p->idle.prio);
41}
42
43static inline void __xnsched_idle_getparam(struct xnthread *thread,
44 union xnsched_policy_param *p)
45{
46 p->idle.prio = thread->cprio;
47}
48
49static inline void __xnsched_idle_trackprio(struct xnthread *thread,
50 const union xnsched_policy_param *p)
51{
52 if (p)
53 /* Inheriting a priority-less class makes no sense. */
54 XENO_WARN_ON_ONCE(COBALT, 1);
55 else
56 thread->cprio = XNSCHED_IDLE_PRIO;
57}
58
59static inline void __xnsched_idle_protectprio(struct xnthread *thread, int prio)
60{
61 XENO_WARN_ON_ONCE(COBALT, 1);
62}
63
64static inline int xnsched_idle_init_thread(struct xnthread *thread)
65{
66 return 0;
67}
68
71#endif /* !_COBALT_KERNEL_SCHED_IDLE_H */
#define XNWEAK
Non real-time shadow (from the WEAK class)
Definition thread.h:48