Writing Device Drivers for Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

Associating Kernel Memory With User Mappings

Some device drivers might need to allocate kernel memory that is made accessible to user programs through mmap(2). One example is setting up shared memory for communication between two applications. Another example is sharing memory between a driver and an application.

When exporting kernel memory to user applications, follow these steps:

  1. Use ddi_umem_alloc(9F) to allocate kernel memory.

  2. Use devmap_umem_setup(9F) to export the memory.

  3. Use ddi_umem_free(9F) to free the memory when the memory is no longer needed.