Xenomai  3.0.5
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 
34 extern struct xnsched_class xnsched_class_idle;
35 
36 static inline void __xnsched_idle_setparam(struct xnthread *thread,
37  const union xnsched_policy_param *p)
38 {
39  xnthread_clear_state(thread, XNWEAK);
40  thread->cprio = p->idle.prio;
41 }
42 
43 static inline void __xnsched_idle_getparam(struct xnthread *thread,
44  union xnsched_policy_param *p)
45 {
46  p->idle.prio = thread->cprio;
47 }
48 
49 static inline void __xnsched_idle_trackprio(struct xnthread *thread,
50  const union xnsched_policy_param *p)
51 {
52  if (p)
53  __xnsched_idle_setparam(thread, p);
54  else
55  thread->cprio = XNSCHED_IDLE_PRIO;
56 }
57 
58 static inline int xnsched_idle_init_thread(struct xnthread *thread)
59 {
60  return 0;
61 }
62 
65 #endif /* !_COBALT_KERNEL_SCHED_IDLE_H */
#define XNWEAK
Non real-time shadow (from the WEAK class)
Definition: thread.h:49