rust/kernel/io/mem.rs

Source file repositories/reference/linux-study-clean/rust/kernel/io/mem.rs

File Facts

System
Linux kernel
Corpus path
rust/kernel/io/mem.rs
Extension
.rs
Size
9658 bytes
Lines
302
Domain
Rust Kernel Layer
Bucket
Rust API Membrane
Inferred role
Rust Kernel Layer: implementation source
Status
source implementation candidate

Why This File Exists

Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.

Dependency Surface

Detected Declarations

Annotated Snippet

fn drop(&mut self) {
        // SAFETY: Safe as by the invariant of `Io`.
        unsafe { bindings::iounmap(self.io.addr() as *mut c_void) }
    }
}

impl<const SIZE: usize> Deref for IoMem<'_, SIZE> {
    type Target = Mmio<SIZE>;

    fn deref(&self) -> &Self::Target {
        // SAFETY: Safe as by the invariant of `IoMem`.
        unsafe { Mmio::from_raw(&self.io) }
    }
}

Annotation

Implementation Notes