"Uwe H. Speck" wrote:
> 
> Hello everyone,
> 
> I've got a 2 questions concerning the safety when sending large buffers
> with rtf_put.
> 
> Concrete Code sample:
> 
> global variable:
> 
> unsigned char g_ucFifoSendBuffer[4000];
> 
> iRetVal = rtf_put(HANDLER_RCV_FIFO_NO, g_ucFifoSendBuffer, 4000);
> 
> This theme was already touched in this list (in October 1999, subject
> "[rtl] structs in rtf_put?"). But the opinions differed a bit.
> 
> Some of the responders said, it's necessary to send a struct ** "byte by byte" **
> while another one ([EMAIL PROTECTED]) said, that there is no problem to
> send it in ** one step **:
> 
> As I tested, the code sample above seems to work always!
> 
> But there may be a complication (hard to explain :-(    ):
> 
> Imagine the struct would be located on SEVERAL virtual memory pages
> (as David Schleef wrote, global variables are located with vmalloc) ?
> That would mean, that the struct uses several address ranges
> of physical memory.
> 
> 1. Question Can a global variable be located on different, * physical *
>     address ranges?)
> 
> If that would be possible, I suppose that the rtf_put statement would
> send trash data, because it ** steps from one one PHYSICAL address **
> to the next and sends whatever there is on that address.
> 
> 2. Question:
> 
> Does the rtf_put stament step from one ** physical ** address to the next when 
>sending?
> 

Hi Uwe,

Within the kernel, RT and user space all the addresses use are referred
to by their virtual address so from the point of view of moving this
buffer, the fact that the physical address is not contiguous does not
matter (transparently handled by the MMU).  The only time I can think of
where physically contiguous memory matters is for DMA memory, this is
because the DMA devices are unaware of MMU mapping (they are outside the 
processor) and so make their transfers to physically addressed memory
areas.

Note, the kernel & RT share the same virtual address mapping, each user
space process has its own.

Regards, Stuart.
-- [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/

Reply via email to