devmap_unload() and devmap_load()
are used to control the validation of the memory mapping described by dhp in the specified range. devmap_unload()
invalidates the mapping translations and will generate calls to the devmap_access(9E)
entry point next time the mapping is accessed. The drivers use devmap_load() to validate the mapping translations during memory
access.
A typical use of devmap_unload() and devmap_load() is in the driver's context management callback function, devmap_contextmgt(9E). To manage a device context, a device driver calls devmap_unload() on the context about to be switched out. It switches
contexts, and then calls devmap_load() on the context
switched in. devmap_unload() can be used to unload
the mappings of other processes as well as the mappings of the calling process,
but devmap_load() can only be used to load the mappings
of the calling process. Attempting to load another process's mappings with devmap_load() will result in a system panic.
For both routines, the range to be affected is defined by the off and len arguments. Requests
affect the entire page containing the off and
all pages up to and including the page containing the last byte as indicated
by off + len. The arguments type and rw are provided by the system
to the calling function (for example, devmap_contextmgt(9E)) and should not be modified.
Supplying a value of 0 for the len argument affects all addresses from the off to the end of the mapping. Supplying a value of 0 for the off argument and a value
of 0 for len argument affect
all addresses in the mapping.
A non-zero return value from either devmap_unload()
or devmap_load() will cause the corresponding operation
to fail. The failure may result in a SIGSEGV or SIGBUS signal
being delivered to the process.
|