Mike Gorchak
|
Correct handling of the IO_MMAP message in the resource manager
|
Mike Gorchak
01/23/2009 2:37 AM
post20672
|
Correct handling of the IO_MMAP message in the resource manager
io_mmap and io_mmap_default documentation really tells nothing about how to handle these messages by self in the
resource manager to let the user application to mmap some resource manager's address space.
My resource manager handles hardware device, which provides a lot of PCI memory. User application needs to read and to
write directly to the mmap'ed PCI device memory because data transfer amount is really huge, and using devctl's data
passing via messages is not a good solution for the one or two megabytes of data, it is real performance issue and
causes high CPU load.
I want to use an "offset" and "len" arguments of the mmap() function and corresponding to them _io_mmap structure's
field "offset" to control which device memory region user application wants to mmap in its address space. But _io_mmap
structure doesn't contain len field and it is not clear how resource manager knows how many bytes will be mmaped.
Also a bit obscured _io_mmap_reply structure, which contains only one not "Reserved for future use" member named "coid".
It is not clear how I can return connection ID to the already mmaped memory region :-/
I'm not sure now, that this common for the generic OSes, trick is supported under QNX.
I'm in total confusion. Any suggestions will be appreciated.
P.S. I can see only one solution right now: to pass physical addresses between user application and resource manager,
and both will mmap the same region with different rights.
|
|
|