The general steps for performing device context management are as follows:
Define a devmap_callback_ctl(9S) structure.
Allocate space to save device context if necessary.
Set up user mappings to the device and driver notifications with devmap_devmem_setup(9F).
Manage user access to the device with devmap_load(9F) and devmap_unload(9F).
Free the device context structure, if needed.