arm的三种中断状态

来源:互联网 发布:巴雷特m82a1数据 编辑:程序博客网 时间:2024/05/11 15:37

Method #1: Disable/Enable interrupts using simple instructions. After critical section, interrupts will be enabled even if they were disabled before entering the critical section.

Method #2: Disable/Enable interrupts by preserving the state of interrupts. In other words, if interrupts were disabled before entering the critical section, they will be disabled when leaving the critical section.

Method #3: Disable/Enable interrupts by preserving the state of interrupts. Generally speaking you would store the state of the interrupt disable flag in the local variable 'cpu_sr' and then disable interrupts. 'cpu_sr' is allocated in all of uC/OS-II's functions that need to disable interrupts. You would restore the interrupt disable state by copying back 'cpu_sr' into the CPU's status register.

原创粉丝点击