Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
人间散章
rt-thread
提交
a354f846
R
rt-thread
项目概览
人间散章
/
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,发现更多精彩内容 >>
提交
a354f846
编写于
10月 13, 2021
作者:
mysterywolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[libc]&[dfs] remove unnecessary RT_USING_POSIX and RT_USING_DFS_DEVFS
上级
0873b816
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
27 addition
and
27 deletion
+27
-27
components/dfs/src/dfs.c
components/dfs/src/dfs.c
+2
-2
components/libc/compilers/armlibc/libc.c
components/libc/compilers/armlibc/libc.c
+6
-6
components/libc/compilers/armlibc/syscalls.c
components/libc/compilers/armlibc/syscalls.c
+5
-5
components/libc/compilers/dlib/libc.c
components/libc/compilers/dlib/libc.c
+5
-5
components/libc/compilers/dlib/syscall_write.c
components/libc/compilers/dlib/syscall_write.c
+5
-5
components/libc/compilers/gcc/newlib/libc.c
components/libc/compilers/gcc/newlib/libc.c
+4
-4
未找到文件。
components/dfs/src/dfs.c
浏览文件 @
a354f846
...
...
@@ -18,7 +18,7 @@
#include <lwp.h>
#endif
#if defined(RT_USING_DFS_DEVFS) && defined(RT_USING_
POSIX
)
#if defined(RT_USING_DFS_DEVFS) && defined(RT_USING_
LIBC
)
#include <libc.h>
#endif
...
...
@@ -216,7 +216,7 @@ struct dfs_fd *fd_get(int fd)
struct
dfs_fd
*
d
;
struct
dfs_fdtable
*
fdt
;
#if defined(RT_USING_DFS_DEVFS) && defined(RT_USING_
POSIX
)
#if defined(RT_USING_DFS_DEVFS) && defined(RT_USING_
LIBC
)
if
((
0
<=
fd
)
&&
(
fd
<=
2
))
fd
=
libc_stdio_get_console
();
#endif
...
...
components/libc/compilers/armlibc/libc.c
浏览文件 @
a354f846
...
...
@@ -17,23 +17,23 @@
int
libc_system_init
(
void
)
{
#if
defined(RT_USING_DFS) & defined(RT_USING_DFS_DEVFS)
#if
def RT_USING_DFS_DEVFS
rt_device_t
dev_console
;
dev_console
=
rt_console_get_device
();
if
(
dev_console
)
{
#if
defined(RT_USING_POSIX)
#if
def RT_USING_POSIX
libc_stdio_set_console
(
dev_console
->
parent
.
name
,
O_RDWR
);
#else
libc_stdio_set_console
(
dev_console
->
parent
.
name
,
O_WRONLY
);
#endif
#endif
/* RT_USING_POSIX */
}
#endif
#endif
/* RT_USING_DFS_DEVFS */
#if defined
RT_USING_PTHREADS && !defined RT_USING_COMPONENTS_INIT
#if defined
(RT_USING_PTHREADS) && !defined(RT_USING_COMPONENTS_INIT)
pthread_system_init
();
#endif
#endif
/* defined(RT_USING_PTHREADS) && !defined(RT_USING_COMPONENTS_INIT) */
return
0
;
}
...
...
components/libc/compilers/armlibc/syscalls.c
浏览文件 @
a354f846
...
...
@@ -187,14 +187,14 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
{
#ifdef RT_USING_DFS
int
size
;
#endif
#endif
/* RT_USING_DFS */
if
((
fh
==
STDOUT
)
||
(
fh
==
STDERR
))
{
#if !defined(RT_USING_CONSOLE) || !defined(RT_USING_DEVICE)
return
0
;
#else
#ifdef RT_USING_
POSIX
#ifdef RT_USING_
DFS
if
(
libc_stdio_get_console
()
<
0
)
{
LOG_W
(
"Do not invoke standard input before initializing libc"
);
...
...
@@ -210,8 +210,8 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
}
return
-
1
;
#endif
#endif
#endif
/* RT_USING_DFS */
#endif
/* !defined(RT_USING_CONSOLE) || !defined(RT_USING_DEVICE) */
}
else
if
(
fh
==
STDIN
)
{
...
...
@@ -226,7 +226,7 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
return
len
-
size
;
else
return
-
1
;
#endif
#endif
/* RT_USING_DFS */
}
/*
...
...
components/libc/compilers/dlib/libc.c
浏览文件 @
a354f846
...
...
@@ -17,23 +17,23 @@
int
libc_system_init
(
void
)
{
#if
defined(RT_USING_DFS) && defined(RT_USING_DFS_DEVFS)
#if
def RT_USING_DFS_DEVFS
rt_device_t
dev_console
;
dev_console
=
rt_console_get_device
();
if
(
dev_console
)
{
#if
defined(RT_USING_POSIX)
#if
def RT_USING_POSIX
libc_stdio_set_console
(
dev_console
->
parent
.
name
,
O_RDWR
);
#else
libc_stdio_set_console
(
dev_console
->
parent
.
name
,
O_WRONLY
);
#endif
#endif
/* RT_USING_POSIX */
}
#endif
#endif
/* RT_USING_DFS_DEVFS */
#if defined (RT_USING_PTHREADS) && !defined (RT_USING_COMPONENTS_INIT)
pthread_system_init
();
#endif
#endif
/* defined (RT_USING_PTHREADS) && !defined (RT_USING_COMPONENTS_INIT) */
return
0
;
}
...
...
components/libc/compilers/dlib/syscall_write.c
浏览文件 @
a354f846
...
...
@@ -25,7 +25,7 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
{
#ifdef RT_USING_DFS
int
size
;
#endif
#endif
/* RT_USING_DFS */
if
((
handle
==
_LLIO_STDOUT
)
||
(
handle
==
_LLIO_STDERR
))
{
...
...
@@ -33,7 +33,7 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
return
_LLIO_ERROR
;
#else
#ifdef RT_USING_
POSIX
#ifdef RT_USING_
DFS
if
(
libc_stdio_get_console
()
<
0
)
{
LOG_W
(
"Do not invoke standard output before initializing libc"
);
...
...
@@ -50,8 +50,8 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
}
return
len
;
#endif
#endif
#endif
/* RT_USING_DFS */
#endif
/* RT_USING_CONSOLE */
}
else
if
(
handle
==
_LLIO_STDIN
)
{
...
...
@@ -63,6 +63,6 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
#else
size
=
write
(
handle
,
buf
,
len
);
return
size
;
#endif
#endif
/* RT_USING_DFS */
}
components/libc/compilers/gcc/newlib/libc.c
浏览文件 @
a354f846
...
...
@@ -23,7 +23,7 @@ int _EXFUN(putenv,(char *__string));
int
libc_system_init
(
void
)
{
#if defined(RT_USING_DFS
) & defined(RT_USING_DFS
_DEVFS) & defined(RT_USING_CONSOLE)
#if defined(RT_USING_DFS_DEVFS) & defined(RT_USING_CONSOLE)
rt_device_t
dev_console
;
dev_console
=
rt_console_get_device
();
...
...
@@ -39,11 +39,11 @@ int libc_system_init(void)
/* set PATH and HOME */
putenv
(
"PATH=/bin"
);
putenv
(
"HOME=/home"
);
#endif
#endif
/* defined(RT_USING_DFS_DEVFS) & defined(RT_USING_CONSOLE) */
#if defined
RT_USING_PTHREADS && !defined RT_USING_COMPONENTS_INIT
#if defined
(RT_USING_PTHREADS) && !defined(RT_USING_COMPONENTS_INIT)
pthread_system_init
();
#endif
#endif
/* defined(RT_USING_PTHREADS) && !defined(RT_USING_COMPONENTS_INIT) */
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录