Skip to main content

Module n1

Module n1 

Source
Expand description

N1 Type-Safe IPC : annotation macro and kernel-internal wiring.

The N1 (TypeSafe) isolation level guarantees that communicating components share the same address space (Ring 0) and that every module tagged #[n1_safe] contains zero unsafe blocks. This is verified by cargo-geiger in CI; the macro itself is a documentation + compile-time annotation marker.

§Usage

use crate::ipc::n1::n1_safe;

#[n1_safe]
/// This function is N1-safe: no raw pointers, no `asm!`, no FFI.
fn notify_scheduler(event: N1Event) { /* safe code only */ }

§Kernel-internal N1 channels

The following kernel component pairs use IntrusiveMailbox for zero-copy kernel-internal IPC (N1):

ProducerConsumerChannelPurpose
NIC IRQSchedulerNIC_SCHED_MAILBOXLink up/down events
SchedulerNICSCHED_NIC_MAILBOXFlow control hints

Enums§

N1Event
Events that can flow over N1 kernel-internal channels.

Statics§

NIC_SCHED_MAILBOX
Mailbox for NIC => scheduler notifications (link up/down, backpressure).
SCHED_NIC_MAILBOX
Mailbox for Scheduler => NIC flow-control hints.

Functions§

init
Initialise N1 subsystem: pre-allocate mailbox nodes for IRQ-safe push. Must be called once at kernel init (after heap is available).