arm的三种中断状态

ARM 104浏览

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.