aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/rt_param.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/litmus/rt_param.h')
-rw-r--r--include/litmus/rt_param.h52
1 files changed, 46 insertions, 6 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index 2026819..de29bac 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -33,6 +33,24 @@ typedef enum {
33 PRECISE_ENFORCEMENT /* budgets are enforced with hrtimers */ 33 PRECISE_ENFORCEMENT /* budgets are enforced with hrtimers */
34} budget_policy_t; 34} budget_policy_t;
35 35
36/* Release behaviors for jobs. PERIODIC and EARLY jobs
37 must end by calling sys_complete_job() (or equivalent)
38 to set up their next release and deadline. */
39typedef enum {
40 /* Jobs are released sporadically (provided job precedence
41 constraints are met). */
42 SPORADIC,
43
44 /* Jobs are released periodically (provided job precedence
45 constraints are met). */
46 PERIODIC,
47
48 /* Jobs are released immediately after meeting precedence
49 constraints. Beware this can peg your CPUs if used in
50 the wrong applications. Only supported by EDF schedulers. */
51 EARLY
52} release_policy_t;
53
36/* We use the common priority interpretation "lower index == higher priority", 54/* We use the common priority interpretation "lower index == higher priority",
37 * which is commonly used in fixed-priority schedulability analysis papers. 55 * which is commonly used in fixed-priority schedulability analysis papers.
38 * So, a numerically lower priority value implies higher scheduling priority, 56 * So, a numerically lower priority value implies higher scheduling priority,
@@ -61,7 +79,8 @@ struct rt_task {
61 unsigned int cpu; 79 unsigned int cpu;
62 unsigned int priority; 80 unsigned int priority;
63 task_class_t cls; 81 task_class_t cls;
64 budget_policy_t budget_policy; /* ignored by pfair */ 82 budget_policy_t budget_policy; /* ignored by pfair */
83 release_policy_t release_policy;
65}; 84};
66 85
67union np_flag { 86union np_flag {
@@ -89,11 +108,29 @@ union np_flag {
89 * determining preemption/migration overheads). 108 * determining preemption/migration overheads).
90 */ 109 */
91struct control_page { 110struct control_page {
111 /* This flag is used by userspace to communicate non-preempive
112 * sections. */
92 volatile union np_flag sched; 113 volatile union np_flag sched;
93 114
115 volatile uint64_t irq_count; /* Incremented by the kernel each time an IRQ is
116 * handled. */
117
118 /* Locking overhead tracing: userspace records here the time stamp
119 * and IRQ counter prior to starting the system call. */
120 uint64_t ts_syscall_start; /* Feather-Trace cycles */
121 uint64_t irq_syscall_start; /* Snapshot of irq_count when the syscall
122 * started. */
123
94 /* to be extended */ 124 /* to be extended */
95}; 125};
96 126
127/* Expected offsets within the control page. */
128
129#define LITMUS_CP_OFFSET_SCHED 0
130#define LITMUS_CP_OFFSET_IRQ_COUNT 8
131#define LITMUS_CP_OFFSET_TS_SC_START 16
132#define LITMUS_CP_OFFSET_IRQ_SC_START 24
133
97/* don't export internal data structures to user space (liblitmus) */ 134/* don't export internal data structures to user space (liblitmus) */
98#ifdef __KERNEL__ 135#ifdef __KERNEL__
99 136
@@ -142,11 +179,19 @@ struct rt_param {
142 /* is the task present? (true if it can be scheduled) */ 179 /* is the task present? (true if it can be scheduled) */
143 unsigned int present:1; 180 unsigned int present:1;
144 181
182 /* has the task completed? */
183 unsigned int completed:1;
184
145#ifdef CONFIG_LITMUS_LOCKING 185#ifdef CONFIG_LITMUS_LOCKING
146 /* Is the task being priority-boosted by a locking protocol? */ 186 /* Is the task being priority-boosted by a locking protocol? */
147 unsigned int priority_boosted:1; 187 unsigned int priority_boosted:1;
148 /* If so, when did this start? */ 188 /* If so, when did this start? */
149 lt_t boost_start_time; 189 lt_t boost_start_time;
190
191 /* How many LITMUS^RT locks does the task currently hold/wait for? */
192 unsigned int num_locks_held;
193 /* How many PCP/SRP locks does the task currently hold/wait for? */
194 unsigned int num_local_locks_held;
150#endif 195#endif
151 196
152 /* user controlled parameters */ 197 /* user controlled parameters */
@@ -233,11 +278,6 @@ struct rt_param {
233 lt_t tot_exec_time; 278 lt_t tot_exec_time;
234}; 279};
235 280
236/* Possible RT flags */
237#define RT_F_RUNNING 0x00000000
238#define RT_F_SLEEP 0x00000001
239#define RT_F_EXIT_SEM 0x00000008
240
241#endif 281#endif
242 282
243#endif 283#endif