提交 6b732ca3 编写于 作者: O openharmony_ci 提交者: Gitee

!237 fix: risc-v 锁中断在调度后失效

Merge pull request !237 from zhushengle/risc-v
...@@ -107,14 +107,25 @@ ...@@ -107,14 +107,25 @@
HalTaskContextSwitch: HalTaskContextSwitch:
PUSH_ALL_REG PUSH_ALL_REG
// clear mpie
li a2, RISCV_MSTATUS_MPIE
not a2, a2
and a0, a0, a2
// get mie
andi a1, a0, RISCV_MSTATUS_MIE andi a1, a0, RISCV_MSTATUS_MIE
// must be in machine mode // must be in machine mode
ori a1, a1, 0x180 ori a1, a1, 0x180
slli a1, a1, 0x4 slli a1, a1, 0x4
or a0, a0, a1 or a0, a0, a1
li a1, ~RISCV_MSTATUS_MIE
and a0, a0, a1 // clear mie
li a2, RISCV_MSTATUS_MIE
not a2, a2
and a0, a0, a2
SREG a0, 16 * REGBYTES(sp) SREG a0, 16 * REGBYTES(sp)
SREG ra, 17 * REGBYTES(sp) SREG ra, 17 * REGBYTES(sp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册