Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wwsmg1
rt-thread
提交
c3978ed9
R
rt-thread
项目概览
wwsmg1
/
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,发现更多精彩内容 >>
未验证
提交
c3978ed9
编写于
4月 02, 2021
作者:
B
Bernard Xiong
提交者:
GitHub
4月 02, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4396 from mysterywolf/kservice
[kernel] add RT_KSERVICE_USING_STDLIB
上级
08a4de57
58f000bd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
9 deletion
+33
-9
include/rtthread.h
include/rtthread.h
+24
-9
src/Kconfig
src/Kconfig
+4
-0
src/kservice.c
src/kservice.c
+5
-0
未找到文件。
include/rtthread.h
浏览文件 @
c3978ed9
...
...
@@ -14,6 +14,7 @@
* 2013-06-24 Bernard add rt_kprintf re-define when not use RT_USING_CONSOLE.
* 2016-08-09 ArdaFu add new thread and interrupt hook.
* 2018-11-22 Jesven add all cpu's lock and ipi handler
* 2021-02-28 Meco Man add RT_KSERVICE_USING_STDLIB
*/
#ifndef __RT_THREAD_H__
...
...
@@ -515,10 +516,12 @@ void rt_components_board_init(void);
void
rt_kprintf
(
const
char
*
fmt
,
...);
void
rt_kputs
(
const
char
*
str
);
#endif
rt_int32_t
rt_vsprintf
(
char
*
dest
,
const
char
*
format
,
va_list
arg_ptr
);
rt_int32_t
rt_vsnprintf
(
char
*
buf
,
rt_size_t
size
,
const
char
*
fmt
,
va_list
args
);
rt_int32_t
rt_sprintf
(
char
*
buf
,
const
char
*
format
,
...);
rt_int32_t
rt_snprintf
(
char
*
buf
,
rt_size_t
size
,
const
char
*
format
,
...);
rt_int32_t
rt_sscanf
(
const
char
*
buf
,
const
char
*
fmt
,
...);
#if defined(RT_USING_DEVICE) && defined(RT_USING_CONSOLE)
rt_device_t
rt_console_set_device
(
const
char
*
name
);
...
...
@@ -539,23 +542,35 @@ int __rt_ffs(int value);
void
*
rt_memset
(
void
*
src
,
int
c
,
rt_ubase_t
n
);
void
*
rt_memcpy
(
void
*
dest
,
const
void
*
src
,
rt_ubase_t
n
);
#ifndef RT_KSERVICE_USING_STDLIB
void
*
rt_memmove
(
void
*
dest
,
const
void
*
src
,
rt_ubase_t
n
);
rt_int32_t
rt_memcmp
(
const
void
*
cs
,
const
void
*
ct
,
rt_ubase_t
count
);
char
*
rt_strstr
(
const
char
*
str1
,
const
char
*
str2
);
rt_int32_t
rt_strcasecmp
(
const
char
*
a
,
const
char
*
b
);
char
*
rt_strncpy
(
char
*
dest
,
const
char
*
src
,
rt_ubase_t
n
);
rt_int32_t
rt_strncmp
(
const
char
*
cs
,
const
char
*
ct
,
rt_ubase_t
count
);
rt_int32_t
rt_strcmp
(
const
char
*
cs
,
const
char
*
ct
);
rt_size_t
rt_strlen
(
const
char
*
src
);
rt_size_t
rt_strnlen
(
const
char
*
s
,
rt_ubase_t
maxlen
);
rt_size_t
rt_strlen
(
const
char
*
src
);
#else
#include <string.h>
#define rt_memmove(dest, src, n) memmove(dest, src, n)
#define rt_memcmp(cs, ct, count) memcmp(cs, ct, count)
#define rt_strstr(str1, str2) strstr(str1, str2)
#define rt_strcasecmp(a, b) strcasecmp(a, b)
#define rt_strncpy(dest, src, n) strncpy(dest, src, n)
#define rt_strncmp(cs, ct, count) strncmp(cs, ct, count)
#define rt_strcmp(cs, ct) strcmp(cs, ct)
#define rt_strnlen(s, maxlen) strnlen(s, maxlen)
#define rt_strlen(src) strlen(src)
#endif
/*RT_KSERVICE_USING_STDLIB*/
char
*
rt_strdup
(
const
char
*
s
);
#if defined(__CC_ARM) || defined(__CLANG_ARM)
/* l
ea
k strdup interface */
/* l
ac
k strdup interface */
char
*
strdup
(
const
char
*
str
);
#endif
char
*
rt_strstr
(
const
char
*
str1
,
const
char
*
str2
);
rt_int32_t
rt_sscanf
(
const
char
*
buf
,
const
char
*
fmt
,
...);
char
*
rt_strncpy
(
char
*
dest
,
const
char
*
src
,
rt_ubase_t
n
);
void
*
rt_memmove
(
void
*
dest
,
const
void
*
src
,
rt_ubase_t
n
);
rt_int32_t
rt_memcmp
(
const
void
*
cs
,
const
void
*
ct
,
rt_ubase_t
count
);
rt_int32_t
rt_strcasecmp
(
const
char
*
a
,
const
char
*
b
);
void
rt_show_version
(
void
);
#ifdef RT_DEBUG
...
...
src/Kconfig
浏览文件 @
c3978ed9
...
...
@@ -116,6 +116,10 @@ config RT_TIMER_THREAD_STACK_SIZE
endif
config RT_KSERVICE_USING_STDLIB
bool "Enable kservice to use standard C library"
default n
menuconfig RT_DEBUG
bool "Enable debugging features"
default y
...
...
src/kservice.c
浏览文件 @
c3978ed9
...
...
@@ -17,6 +17,7 @@
* 2013-06-24 Bernard remove rt_kprintf if RT_USING_CONSOLE is not defined.
* 2013-09-24 aozima make sure the device is in STREAM mode when used by rt_kprintf.
* 2015-07-06 Bernard Add rt_assert_handler routine.
* 2021-02-28 Meco Man add RT_KSERVICE_USING_STDLIB
*/
#include <rtthread.h>
...
...
@@ -280,6 +281,8 @@ RT_WEAK void *rt_memcpy(void *dst, const void *src, rt_ubase_t count)
}
RTM_EXPORT
(
rt_memcpy
);
#ifndef RT_KSERVICE_USING_STDLIB
/**
* This function will move memory content from source address to destination
* address.
...
...
@@ -506,6 +509,8 @@ rt_size_t rt_strlen(const char *s)
}
RTM_EXPORT
(
rt_strlen
);
#endif
/*RT_KSERVICE_USING_STDLIB*/
#ifdef RT_USING_HEAP
/**
* This function will duplicate a string.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录