pub(crate) unsafe fn init(io_mem_builder: IoMemAllocatorBuilder)
Expand description
Initializes the static allocator based on builder.
ยงSafety
User must ensure that:
-
All the memory that belong to the system device have been removed by calling the
remove
function. -
All the port I/O regions belonging to the system device are defined using the macros
sensitive_io_port
andreserve_io_port_range
. -
MAX_IO_PORT
defined incrate::arch::io
is guaranteed not to exceed the maximum value specified by architecture.
-
All the memory that belong to the system device have been removed by calling the
remove
function. -
All the port I/O regions should be valid by using the macros
sensitive_io_port
andreserve_io_port_range
. -
crate::arch::io::MAX_IO_PORT
should be valid by not exceeding the maximum value specified by architecture.