Xenomai API  2.6.5
sched-tp.h
Go to the documentation of this file.
1 
23 #ifndef _XENO_NUCLEUS_SCHED_TP_H
24 #define _XENO_NUCLEUS_SCHED_TP_H
25 
26 #ifndef _XENO_NUCLEUS_SCHED_H
27 #error "please don't include nucleus/sched-tp.h directly"
28 #endif
29 
30 #ifdef CONFIG_XENO_OPT_SCHED_TP
31 
32 extern struct xnsched_class xnsched_class_tp;
33 
34 struct xnsched_tp_window {
35  xnticks_t w_offset;
36  int w_part;
37 };
38 
39 struct xnsched_tp_schedule {
40  int pwin_nr;
41  xnticks_t tf_duration;
42  struct xnsched_tp_window pwins[0];
43 };
44 
45 struct xnsched_tp {
46 
47  struct xnsched_tpslot {
48  xnsched_queue_t runnable;
49  } partitions[CONFIG_XENO_OPT_SCHED_TP_NRPART];
50 
51  struct xnsched_tpslot idle; /* !< Idle slot for passive windows. */
52  struct xnsched_tpslot *tps; /* !< Active partition slot */
53  struct xntimer tf_timer; /* !< Time frame timer */
54  struct xnsched_tp_schedule *gps; /* !< Global partition schedule */
55  int wnext; /* !< Next partition window */
56  xnticks_t tf_start; /* !< Start of next time frame */
57  struct xnqueue threads; /* !< Assigned thread queue */
58 };
59 
60 static inline int xnsched_tp_init_tcb(struct xnthread *thread)
61 {
62  inith(&thread->tp_link);
63  thread->tps = NULL;
64 
65  return 0;
66 }
67 
68 struct xnsched_tp_schedule *
69 xnsched_tp_set_schedule(struct xnsched *sched,
70  struct xnsched_tp_schedule *gps);
71 
72 void xnsched_tp_start_schedule(struct xnsched *sched);
73 
74 void xnsched_tp_stop_schedule(struct xnsched *sched);
75 
76 int xnsched_tp_get_partition(struct xnsched *sched);
77 
78 #endif /* !CONFIG_XENO_OPT_SCHED_TP */
79 
80 #endif /* !_XENO_NUCLEUS_SCHED_TP_H */
Scheduling information structure.
Definition: sched.h:66