Skip to contentSkip to conversation

Bogus conversion to ns in rt_task_make_periodic() emulation

PATCH Applied Andrew Dennison 2 participants 2 messages Feb 22, 2007 – Feb 23, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bogus conversion to ns in rt_task_make_periodic() emulation

The RTAI function rt_task_make_periodic() takes absolute ticks as the start_time argument, however this was being compared to ns in the RTAI emulation layer.

This patch fixes this, and also removes '+ period' as this seems wrong with the way xnpod_set_thread_periodic() works.

Patch is against r1717 so it won't apply directly to head, but the same logical bug seems to exist there?

ksrc/skins/rtai/task.c +1 -1
index 1f4cd2c..3426aed 100644
@@ -272,7 +272,7 @@ int rt_task_make_periodic(RT_TASK *task, RTIME start_time, RTIME period)
 		goto unlock_and_exit;
 	}
 
-	if (start_time + period <= xnpod_ticks2ns(xnpod_get_time()))
+	if (start_time <= xnpod_get_time())
 		start_time = XN_INFINITE;
 
 	err = xnpod_set_thread_periodic(&task->thread_base, start_time, period);
#1 lore raw
Quoted 7 lines · Andrew Dennison

The RTAI function rt_task_make_periodic() takes absolute ticks as the start_time argument, however this was being compared to ns in the RTAI emulation layer.

This patch fixes this, and also removes '+ period' as this seems wrong with the way xnpod_set_thread_periodic() works.

Applied, thanks.

Quoted 2 lines

Patch is against r1717 so it won't apply directly to head, but the same logical bug seems to exist there?

Indeed. Fixed in the trunk/ too, thanks.

Signature · 1 line
Philippe.