Stelian Pop wrote: > [Sorry for the delay, I was quite busy those days and unable to test the > patch...] > > Le mardi 19 septembre 2006 à 17:34 +0200, Jan Kiszka a écrit : >>> Or maybe we should lower the API level a little bit, and let the user >>> specify the physical address of the mapping instead of the virtual >>> one.... >> How would this help? You still need the virtual address for VMA blocks >> in order to collect the pages. > > Actualy we need both the virtual address (for vmalloc case) and the > physical address (for ioremap case). > >> + if (mmap_data->mem_type == RTDM_MEMTYPE_VMALLOC) { > [...] > > This still won't work because for RTDM_MEMTYPE_IOREMAP > virt_to_phys((void *)vaddr) doesn't return the physical address. > > So we still need to either: > a) walk the vmlist struct to find out the needed vm->phys_addr (which > will probably won't work in 2.4, or even in earlier 2.6 kernels)
Sounds fragile, indeed. > > b) pass both the physical and the virtual adresses in the > rtdm_mmap_to_user prototype (the physical address would be used only > when RTDM_MEMTYPE_IOREMAP is specified) Hmm, a bit ugly, this long argument list. > > c) make 'src_addr' be a virtual address in some cases, and a physical > address in ioremap case. That's so far the cleanest solution in my eyes. > > d) make a special rtdm_mmap_iomem_to_user() function... Also an option. Specifically, it wouldn't break the existing API... What about rtdm_iomap_to_user? Would you like to work out a patch in this direction? Jan
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core