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.

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.

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@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to