tms570

Temporarily disable interrupts on ARM

梦想与她 提交于 2019-12-21 12:46:24
问题 I am starting working with the ARM platform (specifically the TI TMS570 family). I have some code with critical regions where I don't want an exception to occur. So I want to save the IRQ and FIR enabled flags on entering the regions and restore them on exiting. How do I do that? 回答1: To temporarily mask IRQs and FIQs at the CPU, the nicest option for ARMv7 is to use cps: // assembly code assuming interrupts unmasked on entry cpsid if // mask IRQ and FIQ ... // do critical stuff cpsie if //

Temporarily disable interrupts on ARM

落爺英雄遲暮 提交于 2019-12-04 05:49:28
I am starting working with the ARM platform (specifically the TI TMS570 family). I have some code with critical regions where I don't want an exception to occur. So I want to save the IRQ and FIR enabled flags on entering the regions and restore them on exiting. How do I do that? To temporarily mask IRQs and FIQs at the CPU, the nicest option for ARMv7 is to use cps : // assembly code assuming interrupts unmasked on entry cpsid if // mask IRQ and FIQ ... // do critical stuff cpsie if // unmask Some compilers provide a set of __disable_irq() etc. intrinsics usable from C code, but for others