Skip to contentSkip to conversation

rt_io_get_region

Xenomai-help Roger Carns 2 participants 4 messages Oct 11, 2010 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Does rt_io_get_region function be called from user space and does it
return a user space address and if so how is it return? Also is there doc out there someplace on usage of this function.

Signature · 7 lines
*Roger Carns*

TSS Engineering
321-722-0082 x222 (w)

[email protected]
_www.tssleft.com <http://www.tssleft.com/>_ _We Move Projects Left. You Feel Better.
#1 lore raw
Quoted 3 lines · Roger Carns

Does rt_io_get_region function be called from user space and does it
return a user space address and if so how is it return? Also is there doc out there someplace on usage of this function.

rt_io_get_region is a user-space mapping of request_mem_regio/request_io_region. As such, yes, it may be called from user-space. And no, it does not return address. What it returns is a cookie that may be passed to rt_io_put_region to free the used memory.

In order to map an MMIO region in user-space you should use /dev/mem or use ioperm and inl/outl directly if you want to access an I/O port. What rt_io_get_region does is to allow you to this cleanly with regard to the rest of the system.

Signature · 1 line
                                                                Gilles.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 12 lines · Roger Carns
Quoted 10 lines · Gilles Chanteperdrix
Quoted 3 lines · Roger Carns

Does rt_io_get_region function be called from user space and does it return a user space address and if so how is it return? Also is there doc out there someplace on usage of this function.

rt_io_get_region is a user-space mapping of request_mem_regio/request_io_region. As such, yes, it may be called from user-space. And no, it does not return address. What it returns is a cookie that may be passed to rt_io_put_region to free the used memory.

Quoted 8 lines
Quoted 5 lines

In order to map an MMIO region in user-space you should use /dev/mem or use ioperm and inl/outl directly if you want to access an I/O port. What rt_io_get_region does is to allow you to this cleanly with regard to the rest of the system.

So, I open the /dev/mem and use the fd returned on the mmap call. But how do I associate the region defined in the rt_io_get_region with that fd?

The offset passed to mmap is the physical address which you want to map.

Please do not forget to CC the maling list.

Signature · 1 line
                                                                Gilles.
#4 lore raw
Quoted 25 lines · Gilles Chanteperdrix
Quoted 11 lines · Roger Carns
Quoted 10 lines · Gilles Chanteperdrix
Quoted 3 lines · Roger Carns

Does rt_io_get_region function be called from user space and does it return a user space address and if so how is it return? Also is there doc out there someplace on usage of this function.

rt_io_get_region is a user-space mapping of request_mem_regio/request_io_region. As such, yes, it may be called from user-space. And no, it does not return address. What it returns is a cookie that may be passed to rt_io_put_region to free the used memory.

Quoted 8 lines
Quoted 5 lines

In order to map an MMIO region in user-space you should use /dev/mem or use ioperm and inl/outl directly if you want to access an I/O port. What rt_io_get_region does is to allow you to this cleanly with regard to the rest of the system.

So, I open the /dev/mem and use the fd returned on the mmap call. But how do I associate the region defined in the rt_io_get_region with that fd?

The offset passed to mmap is the physical address which you want to map.

Please do not forget to CC the maling list.

great that was what I was going try first...thanks for your help

Signature · 7 lines
*Roger Carns*

TSS Engineering
321-722-0082 x222 (w)

[email protected]
_www.tssleft.com <http://www.tssleft.com/>_ _We Move Projects Left. You Feel Better.