/*禁用所有中断和异常*/
.macro arch_local_irq_enable
.set push
.set reorder
.set noat
mfc0 $1,$12
ori $1,0x1f
xori $1,0x1e
mtc0 $1,$12
irq_enable_hazard
.set pop
.endm
/*使能中断和异常都关闭*/
.macro arch_local_irq_disable
.set push
.set noat
mfc0 $1,$12
ori $1,0x1f
xori $1,0x1f
.set noreorder
mtc0 $1,$12
irq_disable_hazard
.set pop
.endm
/*禁用所有中断和异常,并把禁用前的状态保存到result变量*/
.macro arch_local_irq_save result
.set push
.set reorder
.set noat
mfc0 \result, $12
ori $1, \result, 0x1f
xori $1, 0x1f
.set noreorder
mtc0 $1, $12
irq_disable_hazard
.set pop
.endm
/*恢复中断位?*/
.macro arch_local_irq_restore flags
.set push
.set noreorder
.set noat
mfc0 $1, $12
andi \flags, 1
ori $1, 0x1f
xori $1, 0x1f
or \flags, $1
mtc0 \flags, $12
irq_disable_hazard
.set pop
.endm
local_irq_disable() -- 最后调用arch_local_irq_disable禁止中断。
raw_spin_lock_irqsave -- 自旋锁并禁止中断,龙芯1b中最后调用arch_local_irq_save,只禁止中断。
阅读(2334) | 评论(0) | 转发(0) |