aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-12-16 05:36:46 -0500
committerBjoern Brandenburg <bbb@mpi-sws.org>2015-12-16 05:36:46 -0500
commitb8438dac7a15cc2a584663f8e6d30ed85c2eb588 (patch)
tree74cff9adc590a402c8e6e88b9ca4db5592f670aa
parent3ebb8ceb0fb62011c107396a6161595a064da95e (diff)
Export job release time and job sequence number in ctrl page
-rw-r--r--include/litmus/rt_param.h7
-rw-r--r--litmus/jobs.c10
2 files changed, 13 insertions, 4 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index ebbc93632c94..db133ac0e237 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -121,8 +121,11 @@ struct control_page {
121 uint64_t irq_syscall_start; /* Snapshot of irq_count when the syscall 121 uint64_t irq_syscall_start; /* Snapshot of irq_count when the syscall
122 * started. */ 122 * started. */
123 123
124 /* to be extended */
125 lt_t deadline; /* Deadline for the currently executing job */ 124 lt_t deadline; /* Deadline for the currently executing job */
125 lt_t release; /* Release time of current job */
126 uint64_t job_index; /* Job sequence number of current job */
127
128 /* to be extended */
126}; 129};
127 130
128/* Expected offsets within the control page. */ 131/* Expected offsets within the control page. */
@@ -132,6 +135,8 @@ struct control_page {
132#define LITMUS_CP_OFFSET_TS_SC_START 16 135#define LITMUS_CP_OFFSET_TS_SC_START 16
133#define LITMUS_CP_OFFSET_IRQ_SC_START 24 136#define LITMUS_CP_OFFSET_IRQ_SC_START 24
134#define LITMUS_CP_OFFSET_DEADLINE 32 137#define LITMUS_CP_OFFSET_DEADLINE 32
138#define LITMUS_CP_OFFSET_RELEASE 40
139#define LITMUS_CP_OFFSET_JOB_INDEX 48
135 140
136/* don't export internal data structures to user space (liblitmus) */ 141/* don't export internal data structures to user space (liblitmus) */
137#ifdef __KERNEL__ 142#ifdef __KERNEL__
diff --git a/litmus/jobs.c b/litmus/jobs.c
index 3f1cb0e2327e..3a6a14f9121c 100644
--- a/litmus/jobs.c
+++ b/litmus/jobs.c
@@ -18,9 +18,13 @@ static inline void setup_release(struct task_struct *t, lt_t release)
18 /* update job sequence number */ 18 /* update job sequence number */
19 t->rt_param.job_params.job_no++; 19 t->rt_param.job_params.job_no++;
20 20
21 /* add the deadline to */ 21 /* expose to user space */
22 if(has_control_page(t)) 22 if (has_control_page(t)) {
23 get_control_page(t)->deadline = t->rt_param.job_params.deadline; 23 struct control_page* cp = get_control_page(t);
24 cp->deadline = t->rt_param.job_params.deadline;
25 cp->release = get_release(t);
26 cp->job_index = t->rt_param.job_params.job_no;
27 }
24} 28}
25 29
26void prepare_for_next_period(struct task_struct *t) 30void prepare_for_next_period(struct task_struct *t)