Tue, 11 Jul 2000 Flavio Cappelli wrote:
> Hello all, I use rtlinux v2.2
>
> I don't understand if, when I get data from a rt-fifo (rtlinux side) with
> 'rtf_get' and less bytes are available than requested, these bytes are
> removed from the fifo or if they are removed only when ther'are
> enough datas in the fifo.
*looking at the code*
Well, it looks like you may get less data than requested, and the data you get
*is* removed from the buffer.
> I ask this question because in the example 'frack_module.c' seems that
> commands are processed when entire command structure is got, without
> consider a loos of data when few bytes are available.
It works because
1) the FIFO is expected to never be too full to accept an entire structure, and
2) as long as a full structure fits, you're OK, since the write operation won't
sleep, and is therefore atomic, protected by rtl_(/end_)critical.
> But man page of 'rtf_get' reports that less byte than requested may
> be returned. Is this related with returning -EINVAL value from fifo
> handler ?
How do you mean? You get less bytes than requested if there are less bytes than
requested in the buffer at the time of the rtf_get() call, since rtf_get()
cannot sleep. (It wouldn't work with ISRs if it could.)
> Also can a single write on rt-fifo (user side) interrupted in the middle of
> data transfer by fifo handler, if ther'is enough space to put the datas ?
If the RT-FIFO driver conforms to the normal rules (which it does, AFAIK), the
writer should block until all data has been written, or an error occurs. (Never
mind the ERESTARTSYS thing - that's a little UN*X design weirdness related to
scheduling and signals, and it's handled by the library that interfaces to the
kernel.)
So, yes, the writer will get interrupted by the handler, so that the handler
can read some data, allowing the writer to wake up and continue writing later.
David Olofson
Programmer
Reologica Instruments AB
[EMAIL PROTECTED]
..- M u C o S --------------------------------. .- David Olofson ------.
| A Free/Open Multimedia | | Audio Hacker |
| Plugin and Integration Standard | | Linux Advocate |
`------------> http://www.linuxdj.com/mucos -' | Open Source Advocate |
..- A u d i a l i t y ------------------------. | Singer |
| Rock Solid Low Latency Signal Processing | | Songwriter |
`---> http://www.angelfire.com/or/audiality -' `-> [EMAIL PROTECTED] -'
-- [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/