Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_46254178
rt-thread
提交
a3284876
R
rt-thread
项目概览
weixin_46254178
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a3284876
编写于
11月 24, 2021
作者:
mysterywolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revise RT_USING_POSIX_STDIO to RT_USING_POSIX_DEVIO
上级
3bc5ffb4
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
31 addition
and
35 deletion
+31
-35
components/dfs/src/dfs.c
components/dfs/src/dfs.c
+4
-4
components/finsh/shell.c
components/finsh/shell.c
+6
-6
components/finsh/shell.h
components/finsh/shell.h
+1
-1
components/legacy/dfs/dfs_select.h
components/legacy/dfs/dfs_select.h
+1
-1
components/libc/Kconfig
components/libc/Kconfig
+3
-3
components/libc/compilers/armlibc/syscalls.c
components/libc/compilers/armlibc/syscalls.c
+6
-6
components/libc/compilers/dlib/syscall_read.c
components/libc/compilers/dlib/syscall_read.c
+4
-4
components/libc/compilers/dlib/syscall_write.c
components/libc/compilers/dlib/syscall_write.c
+0
-4
components/libc/compilers/gcc/newlib/syscalls.c
components/libc/compilers/gcc/newlib/syscalls.c
+5
-5
components/libc/posix/src/SConscript
components/libc/posix/src/SConscript
+1
-1
未找到文件。
components/dfs/src/dfs.c
浏览文件 @
a3284876
...
...
@@ -18,9 +18,9 @@
#include <lwp.h>
#endif
#ifdef RT_USING_POSIX_
STD
IO
#ifdef RT_USING_POSIX_
DEV
IO
#include <libc.h>
#endif
/* RT_USING_POSIX_
STD
IO */
#endif
/* RT_USING_POSIX_
DEV
IO */
/* Global variables */
const
struct
dfs_filesystem_ops
*
filesystem_operation_table
[
DFS_FILESYSTEM_TYPES_MAX
];
...
...
@@ -216,10 +216,10 @@ struct dfs_fd *fd_get(int fd)
struct
dfs_fd
*
d
;
struct
dfs_fdtable
*
fdt
;
#ifdef RT_USING_POSIX_
STD
IO
#ifdef RT_USING_POSIX_
DEV
IO
if
((
0
<=
fd
)
&&
(
fd
<=
2
))
fd
=
libc_stdio_get_console
();
#endif
/* RT_USING_POSIX_
STD
IO */
#endif
/* RT_USING_POSIX_
DEV
IO */
fdt
=
dfs_fdtable_get
();
fd
=
fd
-
DFS_FD_OFFSET
;
...
...
components/finsh/shell.c
浏览文件 @
a3284876
...
...
@@ -146,7 +146,7 @@ int finsh_getchar(void)
{
#ifdef RT_USING_DEVICE
char
ch
=
0
;
#ifdef RT_USING_POSIX_
STD
IO
#ifdef RT_USING_POSIX_
DEV
IO
if
(
read
(
STDIN_FILENO
,
&
ch
,
1
)
>
0
)
{
return
ch
;
...
...
@@ -170,14 +170,14 @@ int finsh_getchar(void)
rt_sem_take
(
&
shell
->
rx_sem
,
RT_WAITING_FOREVER
);
return
ch
;
#endif
/* RT_USING_POSIX_
STD
IO */
#endif
/* RT_USING_POSIX_
DEV
IO */
#else
extern
char
rt_hw_console_getchar
(
void
);
return
rt_hw_console_getchar
();
#endif
/* RT_USING_DEVICE */
}
#if !defined(RT_USING_POSIX_
STD
IO) && defined(RT_USING_DEVICE)
#if !defined(RT_USING_POSIX_
DEV
IO) && defined(RT_USING_DEVICE)
static
rt_err_t
finsh_rx_ind
(
rt_device_t
dev
,
rt_size_t
size
)
{
RT_ASSERT
(
shell
!=
RT_NULL
);
...
...
@@ -241,7 +241,7 @@ const char *finsh_get_device()
RT_ASSERT
(
shell
!=
RT_NULL
);
return
shell
->
device
->
parent
.
name
;
}
#endif
/* !defined(RT_USING_POSIX_
STD
IO) && defined(RT_USING_DEVICE) */
#endif
/* !defined(RT_USING_POSIX_
DEV
IO) && defined(RT_USING_DEVICE) */
/**
* @ingroup finsh
...
...
@@ -443,7 +443,7 @@ void finsh_thread_entry(void *parameter)
shell
->
echo_mode
=
0
;
#endif
#if !defined(RT_USING_POSIX_
STD
IO) && defined(RT_USING_DEVICE)
#if !defined(RT_USING_POSIX_
DEV
IO) && defined(RT_USING_DEVICE)
/* set console device as shell device */
if
(
shell
->
device
==
RT_NULL
)
{
...
...
@@ -453,7 +453,7 @@ void finsh_thread_entry(void *parameter)
finsh_set_device
(
console
->
parent
.
name
);
}
}
#endif
/* !defined(RT_USING_POSIX_
STD
IO) && defined(RT_USING_DEVICE) */
#endif
/* !defined(RT_USING_POSIX_
DEV
IO) && defined(RT_USING_DEVICE) */
#ifdef FINSH_USING_AUTH
/* set the default password when the password isn't setting */
...
...
components/finsh/shell.h
浏览文件 @
a3284876
...
...
@@ -78,7 +78,7 @@ struct finsh_shell
rt_uint16_t
line_position
;
rt_uint16_t
line_curpos
;
#if !defined(RT_USING_POSIX_
STD
IO) && defined(RT_USING_DEVICE)
#if !defined(RT_USING_POSIX_
DEV
IO) && defined(RT_USING_DEVICE)
rt_device_t
device
;
#endif
...
...
components/legacy/dfs/dfs_select.h
浏览文件 @
a3284876
...
...
@@ -13,4 +13,4 @@
#include <sys/select.h>
#endif
#endif
/* DFS_SELECT_H__ */
components/libc/Kconfig
浏览文件 @
a3284876
...
...
@@ -12,7 +12,7 @@ if RT_USING_LIBC
config RT_LIBC_USING_FILEIO
bool "Enable libc with file operation, eg.fopen/fwrite/fread/getchar"
select RT_USING_POSIX
select RT_USING_POSIX_
STD
IO
select RT_USING_POSIX_
DEV
IO
default n
config RT_USING_MODULE
...
...
@@ -44,8 +44,8 @@ config RT_USING_POSIX
default n
if RT_USING_POSIX
config RT_USING_POSIX_
STD
IO
bool "Enable
standard I/O, STDOUT_FILENO/STDIN_FILENO/STDERR_FILENO
"
config RT_USING_POSIX_
DEV
IO
bool "Enable
devices as file descriptors
"
select RT_USING_DFS
select RT_USING_DFS_DEVFS
default n
...
...
components/libc/compilers/armlibc/syscalls.c
浏览文件 @
a3284876
...
...
@@ -21,9 +21,9 @@
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#ifdef RT_USING_POSIX_
STD
IO
#ifdef RT_USING_POSIX_
DEV
IO
#include "libc.h"
#endif
#endif
/* RT_USING_POSIX_DEVIO */
#define DBG_TAG "armlibc.syscalls"
#define DBG_LVL DBG_INFO
...
...
@@ -149,7 +149,7 @@ int _sys_read(FILEHANDLE fh, unsigned char *buf, unsigned len, int mode)
if
(
fh
==
STDIN
)
{
#ifdef RT_USING_POSIX_
STD
IO
#ifdef RT_USING_POSIX_
DEV
IO
if
(
libc_stdio_get_console
()
<
0
)
{
LOG_W
(
"Do not invoke standard output before initializing libc"
);
...
...
@@ -159,7 +159,7 @@ int _sys_read(FILEHANDLE fh, unsigned char *buf, unsigned len, int mode)
return
0
;
/* success */
#else
return
0
;
/* error */
#endif
#endif
/* RT_USING_POSIX_DEVIO */
}
else
if
(
fh
==
STDOUT
||
fh
==
STDERR
)
{
...
...
@@ -332,7 +332,7 @@ int fputc(int c, FILE *f)
int
fgetc
(
FILE
*
f
)
{
#ifdef RT_USING_POSIX_
STD
IO
#ifdef RT_USING_POSIX_
DEV
IO
char
ch
;
if
(
libc_stdio_get_console
()
<
0
)
...
...
@@ -343,7 +343,7 @@ int fgetc(FILE *f)
if
(
read
(
STDIN_FILENO
,
&
ch
,
1
)
==
1
)
return
ch
;
#endif
/* RT_USING_POSIX_
STD
IO */
#endif
/* RT_USING_POSIX_
DEV
IO */
return
0
;
/* error */
}
...
...
components/libc/compilers/dlib/syscall_read.c
浏览文件 @
a3284876
...
...
@@ -11,9 +11,9 @@
#include <rtthread.h>
#include <LowLevelIOInterface.h>
#include <unistd.h>
#ifdef RT_USING_POSIX_
STD
IO
#ifdef RT_USING_POSIX_
DEV
IO
#include "libc.h"
#endif
#endif
/* RT_USING_POSIX_DEVIO */
#define DBG_TAG "dlib.syscall_read"
#define DBG_LVL DBG_INFO
...
...
@@ -39,7 +39,7 @@ size_t __read(int handle, unsigned char *buf, size_t len)
if
(
handle
==
_LLIO_STDIN
)
{
#ifdef RT_USING_POSIX_
STD
IO
#ifdef RT_USING_POSIX_
DEV
IO
if
(
libc_stdio_get_console
()
<
0
)
{
LOG_W
(
"Do not invoke standard input before initializing libc"
);
...
...
@@ -48,7 +48,7 @@ size_t __read(int handle, unsigned char *buf, size_t len)
return
read
(
STDIN_FILENO
,
buf
,
len
);
/* return the length of the data read */
#else
return
_LLIO_ERROR
;
#endif
/* RT_USING_POSIX_
STD
IO */
#endif
/* RT_USING_POSIX_
DEV
IO */
}
else
if
((
handle
==
_LLIO_STDOUT
)
||
(
handle
==
_LLIO_STDERR
))
{
...
...
components/libc/compilers/dlib/syscall_write.c
浏览文件 @
a3284876
...
...
@@ -11,10 +11,6 @@
#include <rtthread.h>
#include <LowLevelIOInterface.h>
#include <unistd.h>
#ifdef RT_USING_POSIX_STDIO
#include "libc.h"
#endif
#define DBG_TAG "dlib.syscall_write"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
...
...
components/libc/compilers/gcc/newlib/syscalls.c
浏览文件 @
a3284876
...
...
@@ -20,12 +20,12 @@
#include <unistd.h>
#include <sys/errno.h>
#include <sys/stat.h>
#ifdef RT_USING_POSIX_
STD
IO
#ifdef RT_USING_POSIX_
DEV
IO
#include "libc.h"
#endif
#endif
/* RT_USING_POSIX_DEVIO */
#ifdef RT_USING_MODULE
#include <dlmodule.h>
#endif
#endif
/* RT_USING_MODULE */
#define DBG_TAG "newlib.syscalls"
#define DBG_LVL DBG_INFO
...
...
@@ -225,7 +225,7 @@ _ssize_t _read_r(struct _reent *ptr, int fd, void *buf, size_t nbytes)
_ssize_t
rc
;
if
(
fd
==
STDIN_FILENO
)
{
#ifdef RT_USING_POSIX_
STD
IO
#ifdef RT_USING_POSIX_
DEV
IO
if
(
libc_stdio_get_console
()
<
0
)
{
LOG_W
(
"Do not invoke standard input before initializing libc"
);
...
...
@@ -234,7 +234,7 @@ _ssize_t _read_r(struct _reent *ptr, int fd, void *buf, size_t nbytes)
#else
ptr
->
_errno
=
ENOTSUP
;
return
-
1
;
#endif
/* RT_USING_POSIX_
STD
IO */
#endif
/* RT_USING_POSIX_
DEV
IO */
}
else
if
(
fd
==
STDOUT_FILENO
||
fd
==
STDERR_FILENO
)
{
...
...
components/libc/posix/src/SConscript
浏览文件 @
a3284876
...
...
@@ -6,7 +6,7 @@ src = ['unistd.c']
cwd
=
GetCurrentDir
()
CPPPATH
=
[
cwd
]
if
GetDepend
(
'RT_USING_POSIX_
STD
IO'
):
if
GetDepend
(
'RT_USING_POSIX_
DEV
IO'
):
src
+=
[
'libc.c'
]
if
GetDepend
(
'RT_USING_POSIX_DELAY'
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录