Sergio Biasi wrote:
>
> Hi RTusers,
> I'm writing my thesis project using RT 1.1 with 2.0.36 linux kernel. All
> goes well and fine, but... I have a question. I've tried to use RTfifo
> between kernel modules and it doesn't work. The rtf_put() in the first
> module puts, but the handler in the other module doesn't handle. Before
> attempting a new solution (I use shared memory too) I would know if I'm
> missing something.
> Thanks a lot
> Sergio
>
Sergio is correct.
The rtf_put command will put data into the fifo from the RT side of
things.
Then it will call
if (clear_bit(1, &RTF_SLEEPS(minor))) {
queue_task_rt(&RTF_WAKE_UP_TASK(minor), &tq_rt);
}
this will trigger the RTF_WAKE_UP_TASK on the tq_rt wait queue.
So only things put on that queue can be woken up.
the rtf_read is the user level task that reads data.
If a blocking read is asked for it does this.
while (RTF_EMPTY(minor) /* || RTF_LOCK(minor) */ ) {
if (current->signal & ~current->blocked)
return -ERESTARTSYS;
set_bit(1, &RTF_SLEEPS(minor));
interruptible_sleep_on(&RTF_WAIT(minor));
}
THis will allow the task to handle signals but also put the task to
sleep until called by the rtf_put call above...
Net result
The RT Handler is NOT called after a fifo put from the RT Task
The user task is called....
If you want to use such a mechanism to get rt tasks to talk to each
other look at semaphores/rt_ipc.c and the message queue options.
If you are feeling brave add this code to the end of the rtf_put
ie instead of
...
}
return count;
}
...
add in here
...
}
if (RTF_HANDLER(minor)) {
if ((result = (*RTF_HANDLER(minor)) (minor)) < 0) {
return result;
}
return count;
}
...
But back every thing up first and stand by with the fire hose.
Thanks for making me clarify this.
( Read the Source Luke... ;->> )
All the best
Phil Wilshire
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/