Skip to content

Commit 78f7968

Browse files
committed
Add LTO hint to critical-section-single-core docs
1 parent 7f99b9a commit 78f7968

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cortex-m/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
//! or critical sections are managed as part of an RTOS. In these cases, you should use
2020
//! a target-specific implementation instead, typically provided by a HAL or RTOS crate.
2121
//!
22+
//! The critical section has been optimized to block interrupts for as few cycles as possible,
23+
//! but -- due to `critical-section` implementation details -- incurs branches in a normal build
24+
//! configuration. For minimal interrupt latency, you can achieve inlining by enabling
25+
//! [linker-plugin-based LTO](https://doc.rust-lang.org/rustc/linker-plugin-lto.html).
26+
//!
2227
//! ## `cm7-r0p1`
2328
//!
2429
//! This feature enables workarounds for errata found on Cortex-M7 chips with revision r0p1. Some

0 commit comments

Comments
 (0)