Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PHPmihuan
rt-thread
提交
c89735a3
R
rt-thread
项目概览
PHPmihuan
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
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,发现更多精彩内容 >>
未验证
提交
c89735a3
编写于
1月 20, 2022
作者:
mysterywolf
提交者:
GitHub
1月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[libdl] move libdl to posix folder (#5523)
上级
36060658
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
46 addition
and
38 deletion
+46
-38
components/libc/Kconfig
components/libc/Kconfig
+0
-10
components/libc/compilers/gcc/newlib/dlsyms.c
components/libc/compilers/gcc/newlib/dlsyms.c
+28
-18
components/libc/posix/Kconfig
components/libc/posix/Kconfig
+10
-0
components/libc/posix/libdl/SConscript
components/libc/posix/libdl/SConscript
+1
-3
components/libc/posix/libdl/arch/arm.c
components/libc/posix/libdl/arch/arm.c
+0
-0
components/libc/posix/libdl/arch/riscv.c
components/libc/posix/libdl/arch/riscv.c
+0
-0
components/libc/posix/libdl/arch/x86.c
components/libc/posix/libdl/arch/x86.c
+0
-0
components/libc/posix/libdl/dlclose.c
components/libc/posix/libdl/dlclose.c
+0
-0
components/libc/posix/libdl/dlelf.c
components/libc/posix/libdl/dlelf.c
+0
-0
components/libc/posix/libdl/dlelf.h
components/libc/posix/libdl/dlelf.h
+0
-0
components/libc/posix/libdl/dlerror.c
components/libc/posix/libdl/dlerror.c
+0
-0
components/libc/posix/libdl/dlfcn.h
components/libc/posix/libdl/dlfcn.h
+0
-0
components/libc/posix/libdl/dlmodule.c
components/libc/posix/libdl/dlmodule.c
+7
-7
components/libc/posix/libdl/dlmodule.h
components/libc/posix/libdl/dlmodule.h
+0
-0
components/libc/posix/libdl/dlopen.c
components/libc/posix/libdl/dlopen.c
+0
-0
components/libc/posix/libdl/dlsym.c
components/libc/posix/libdl/dlsym.c
+0
-0
未找到文件。
components/libc/Kconfig
浏览文件 @
c89735a3
menu "POSIX layer and C standard library"
config RT_USING_MODULE
bool "Enable dynamic module with dlopen/dlsym/dlclose feature"
default n
if RT_USING_MODULE
config RT_USING_CUSTOM_DLMODULE
bool "Enable load dynamic module by custom"
default n
endif
config RT_LIBC_DEFAULT_TIMEZONE
int "Set the default time zone (UTC+)"
range -12 12
...
...
components/libc/compilers/
armlibc/libc_
syms.c
→
components/libc/compilers/
gcc/newlib/dl
syms.c
浏览文件 @
c89735a3
...
...
@@ -5,25 +5,26 @@
*
* Change Logs:
* Date Author Notes
* 2017/10/15 bernard the first version
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <rtthread.h>
#include <rtm.h>
/* some export routines for module */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
RTM_EXPORT
(
strstr
);
RTM_EXPORT
(
strlen
);
RTM_EXPORT
(
strchr
);
RTM_EXPORT
(
strcpy
);
RTM_EXPORT
(
strncpy
);
RTM_EXPORT
(
strcmp
);
RTM_EXPORT
(
strncmp
);
RTM_EXPORT
(
strlen
);
RTM_EXPORT
(
strcat
);
RTM_EXPORT
(
strstr
);
RTM_EXPORT
(
strchr
);
RTM_EXPORT
(
strcmp
);
RTM_EXPORT
(
strtol
);
RTM_EXPORT
(
strtoul
);
RTM_EXPORT
(
strncmp
);
RTM_EXPORT
(
memcpy
);
RTM_EXPORT
(
memcmp
);
...
...
@@ -31,13 +32,22 @@ RTM_EXPORT(memmove);
RTM_EXPORT
(
memset
);
RTM_EXPORT
(
memchr
);
RTM_EXPORT
(
toupper
);
RTM_EXPORT
(
atoi
);
/* import the full stdio for printf */
#if defined(RT_USING_MODULE) && defined(__MICROLIB)
#error "[RT_USING_LIBC] Please use standard libc but not microlib."
#endif
RTM_EXPORT
(
putchar
);
RTM_EXPORT
(
puts
);
RTM_EXPORT
(
printf
);
RTM_EXPORT
(
sprintf
);
RTM_EXPORT
(
snprintf
);
RTM_EXPORT
(
fwrite
);
#include <setjmp.h>
RTM_EXPORT
(
longjmp
);
RTM_EXPORT
(
setjmp
);
RTM_EXPORT
(
exit
);
RTM_EXPORT
(
abort
);
RTM_EXPORT
(
rand
);
#include <assert.h>
RTM_EXPORT
(
__assert_func
);
components/libc/posix/Kconfig
浏览文件 @
c89735a3
...
...
@@ -65,6 +65,16 @@ if RT_USING_PTHREADS
default 8
endif
config RT_USING_MODULE
bool "Enable dynamic module with dlopen/dlsym/dlclose feature"
default n
if RT_USING_MODULE
config RT_USING_CUSTOM_DLMODULE
bool "Enable load dynamic module by custom"
default n
endif
source "$RTT_DIR/components/libc/posix/ipc/Kconfig"
endmenu
components/libc/libdl/SConscript
→
components/libc/
posix/
libdl/SConscript
浏览文件 @
c89735a3
...
...
@@ -7,8 +7,6 @@ group = []
CPPPATH
=
[
cwd
]
if
rtconfig
.
PLATFORM
==
'gcc'
:
group
=
DefineGroup
(
'libc'
,
src
,
depend
=
[
'RT_USING_MODULE'
],
CPPPATH
=
CPPPATH
)
group
=
DefineGroup
(
'POSIX'
,
src
,
depend
=
[
'RT_USING_MODULE'
],
CPPPATH
=
CPPPATH
)
Return
(
'group'
)
components/libc/libdl/arch/arm.c
→
components/libc/
posix/
libdl/arch/arm.c
浏览文件 @
c89735a3
文件已移动
components/libc/libdl/arch/riscv.c
→
components/libc/
posix/
libdl/arch/riscv.c
浏览文件 @
c89735a3
文件已移动
components/libc/libdl/arch/x86.c
→
components/libc/
posix/
libdl/arch/x86.c
浏览文件 @
c89735a3
文件已移动
components/libc/libdl/dlclose.c
→
components/libc/
posix/
libdl/dlclose.c
浏览文件 @
c89735a3
文件已移动
components/libc/libdl/dlelf.c
→
components/libc/
posix/
libdl/dlelf.c
浏览文件 @
c89735a3
文件已移动
components/libc/libdl/dlelf.h
→
components/libc/
posix/
libdl/dlelf.h
浏览文件 @
c89735a3
文件已移动
components/libc/libdl/dlerror.c
→
components/libc/
posix/
libdl/dlerror.c
浏览文件 @
c89735a3
文件已移动
components/libc/libdl/dlfcn.h
→
components/libc/
posix/
libdl/dlfcn.h
浏览文件 @
c89735a3
文件已移动
components/libc/libdl/dlmodule.c
→
components/libc/
posix/
libdl/dlmodule.c
浏览文件 @
c89735a3
...
...
@@ -14,7 +14,7 @@
#include "dlmodule.h"
#include "dlelf.h"
#if
defined(RT_USING_POSIX)
#if
def RT_USING_POSIX_FS
#include <unistd.h>
#include <sys/stat.h>
#include <sys/statfs.h>
...
...
@@ -423,14 +423,14 @@ struct rt_dlmodule *rt_module_self(void)
struct
rt_dlmodule
*
dlmodule_load
(
const
char
*
filename
)
{
#if
defined(RT_USING_POSIX)
#if
def RT_USING_POSIX_FS
int
fd
=
-
1
,
length
=
0
;
#endif
rt_err_t
ret
=
RT_EOK
;
rt_uint8_t
*
module_ptr
=
RT_NULL
;
struct
rt_dlmodule
*
module
=
RT_NULL
;
#if
defined(RT_USING_POSIX)
#if
def RT_USING_POSIX_FS
fd
=
open
(
filename
,
O_RDONLY
,
0
);
if
(
fd
>=
0
)
{
...
...
@@ -522,7 +522,7 @@ struct rt_dlmodule* dlmodule_load(const char* filename)
return
module
;
__exit:
#if
defined(RT_USING_POSIX)
#if
def RT_USING_POSIX_FS
if
(
fd
>=
0
)
close
(
fd
);
#endif
if
(
module_ptr
)
rt_free
(
module_ptr
);
...
...
@@ -573,7 +573,7 @@ struct rt_dlmodule* dlmodule_exec(const char* pgname, const char* cmd, int cmd_s
#if defined(RT_USING_CUSTOM_DLMODULE)
struct
rt_dlmodule
*
dlmodule_load_custom
(
const
char
*
filename
,
struct
rt_dlmodule_ops
*
ops
)
{
#if
defined(RT_USING_POSIX)
#if
def RT_USING_POSIX_FS
int
fd
=
-
1
,
length
=
0
;
#endif
rt_err_t
ret
=
RT_EOK
;
...
...
@@ -586,7 +586,7 @@ struct rt_dlmodule* dlmodule_load_custom(const char* filename, struct rt_dlmodul
RT_ASSERT
(
ops
->
unload
);
module_ptr
=
ops
->
load
(
filename
);
}
#if
defined(RT_USING_POSIX)
#if
def RT_USING_POSIX_FS
else
{
fd
=
open
(
filename
,
O_RDONLY
,
0
);
...
...
@@ -688,7 +688,7 @@ struct rt_dlmodule* dlmodule_load_custom(const char* filename, struct rt_dlmodul
return
module
;
__exit:
#if
defined(RT_USING_POSIX)
#if
def RT_USING_POSIX_FS
if
(
fd
>=
0
)
close
(
fd
);
#endif
if
(
module_ptr
)
...
...
components/libc/libdl/dlmodule.h
→
components/libc/
posix/
libdl/dlmodule.h
浏览文件 @
c89735a3
文件已移动
components/libc/libdl/dlopen.c
→
components/libc/
posix/
libdl/dlopen.c
浏览文件 @
c89735a3
文件已移动
components/libc/libdl/dlsym.c
→
components/libc/
posix/
libdl/dlsym.c
浏览文件 @
c89735a3
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录