公司的一个项目采用MIPS的CPU
发现调用intLock()无效,各中断照样产生
用IDA反汇编出来的代码如下:
.text:80050524 # =============== S U B R O U T I N E =======================================
.text:80050524
.text:80050524
.text:80050524 .globl intUnlock
.text:80050524 intUnlock: # CODE XREF: incaAscDevInit+A0p
.text:80050524 # incaAscOptsSet+390p ...
.text:80050524 mtc0 $a0, SR # Status register
.text:80050528 jr $ra
.text:8005052C nop
.text:8005052C # End of function intUnlock
.text:8005052C
.text:80050530
.text:80050530 # =============== S U B R O U T I N E =======================================
.text:80050530
.text:80050530
.text:80050530 .globl intLock
.text:80050530 intLock: # CODE XREF: incaAscDevInit+20p
.text:80050530 # incaAscOptsSet:loc_80010E14p ...
.text:80050530 mfc0 $v0, SR # Status register
.text:80050534 nop
.text:80050538 sll $0, 1
.text:8005053C sll $0, 1
.text:80050540 li $t1, 0xFFFFFFFE
.text:80050544 and $t1, $v0
.text:80050548 mtc0 $t1, SR # Status register
.text:8005054C sll $0, 1
.text:80050550 sll $0, 1
.text:80050554 sll $0, 1
.text:80050558 sll $0, 1
.text:8005055C jr $ra
.text:80050560 nop
.text:80050560 # End of function intLock
哪位大大帮分析下是怎么回事,CPU文档里提到的中断使能寄存器有3个(每个寄存器有32个中断位),不知道那个SR寄存器是怎么来的,mfc0 $v0, SR这段BIN码是40 02 60 00查MIPS指令得出SR的值是01100,这个寄存器是MIPS的中断状态寄存器么?为什么intLock无效??