frame-alloc 0.1.0

A no_std, dependency-free, const-constructible physical frame allocator for kernels
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// Strategy for mapping the *calling CPU* to a slot index.
///
/// Implement this trait to tell the allocator on which CPU he
/// is on (the returned value is viewed a *hint*).
pub trait CpuId {
    /// A stable per-CPU index for the calling CPU.
    fn current_cpu() -> usize;
}

/// Default implementation: routes everything to index 0.
pub struct NoCpuId;

impl CpuId for NoCpuId {
    fn current_cpu() -> usize {
        0
    }
}