Function init

Source
pub(crate) unsafe fn init(io_mem_builder: IoMemAllocatorBuilder)
Expand description

Initializes the static allocator based on builder.

ยงSafety

User must ensure that:

  1. All the memory that belong to the system device have been removed by calling the remove function.

  2. All the port I/O regions belonging to the system device are defined using the macros sensitive_io_port and reserve_io_port_range.

  3. MAX_IO_PORT defined in crate::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 and reserve_io_port_range.

  • crate::arch::io::MAX_IO_PORT should be valid by not exceeding the maximum value specified by architecture.