未验证 提交 21d32cdb 编写于 作者: 明德无敌赵晓薇 提交者: GitHub

[libcpu][C28x] Fix bugs of old c28x interrupt api which can not save and restore int status

In C28x DSP, interrupt status are stored in ST1 register. Both INTM and DBGM is used for masking interrupt, while the latter one is used in real-time debug mode. The origin function rudely enable and disable the interrupt without considering the recent interrupt status, which not only may cause  problem in some situation but also is not in conformity with rt-thread design specifications. The new api will fix this bug.
上级 b6207a20
......@@ -73,7 +73,9 @@ RT_CTX_RESTORE .macro
;
.asmfunc
_rt_hw_interrupt_disable:
DINT
PUSH ST1
SETC INTM,DBGM
MOV AL, *--SP
LRETR
.endasmfunc
......@@ -82,7 +84,8 @@ _rt_hw_interrupt_disable:
;
.asmfunc
_rt_hw_interrupt_enable:
EINT
MOV *SP++, AL
POP ST1
LRETR
.endasmfunc
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册