Xenomai API  2.6.5
sched-idle.h
Go to the documentation of this file.
1 
23 #ifndef _XENO_NUCLEUS_SCHED_IDLE_H
24 #define _XENO_NUCLEUS_SCHED_IDLE_H
25 
26 #ifndef _XENO_NUCLEUS_SCHED_H
27 #error "please don't include nucleus/sched-idle.h directly"
28 #endif
29 
30 /* Idle priority level - actually never used for indexing. */
31 #define XNSCHED_IDLE_PRIO -1
32 
33 #if defined(__KERNEL__) || defined(__XENO_SIM__)
34 
35 extern struct xnsched_class xnsched_class_idle;
36 
37 #define xnsched_class_default xnsched_class_rt
38 
39 static inline void __xnsched_idle_setparam(struct xnthread *thread,
40  const union xnsched_policy_param *p)
41 {
42  if (xnthread_test_state(thread, XNSHADOW))
43  xnthread_clear_state(thread, XNOTHER);
44  thread->cprio = p->idle.prio;
45 }
46 
47 static inline void __xnsched_idle_getparam(struct xnthread *thread,
48  union xnsched_policy_param *p)
49 {
50  p->idle.prio = thread->cprio;
51 }
52 
53 static inline void __xnsched_idle_trackprio(struct xnthread *thread,
54  const union xnsched_policy_param *p)
55 {
56  if (p)
57  __xnsched_idle_setparam(thread, p);
58  else
59  thread->cprio = XNSCHED_IDLE_PRIO;
60 }
61 
62 static inline int xnsched_idle_init_tcb(struct xnthread *thread)
63 {
64  return 0;
65 }
66 
67 #endif /* __KERNEL__ || __XENO_SIM__ */
68 
69 #endif /* !_XENO_NUCLEUS_SCHED_IDLE_H */
#define XNOTHER
Non real-time shadow (prio=0)
Definition: thread.h:65
#define XNSHADOW
Shadow thread.
Definition: thread.h:63