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

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

close: #I3UG00

Signed-off-by: zhangfanfan <zhangfanfan2@huawei.com>
Change-Id: I3e85f682429cbe30842206842ddb2a8388ec8412
This commit is contained in:
YOUR_NAME 2021-06-08 20:01:39 +08:00
parent 1a3f3f54e7
commit 44ce696904
1 changed files with 2 additions and 3 deletions

View File

@ -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)