Skip to content

Commit

Permalink
fixup! threads: support for riscv (esp32c3 only)
Browse files Browse the repository at this point in the history
add safety doc comment for `riscv::sched`
  • Loading branch information
elenaf9 committed Mar 15, 2024
1 parent 26de4d5 commit c948701
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/riot-rs-threads/src/arch/riscv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ fn FROM_CPU_INTR3(trap_frame: &mut TrapFrame) {
}
}

/// Probes the runqueue for the next thread and switches context if needed.
///
/// # Safety
///
/// This method might switch the current register state that is saved in the
/// `trap_frame`.
/// It should only be called from inside the trap handler that is responsible for
/// context switching.
unsafe fn sched(trap_frame: &mut TrapFrame) {
unsafe {
let cs = CriticalSection::new();
Expand Down

0 comments on commit c948701

Please sign in to comment.