unmap_dev

Function unmap_dev 

Source
pub fn unmap_dev(dev: DeviceHandle) -> Status
Expand description

Unùap a previously mapped device

§Usage

Unmap a device that has been previously mapped by the caller, once no more required. The device device is identified by its handle (see get_device_handle).

The memory mapping system is responsible for verifying that the device is already mapped in the caller’s memory layout. There is neither capability nor ownership check as these checks are made at map time. Unmapping is synchronous.

An unmapped device can always be remapped later (see map_dev).

This syscall returns Status::Ok if the device is successfully unmapped by the kernel.

If the device is not already mapped by the caller, the syscall returns Status::Invalid.

§Example

match unmap_dev(devh) {
   Status::Ok => (),
   any_err => return(any_err),
}