Markus Osterried (BA/EDD) wrote:
> Hello,
> 
> I want to use rtdm_iomap_to_user() to map our device registers to user
> space.
> But this doesn't work, our application just crashes when I read from the
> mapped registers.
> 
> When I insert the line
> 
>       vma->vm_page_prot = phys_mem_access_prot(filp,
> paddr>>PAGE_SHIFT, size, vma->vm_page_prot);
> 
> in rtdm_mmap_buffer() just before calling xnarch_remap_io_page_range()
> it works fine.

[hint: using diff -up helps the reader to quickly localise your changes.]

> This is just like it is done in /drivers/char/mem.c and in
> /drivers/video/fbmem.c.
> 
> But I think this is architecture and kernel version dependent and I
> don't know whether rtdm_mmap_buffer() is the right place.
> I use Xenomai 2.3.1 and Linux 2.6.18 with PowerPC CPU.
> What is the best solution? Everyone else seen this problem?

Providing phys_mem_access_prot() services for
xnarch_remap_io_page_range() looks like it is actually required -
practically at least for PPC, but I can't tell immediately if there
aren't other yet unnoticed side effect of skipping it.

Hmm, can we extend xnarch_remap_io_page_range()/
wrap_remap_io_page_range() to take care of this as well? Suggestions
(ie. patches) welcome!

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to