Skip to contentSkip to conversation

rt_task_set_periodic() question

Xenomai-help Thomas Häberle 2 participants 2 messages Jul 9, 2008

lore
Share & tools
lore
#0 lore raw

Hello!

I am using Xenomai 2.3.5 with a Linux Kernel 2.4 on an MPC5200.

One of my periodic Xenomai tasks has to be rescheduled now and than for
some -for the question unimportant- reasons.
To do so I
1.) get the next planed release point with "rt_task_inquire(NULL, &tt_info)"
2.) add the desired delay to the sheduling point with "t_start = RTIME(tt_info.relpoint + delay)"
(delay is always a positive value)
3.) call "rt_task_set_periodict_task_set_periodic( NULL, t_start, ONE_MS)" to reshedule the task

From step 3 I get the return value "-110" which is "ETIMEDOUT" (AFAIK)
thus according to the Xenomai-documentation the calculated new sheduling point allready passed. I miss the point where I do something wrong!?!?
It doesn't seem to matter how much I increase "t_start", the return value stays at -110, so I guess I missunderstood the usage of one of the functions!?!?

Any hints or suggestions?

Thanks & Greetings,
Thomas

#1 lore raw
Quoted 11 lines · Thomas Häberle

Hello!

I am using Xenomai 2.3.5 with a Linux Kernel 2.4 on an MPC5200.

One of my periodic Xenomai tasks has to be rescheduled now and than for
some -for the question unimportant- reasons.
To do so I
1.) get the next planed release point with "rt_task_inquire(NULL, &tt_info)"
2.) add the desired delay to the sheduling point with "t_start = RTIME(tt_info.relpoint + delay)"
(delay is always a positive value)
3.) call "rt_task_set_periodict_task_set_periodic( NULL, t_start, ONE_MS)" to reshedule the task

Could you try the attached patch ?

Signature · 1 line
                                                 Gilles.
skins/native/task.c +2 -1
Index: ksrc/skins/native/task.c
===================================================================
@@ -1120,7 +1120,8 @@ int rt_task_inquire(RT_TASK *task, RT_TA
 	info->bprio = xnthread_base_priority(&task->thread_base);
 	info->cprio = xnthread_current_priority(&task->thread_base);
 	info->status = xnthread_state_flags(&task->thread_base);
-	info->relpoint = xntimer_get_date(&task->thread_base.ptimer);
+	info->relpoint = xntimer_get_date(&task->thread_base.ptimer)
+		+ nkpod->wallclock_offset;
 
       unlock_and_exit: