Skip to content

hal::types

Core type definitions shared across the kernel, HAL, and API layers.

These types are architecture-agnostic vocabulary for MPU management and the task model. Saved register frames live in architecture crates.

struct RegionDescriptor {
pub base: u32,
pub size: u32,
pub permissions: RegionPermissions,
}

Describes one MPU region for use by MpuManager.

References: RegionPermissions

struct RegionPermissions {
pub read: bool,
pub write: bool,
pub execute: bool,
pub user_mode: bool,
}

Read/write/execute permissions for an MPU region, including a user-mode flag to distinguish kernel vs. user-space regions.

struct TaskId(u32);

Opaque task identifier assigned by the scheduler at spawn time.

Implements: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enum Priority {
Critical(u8),
Normal(u8),
Background(u8),
}

Task priority band and level within that band.

Numeric ordering (lower = higher priority): Critical(0) > Critical(1) > … > Normal(0) > … > Background(15)

The numeric() method encodes both the band and the level into a single u8 for the scheduler’s ready mask.

Implements: Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, StructuralPartialEq