Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
RT-Thread
rt-thread
提交
dd62b2b1
R
rt-thread
项目概览
RT-Thread
/
rt-thread
大约 1 年 前同步成功
通知
774
Star
8911
Fork
4735
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
dd62b2b1
编写于
1月 05, 2022
作者:
mysterywolf
提交者:
Bernard Xiong
1月 09, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[kservice] 增加RT_KSERVICE_USING_STDLIB_MEMSET RT_KSERVICE_USING_STDLIB_MEMCPY
上级
f89a162e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
0 deletion
+24
-0
include/rtthread.h
include/rtthread.h
+10
-0
src/Kconfig
src/Kconfig
+10
-0
src/kservice.c
src/kservice.c
+4
-0
未找到文件。
include/rtthread.h
浏览文件 @
dd62b2b1
...
...
@@ -596,8 +596,12 @@ int *_rt_errno(void);
int
__rt_ffs
(
int
value
);
#ifndef RT_KSERVICE_USING_STDLIB_MEMSET
void
*
rt_memset
(
void
*
src
,
int
c
,
rt_ubase_t
n
);
#endif
/* RT_KSERVICE_USING_STDLIB_MEMSET */
#ifndef RT_KSERVICE_USING_STDLIB_MEMCPY
void
*
rt_memcpy
(
void
*
dest
,
const
void
*
src
,
rt_ubase_t
n
);
#endif
/* RT_KSERVICE_USING_STDLIB_MEMCPY */
char
*
rt_strdup
(
const
char
*
s
);
#ifndef RT_KSERVICE_USING_STDLIB
...
...
@@ -612,6 +616,12 @@ rt_int32_t rt_strcmp(const char *cs, const char *ct);
rt_size_t
rt_strlen
(
const
char
*
src
);
#else
#include <string.h>
#ifdef RT_KSERVICE_USING_STDLIB_MEMSET
#define rt_memset(s, c, count) memset(s, c, count)
#endif
/* RT_KSERVICE_USING_STDLIB_MEMSET */
#ifdef RT_KSERVICE_USING_STDLIB_MEMCPY
#define rt_memcpy(dst, src, count) memcpy(dst, src, count)
#endif
/* RT_KSERVICE_USING_STDLIB_MEMCPY */
#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)
...
...
src/Kconfig
浏览文件 @
dd62b2b1
...
...
@@ -135,6 +135,16 @@ menu "kservice optimization"
bool "Enable kservice to use standard C library"
default n
if RT_KSERVICE_USING_STDLIB
config RT_KSERVICE_USING_STDLIB_MEMCPY
bool "Use memcpy to replace rt_memcpy (faster, but not safe)"
default n
config RT_KSERVICE_USING_STDLIB_MEMSET
bool "Use memset to replace rt_memset (faster, but not safe)"
default n
endif
config RT_KSERVICE_USING_TINY_SIZE
bool "Enable kservice to use tiny size"
default n
...
...
src/kservice.c
浏览文件 @
dd62b2b1
...
...
@@ -116,6 +116,7 @@ int *_rt_errno(void)
}
RTM_EXPORT
(
_rt_errno
);
#ifndef RT_KSERVICE_USING_STDLIB_MEMSET
/**
* This function will set the content of memory to specified value.
*
...
...
@@ -201,7 +202,9 @@ RT_WEAK void *rt_memset(void *s, int c, rt_ubase_t count)
#endif
/* RT_KSERVICE_USING_TINY_SIZE */
}
RTM_EXPORT
(
rt_memset
);
#endif
/* RT_KSERVICE_USING_STDLIB_MEMSET */
#ifndef RT_KSERVICE_USING_STDLIB_MEMCPY
/**
* This function will copy memory content from source address to destination address.
*
...
...
@@ -285,6 +288,7 @@ RT_WEAK void *rt_memcpy(void *dst, const void *src, rt_ubase_t count)
#endif
/* RT_KSERVICE_USING_TINY_SIZE */
}
RTM_EXPORT
(
rt_memcpy
);
#endif
/* RT_KSERVICE_USING_STDLIB_MEMCPY */
#ifndef RT_KSERVICE_USING_STDLIB
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录