First of all, we have to know how the critical part are organized.

the dependency:
goes into it→
the usage is like:
there is a trait to define the work:
and what we need to do to adapt to our boards is implementing by using this macro :

maybe we need to know this important macro

it’s very easy to understand, just detach the bound with the same _critical_section_1_0_acquire function. And offer a more tight interface to use.
and it’s easy to find that cortex-m has already given such a implementation:
—in
and we can dig deeper to see what interrupt::disable() do:
—in
file src/interrupt.rs : 35
it use call_asm to do:
notion image
we should know the meaning of cpsid i and the followed options
you should aware that this type of critical section mask all the interrupt including systick, maybe we can change it to use basepri register in the later, but just keep it now. It’s already enough in most of time.
 

And you may wonder what the return type—RawRetoreState is

and the critical-section wrap it with a opaque “restore state”
 
Loading...
liamY
liamY
Chasing Possible
最新发布
Enter AMX (Advanced Matrix Extensions)
2025-3-26
ktransformers相关内容学习
2025-2-16
sglang_benchmark
2025-2-7
SnapKV: LLM Knows What You are Looking for Before Generation
2024-12-12
数字电路复习
2024-12-11
CacheBlend: Fast Large Language Model Serving with Cached Knowledge Fusion论文学习
2024-11-23
公告
🎉Liam’s blog🎉
-- 全新上线 ---
👏欢迎comment👏
⚠️由于浏览器缓存的原因,有些内容是更新了的但是需要手动刷新3次左右,页面才会显示更新内容