fix: 中断中调用PRINTK概率卡死,导致系统不能正常响应中断

当console层的打印缓冲buffer满且打印任务被饿死时,函数ConsoleOutput会出现在for循环中
不退出的情况,导致中断打印时卡死

close: #I4C9GC

Signed-off-by: zff <zhangfanfan2@huawei.com>
Change-Id: I70b9d7c848dce7d351c5679e7b08049df27a6f10
This commit is contained in:
zff 2021-09-28 15:03:43 +08:00
parent 7d7cff4c51
commit 9726ba11a7
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ STATIC VOID ConsoleOutput(const CHAR *str, UINT32 len)
for (;;) {
cnt = write(STDOUT_FILENO, str + writen, (size_t)toWrite);
if ((cnt < 0) || (toWrite == cnt)) {
if ((cnt < 0) || ((cnt == 0) && (OS_INT_ACTIVE)) || (toWrite == cnt)) {
break;
}
writen += cnt;