local_irq_disable的功能是屏蔽当前CPU上的所有中断,通过操作arm核心中的寄存器来屏蔽到达CPU上的中断,此时中断控制器中所有送往该CPU上的中断信号都将被忽略。
#define local_irq_disable() \ ?? ?do { raw_local_irq_disable(); trace_hardirqs_off(); } while (0)
/* ?* Disable IRQs ?*/ #define raw_local_irq_disable()?? ??? ??? ??? ??? ?\ ?? ?({?? ??? ??? ??? ??? ??? ??? ?\ ?? ??? ?unsigned long temp;?? ??? ??? ??? ?\ ?? ?__asm__ __volatile__(?? ??? ??? ??? ??? ?\ ?? ?"mrs?? ?%0, cpsr?? ??? ?@ local_irq_disable\n"?? ?\ "?? ?orr?? ?%0, %0, #128\n"?? ??? ??? ??? ??? ?\ "?? ?msr?? ?cpsr_c, %0"?? ??? ??? ??? ??? ?\ ?? ?: "=r" (temp)?? ??? ??? ??? ??? ??? ?\ ?? ?:?? ??? ??? ??? ??? ??? ??? ?\ ?? ?: "memory", "cc");?? ??? ??? ??? ??? ?\ ?? ?})
early_boot_irqs_off主要是设置对应的early_boot_irqs_enabled = 0;全局变量表示其中断关闭。
|