Hi,

I finally seem to have a complete solution for my case. It's probably
still missing one or the other detail, but it starts to work. I only
added a few lines to ksrc/skins/rtdm/drvlib.c in rtdm_do_mmap:

1. Because linux/mm/nommu.c/validate_mmap_request() checks the
capabilities of the backing dev, and /dev/zero lacks BDI_CAP_MAP_DIRECT
capability, the /dev/mem has to be used instead of /dev/zero.

> filp = filp_open("/dev/mem", O_RDWR, 0);

2. A get_unmapped_area() f_op has to be provided on nommu systems. It is
also checked by validate_mmap_request(). I just copy in the pointer from
old_fops: the /dev/mem f_op->get_unmapped_area simply passes pgoffs.

> rtdm_mmap_fops.get_unmapped_area = old_fops->get_unmapped_area;

3. Since /dev/mem is used, the offset passed to do_mmap() has to
point to the actual buffer (probably the physical address, for now I
just used mmap_data->src_vaddr).

> user_ptr = (void *)do_mmap(filp, (unsigned long)*pptr, len, prot,
>            MAP_SHARED, mmap_data->src_vaddr);

Kolja


_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to