fix: LOS_Panic和魔法键功能中的使用PRINTK打印,依赖任务调度,特殊情况下存在打印不出来的问题

close: #I4NOC7

Signed-off-by: zff <zhangfanfan2@huawei.com>
Change-Id: I7f28e79293d3388e2b1d7208c2b8ff8ff133528a
This commit is contained in:
zff 2021-12-22 16:22:32 +08:00
parent 954e7eb0cf
commit 53addea304
2 changed files with 5 additions and 5 deletions

View File

@ -1237,10 +1237,10 @@ __attribute__((noinline)) VOID LOS_Panic(const CHAR *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
UartVprintf(fmt, ap);
OsVprintf(fmt, ap, EXC_OUTPUT);
va_end(ap);
__asm__ __volatile__("swi 0");
while (1);
while (1) {}
}
/* stack protector */

View File

@ -112,7 +112,7 @@ STATIC VOID OsMagicPanic(VOID)
STATIC VOID OsMagicMemCheck(VOID)
{
if (LOS_MemIntegrityCheck(m_aucSysMem1) == LOS_OK) {
PRINTK("system memcheck over, all passed!\n");
PrintExcInfo("system memcheck over, all passed!\n");
}
return;
}
@ -130,9 +130,9 @@ INT32 CheckMagicKey(CHAR key, UINT16 consoleId)
} else if (key == 0x12) { /* ctrl + r */
magicKeySwitch = ~magicKeySwitch;
if (magicKeySwitch != 0) {
PRINTK("Magic key on\n");
PrintExcInfo("Magic key on\n");
} else {
PRINTK("Magic key off\n");
PrintExcInfo("Magic key off\n");
}
return 1;
}