Hello, Thanks for your help.
I know my Xenomai version is quite out of date. However, as I'm using the ELinOS distribution (which already has its own patches), I find it really difficult to upgrade to Xenomai 2.4.10. Anyway, I can apply changes to some files. The rtdm_iomap_to_user function is referenced in drvlib.c and rtdm_driver.h: I compare the 2.4.7 and 2.4.10 versions and they are almost identical, so I think there will be no use in patching the kernel for these 2 files. Do you know of any other file that could make any difference in my problem? If I compare versions 2.4.7 and 2.5.6 (the last one) of Xenomai, I can see the last version uses "/dev/rtheap" instead of "/dev/zero" and that there are some changes if CONFIG_MMU is not defined. My system (Intel Atom N270 CPU) is configured with MMU and therefore the only actual changes between the versions are regarding "dev/rtheap". Does it make any difference? Xenomai 2.4.7 has "/dev/rtpheap" but no "/dev/rtheap"; should I use it instead of "/dev/zero"? > > virt_to_phys(new_iomap) --> 0xf5f6f000 > > virt_to_phys is not supposed to work in that case. Since you ioremap'ed > the address, you already know the physical address anyway. > Is there any function that will tell me the real physical address in order to make sure the mapping is correct? Again, thanks for your help. Best regards, Asier > -----Original Message----- > From: Gilles Chanteperdrix [mailto:[email protected]] > Sent: Tuesday, April 26, 2011 1:15 PM > To: Asier Tamayo > Cc: Jan Kiszka; [email protected] > Subject: Re: [Xenomai-help] FW: rtdm_iomap_to_user() I-pipe error > > > Asier Tamayo wrote: > > Hello again, > > > > When one doesn't get replies to his questions, it may be either > > because: i) they are too obvious (RTFM), ii) too difficult, iii) > > there is little information and it makes the checking in > one's system > > impossible, or iv) they haven't been correctly explained. > It may also > > be that the help demander is not being polite. > > > > As i have received no answer, I will assume I haven't explained my > > problem correctly and will give myself a second chance ;) The > > following lines will just rewrite my question, since I haven't been > > able to find any new clue: > > > > I'm porting a PCI driver to a RTDM, using Xenomai version 2.4.7 and > > Linux 2.6.27, from the ELinOS 5.0 distribution. > > Before anything else, please try the latest version of the branch you > use (that would be Xenomai 2.4.10) > > > > > I want to allow a RT task to access the PCI memory directly, by > > calling the rtdm_iomap_to_user() function just after mlockall and > > rt_dev_open, and before rt_task_shadow. The function returns me a > > correct value, but then I cannot access the PCI registers by using > > that address. The mmap seems not to be correct. The values I get: > > > > Driver: xen_mydriver->location = pci_resource_start(dev,0); --> > > 0x20000000 xen_mydriver->base_address = > > ioremap(xen_mydriver->location, xen_mydriver->mem_size); --> > > 0xe0a00000 *(unsigned short*)(my_context->base_address + 0x100) = > > 0xAAAA; --> It works > > > > RT task: rtdm_iomap_to_user(user_info,my_context->location, 300, > > PROT_READ|PROT_WRITE, &new_iomap, NULL, NULL); --> 0xb5f6f000 > > virt_to_phys(new_iomap) --> 0xf5f6f000 *(unsigned > short*)(new_iomap + > > virt_to_phys is not supposed to work in that case. Since you > ioremap'ed > the address, you already know the physical address anyway. > > -- > > Gilles. > _______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
