00001
00023 #ifndef _XENO_NUCLEUS_SCHED_IDLE_H
00024 #define _XENO_NUCLEUS_SCHED_IDLE_H
00025
00026 #ifndef _XENO_NUCLEUS_SCHED_H
00027 #error "please don't include nucleus/sched-idle.h directly"
00028 #endif
00029
00030
00031 #define XNSCHED_IDLE_PRIO -1
00032
00033 #if defined(__KERNEL__) || defined(__XENO_SIM__)
00034
00035 extern struct xnsched_class xnsched_class_idle;
00036
00037 #define xnsched_class_default xnsched_class_rt
00038
00039 static inline void __xnsched_idle_setparam(struct xnthread *thread,
00040 const union xnsched_policy_param *p)
00041 {
00042 thread->cprio = p->idle.prio;
00043 }
00044
00045 static inline void __xnsched_idle_getparam(struct xnthread *thread,
00046 union xnsched_policy_param *p)
00047 {
00048 p->idle.prio = thread->cprio;
00049 }
00050
00051 static inline void __xnsched_idle_trackprio(struct xnthread *thread,
00052 const union xnsched_policy_param *p)
00053 {
00054 if (p)
00055 __xnsched_idle_setparam(thread, p);
00056 else
00057 thread->cprio = XNSCHED_IDLE_PRIO;
00058 }
00059
00060 static inline int xnsched_idle_init_tcb(struct xnthread *thread)
00061 {
00062 return 0;
00063 }
00064
00065 #endif
00066
00067 #endif