Skip to main content

Module cpu

Module cpu 

Source
Expand description

CPU abstraction layer

Provides safe abstractions for CPU-related operations including:

  • CPU identification and topology
  • Per-CPU data access
  • CPU control (halt, interrupt control)

Inspired by Asterinas OSTD CPU module.

Structs§

CpuId
CPU identifier
CpuIter
Iterator over all CPUs

Functions§

disable_irqs
Disable interrupts on the current CPU
enable_irqs
Enable interrupts on the current CPU
halt_cpu
CPU halt function
irqs_enabled
Check if interrupts are enabled on the current CPU
restore_irqs
Restore interrupt flags
save_and_disable_irqs
Save interrupt flags and disable interrupts
without_interrupts
Execute a closure with interrupts disabled