RTEMS MAP_SHARED support expansion

Gedare Bloom gedare at rtems.org
Wed May 17 00:40:58 UTC 2017


On Tue, May 16, 2017 at 3:28 PM, Kirspel, Kevin <Kevin-Kirspel at idexx.com> wrote:
> I would like to expand support for MAP_SHARED in mmap().  I would like to
> run a few ideas by the group to see which direction to go.  I really only
> need to expand MAP_SHARED support for some LIBBSD drivers that I want to
> create.  There are two approaches I can take.
>
>
>
> The first approach is to just add a mmap handler function in “struct
> _rtems_filesystem_file_handlers_r”.  The mmap() restrictions on MAP_SHARED
> would be removed.  The mmap handler for all RTEMS file systems (except SHM)
> would get the default mmap handler (return EINVAL).  SHM would get a handler
> similar to the one found in mmap.c.  In RTEMS-LIBBSD, the RTEMS character
> device handler (devfs_devs.c) would be free to pass the mmap request on to
> FREEBSD drivers.
>
This would be good. I wanted to do a mmap handler in the file table
but did not get to it.

I don't quite see how this expands support for MAP_SHARED, but it
should improve the engineering :)

>
>
> The second approach includes the first approach but adds support for RTEMS
> device drivers.  We would need to add a mmap handler to
> “rtems_driver_address_table”.  The “IMFS_device_handlers” would add a mmap
> handler to device_mmap().  We would need a new rtems_deviceio_mmap()
> function to call the drivers mmap handler.  I don’t think any BSPs will be
> affected because the mmap handler of “rtems_driver_address_table” should
> initialize to NULL.  Any BSP would them be free to add a handler to process
> mmap calls.
>
This makes sense at a glance. Unfortunately, I can't put any deep
thought on this. It would be good to get one more set of eyes+brain on
it.

>
>
> Any opposition to the two approaches?  If not, which one would you prefer?
>
>
>
> Kevin Kirspel
>
> Electrical Engineer - Sr. Staff
>
> Idexx Roswell
>
> 235 Hembree Park Drive
>
> Roswell GA 30076
>
> Tel: (770)-510-4444 ext. 81642
>
> Direct: (770)-688-1642
>
> Fax: (770)-510-4445
>
>
>
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel



More information about the devel mailing list