pub trait DriverOps {
type RegType: Default;
unsafe fn register(
reg: *mut Self::RegType,
name: &'static CStr,
module: &'static ThisModule
) -> Result;
unsafe fn unregister(reg: *mut Self::RegType);
}
Expand description
A subsystem (e.g., PCI, Platform, Amba, etc.) that allows drivers to be written for it.
Required Associated Types
Required Methods
sourceunsafe fn register(
reg: *mut Self::RegType,
name: &'static CStr,
module: &'static ThisModule
) -> Result
unsafe fn register(
reg: *mut Self::RegType,
name: &'static CStr,
module: &'static ThisModule
) -> Result
Registers a driver.
Safety
reg
must point to valid, initialised, and writable memory. It may be modified by this
function to hold registration state.
On success, reg
must remain pinned and valid until the matching call to
DriverOps::unregister
.
sourceunsafe fn unregister(reg: *mut Self::RegType)
unsafe fn unregister(reg: *mut Self::RegType)
Unregisters a driver previously registered with DriverOps::register
.
Safety
reg
must point to valid writable memory, initialised by a previous successful call to
DriverOps::register
.