Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
93e2e851
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
93e2e851
编写于
10月 09, 2010
作者:
M
Michal Simek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
microblaze: Separate library optimized functions
memcpy/memmove/memset Signed-off-by:
N
Michal Simek
<
monstr@monstr.eu
>
上级
ccea0e6e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
46 addition
and
15 deletion
+46
-15
arch/microblaze/lib/memcpy.c
arch/microblaze/lib/memcpy.c
+10
-3
arch/microblaze/lib/memmove.c
arch/microblaze/lib/memmove.c
+18
-8
arch/microblaze/lib/memset.c
arch/microblaze/lib/memset.c
+18
-4
未找到文件。
arch/microblaze/lib/memcpy.c
浏览文件 @
93e2e851
...
...
@@ -33,17 +33,24 @@
#include <asm/system.h>
#ifdef __HAVE_ARCH_MEMCPY
#ifndef CONFIG_OPT_LIB_FUNCTION
void
*
memcpy
(
void
*
v_dst
,
const
void
*
v_src
,
__kernel_size_t
c
)
{
const
char
*
src
=
v_src
;
char
*
dst
=
v_dst
;
#ifndef CONFIG_OPT_LIB_FUNCTION
/* Simple, byte oriented memcpy. */
while
(
c
--
)
*
dst
++
=
*
src
++
;
return
v_dst
;
#else
}
#else
/* CONFIG_OPT_LIB_FUNCTION */
void
*
memcpy
(
void
*
v_dst
,
const
void
*
v_src
,
__kernel_size_t
c
)
{
const
char
*
src
=
v_src
;
char
*
dst
=
v_dst
;
/* The following code tries to optimize the copy by using unsigned
* alignment. This will work fine if both source and destination are
* aligned on the same boundary. However, if they are aligned on
...
...
@@ -150,7 +157,7 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
}
return
v_dst
;
#endif
}
#endif
/* CONFIG_OPT_LIB_FUNCTION */
EXPORT_SYMBOL
(
memcpy
);
#endif
/* __HAVE_ARCH_MEMCPY */
arch/microblaze/lib/memmove.c
浏览文件 @
93e2e851
...
...
@@ -31,16 +31,12 @@
#include <linux/string.h>
#ifdef __HAVE_ARCH_MEMMOVE
#ifndef CONFIG_OPT_LIB_FUNCTION
void
*
memmove
(
void
*
v_dst
,
const
void
*
v_src
,
__kernel_size_t
c
)
{
const
char
*
src
=
v_src
;
char
*
dst
=
v_dst
;
#ifdef CONFIG_OPT_LIB_FUNCTION
const
uint32_t
*
i_src
;
uint32_t
*
i_dst
;
#endif
if
(
!
c
)
return
v_dst
;
...
...
@@ -48,7 +44,6 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c)
if
(
v_dst
<=
v_src
)
return
memcpy
(
v_dst
,
v_src
,
c
);
#ifndef CONFIG_OPT_LIB_FUNCTION
/* copy backwards, from end to beginning */
src
+=
c
;
dst
+=
c
;
...
...
@@ -58,7 +53,22 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c)
*--
dst
=
*--
src
;
return
v_dst
;
#else
}
#else
/* CONFIG_OPT_LIB_FUNCTION */
void
*
memmove
(
void
*
v_dst
,
const
void
*
v_src
,
__kernel_size_t
c
)
{
const
char
*
src
=
v_src
;
char
*
dst
=
v_dst
;
const
uint32_t
*
i_src
;
uint32_t
*
i_dst
;
if
(
!
c
)
return
v_dst
;
/* Use memcpy when source is higher than dest */
if
(
v_dst
<=
v_src
)
return
memcpy
(
v_dst
,
v_src
,
c
);
/* The following code tries to optimize the copy by using unsigned
* alignment. This will work fine if both source and destination are
* aligned on the same boundary. However, if they are aligned on
...
...
@@ -169,7 +179,7 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c)
*--
dst
=
*--
src
;
}
return
v_dst
;
#endif
}
#endif
/* CONFIG_OPT_LIB_FUNCTION */
EXPORT_SYMBOL
(
memmove
);
#endif
/* __HAVE_ARCH_MEMMOVE */
arch/microblaze/lib/memset.c
浏览文件 @
93e2e851
...
...
@@ -31,17 +31,30 @@
#include <linux/string.h>
#ifdef __HAVE_ARCH_MEMSET
#ifndef CONFIG_OPT_LIB_FUNCTION
void
*
memset
(
void
*
v_src
,
int
c
,
__kernel_size_t
n
)
{
char
*
src
=
v_src
;
/* Truncate c to 8 bits */
c
=
(
c
&
0xFF
);
/* Simple, byte oriented memset or the rest of count. */
while
(
n
--
)
*
src
++
=
c
;
return
v_src
;
}
#else
/* CONFIG_OPT_LIB_FUNCTION */
void
*
memset
(
void
*
v_src
,
int
c
,
__kernel_size_t
n
)
{
char
*
src
=
v_src
;
#ifdef CONFIG_OPT_LIB_FUNCTION
uint32_t
*
i_src
;
uint32_t
w32
=
0
;
#endif
/* Truncate c to 8 bits */
c
=
(
c
&
0xFF
);
#ifdef CONFIG_OPT_LIB_FUNCTION
if
(
unlikely
(
c
))
{
/* Make a repeating word out of it */
w32
=
c
;
...
...
@@ -72,12 +85,13 @@ void *memset(void *v_src, int c, __kernel_size_t n)
src
=
(
void
*
)
i_src
;
}
#endif
/* Simple, byte oriented memset or the rest of count. */
while
(
n
--
)
*
src
++
=
c
;
return
v_src
;
}
#endif
/* CONFIG_OPT_LIB_FUNCTION */
EXPORT_SYMBOL
(
memset
);
#endif
/* __HAVE_ARCH_MEMSET */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录