Xenomai API  2.5.6.1
include/nucleus/sched-tp.h
Go to the documentation of this file.
00001 
00023 #ifndef _XENO_NUCLEUS_SCHED_TP_H
00024 #define _XENO_NUCLEUS_SCHED_TP_H
00025 
00026 #ifndef _XENO_NUCLEUS_SCHED_H
00027 #error "please don't include nucleus/sched-tp.h directly"
00028 #endif
00029 
00030 #ifdef CONFIG_XENO_OPT_SCHED_TP
00031 
00032 extern struct xnsched_class xnsched_class_tp;
00033 
00034 struct xnsched_tp_window {
00035         xnticks_t w_offset;
00036         int w_part;
00037 };
00038 
00039 struct xnsched_tp_schedule {
00040         int pwin_nr;
00041         xnticks_t tf_duration;
00042         struct xnsched_tp_window pwins[0];
00043 };
00044 
00045 struct xnsched_tp {
00046 
00047         struct xnsched_tpslot {
00048                 xnsched_queue_t runnable; 
00049         } partitions[CONFIG_XENO_OPT_SCHED_TP_NRPART];
00050 
00051         struct xnsched_tpslot idle;     /* !< Idle slot for passive windows. */
00052         struct xnsched_tpslot *tps;     /* !< Active partition slot */
00053         struct xntimer tf_timer;        /* !< Time frame timer */
00054         struct xnsched_tp_schedule *gps; /* !< Global partition schedule */
00055         int wnext;                       /* !< Next partition window */
00056         xnticks_t tf_start;              /* !< Start of next time frame */
00057         struct xnqueue threads;          /* !< Assigned thread queue */
00058 };
00059 
00060 static inline int xnsched_tp_init_tcb(struct xnthread *thread)
00061 {
00062         inith(&thread->tp_link);
00063         thread->tps = NULL;
00064 
00065         return 0;
00066 }
00067 
00068 struct xnsched_tp_schedule *
00069 xnsched_tp_set_schedule(struct xnsched *sched,
00070                         struct xnsched_tp_schedule *gps);
00071 
00072 void xnsched_tp_start_schedule(struct xnsched *sched);
00073 
00074 void xnsched_tp_stop_schedule(struct xnsched *sched);
00075 
00076 int xnsched_tp_get_partition(struct xnsched *sched);
00077 
00078 #endif /* !CONFIG_XENO_OPT_SCHED_TP */
00079 
00080 #endif /* !_XENO_NUCLEUS_SCHED_TP_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines