提交 44ce6969 编写于 作者: Y YOUR_NAME

fix: 内核态在console初始化完成后,使用printf无法正常打印

printf实现流程上会调用cmd为TIOCGWINSZ的ioctl命令,该命令的实现
在console层ConsoleGetWinSize函数中,而此函数copy结果时使用函数
LOS_ArchCopyToUser,由于该过程在内核态,导致LOS_ArchCopyToUser失败,
从而引发printf无法正常打印的问题。

close: #I3UG00
Signed-off-by: Nzhangfanfan <zhangfanfan2@huawei.com>
Change-Id: I3e85f682429cbe30842206842ddb2a8388ec8412
上级 1a3f3f54
......@@ -853,11 +853,10 @@ STATIC INT32 ConsoleGetWinSize(unsigned long arg)
.ws_row = DEFAULT_WINDOW_SIZE_ROW
};
if(LOS_ArchCopyToUser((VOID *)arg, &kws, sizeof(struct winsize)) != 0) {
if (LOS_CopyFromKernel((VOID *)arg, sizeof(struct winsize), &kws, sizeof(struct winsize)) != 0) {
return -EFAULT;
} else {
return LOS_OK;
}
return LOS_OK;
}
STATIC INT32 ConsoleGetTermios(unsigned long arg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册