14 lines
368 B
Rust
14 lines
368 B
Rust
// Copyright (c) 2025 shibedrill
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
/// Critical section: Mark a section of code as critical.
|
|
/// Interrupts will be disabled until the section completes.
|
|
#[macro_export]
|
|
macro_rules! critical_section {
|
|
($b:block) => {
|
|
$crate::arch::asm::interrupt_disable();
|
|
$b
|
|
$crate::arch::asm::interrupt_enable();
|
|
};
|
|
}
|