The mmap(2) system call has an 'offset' parameter which appears to be
passed into the driver's segmap() entry point and hence to its devmap()
entry point. Does the system itself interpret this value or use it in
any way when the request is directed to a driver, or is it left to the
driver to interpret as it pleases? The documentation for mmap(2) says
this parameter must be a multiple of page size.
I'm wondering if this parameter can effectively be used as a command to
the driver to indicate which resource should be mapped. Consider a
driver which wants to map out different parts of its memory for
different purposes, or which controls multiple register sets which it
wants to map out individually. Can a driver define a contract such as:
- 'offset = 0' requests a shared memory block
- 'offset = pagesize' requests the 'frooble' registers
- 'offset = pagesize * 2' requests the 'wibble' registers
and so on?
Suppose in this example the 'frooble' register set were bigger than
pagesize. If it's purely up to the driver to interpret this parameter
that should cause no problem; but if the system interprets it I could
imagine confusion about its overlapping 'wibble'.
Confirmation/correction/clarification would be very welcome.
Many Thanks,
jjf
_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss