Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
0c7e9a87
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0c7e9a87
编写于
3月 28, 2017
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cris: switch to RAW_COPY_USER
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
b71f1bf5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
42 deletion
+12
-42
arch/cris/Kconfig
arch/cris/Kconfig
+1
-0
arch/cris/include/asm/uaccess.h
arch/cris/include/asm/uaccess.h
+11
-42
未找到文件。
arch/cris/Kconfig
浏览文件 @
0c7e9a87
...
...
@@ -71,6 +71,7 @@ config CRIS
select GENERIC_SCHED_CLOCK if ETRAX_ARCH_V32
select HAVE_DEBUG_BUGVERBOSE if ETRAX_ARCH_V32
select HAVE_NMI
select ARCH_HAS_RAW_COPY_USER
config HZ
int
...
...
arch/cris/include/asm/uaccess.h
浏览文件 @
0c7e9a87
...
...
@@ -336,64 +336,33 @@ static inline size_t clear_user(void __user *to, size_t n)
return
__do_clear_user
(
to
,
n
);
}
static
inline
size_t
copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
size_t
n
)
static
inline
unsigned
long
raw_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
size_t
res
=
n
;
if
(
likely
(
access_ok
(
VERIFY_READ
,
from
,
n
)))
{
if
(
__builtin_constant_p
(
n
))
res
=
__constant_copy_from_user
(
to
,
from
,
n
);
else
res
=
__copy_user_in
(
to
,
from
,
n
);
}
if
(
unlikely
(
res
))
memset
(
to
+
n
-
res
,
0
,
res
);
return
res
;
if
(
__builtin_constant_p
(
n
))
return
__constant_copy_from_user
(
to
,
from
,
n
);
else
return
__copy_user_in
(
to
,
from
,
n
);
}
static
inline
size_t
copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
size_t
n
)
static
inline
unsigned
long
raw_copy_to_user
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
if
(
unlikely
(
!
access_ok
(
VERIFY_WRITE
,
to
,
n
)))
return
n
;
if
(
__builtin_constant_p
(
n
))
return
__constant_copy_to_user
(
to
,
from
,
n
);
else
return
__copy_user
(
to
,
from
,
n
);
}
/* We let the __ versions of copy_from/to_user inline, because they're often
* used in fast paths and have only a small space overhead.
*/
static
inline
unsigned
long
__generic_copy_from_user_nocheck
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
return
__copy_user_in
(
to
,
from
,
n
);
}
static
inline
unsigned
long
__generic_copy_to_user_nocheck
(
void
__user
*
to
,
const
void
*
from
,
unsigned
long
n
)
{
return
__copy_user
(
to
,
from
,
n
);
}
#define INLINE_COPY_FROM_USER
#define INLINE_COPY_TO_USER
static
inline
unsigned
long
__
generic_clear_user_nocheck
(
void
__user
*
to
,
unsigned
long
n
)
__
clear_user
(
void
__user
*
to
,
unsigned
long
n
)
{
return
__do_clear_user
(
to
,
n
);
}
/* without checking */
#define __copy_to_user(to, from, n) \
__generic_copy_to_user_nocheck((to), (from), (n))
#define __copy_from_user(to, from, n) \
__generic_copy_from_user_nocheck((to), (from), (n))
#define __copy_to_user_inatomic __copy_to_user
#define __copy_from_user_inatomic __copy_from_user
#define __clear_user(to, n) __generic_clear_user_nocheck((to), (n))
#define strlen_user(str) strnlen_user((str), 0x7ffffffe)
#endif
/* _CRIS_UACCESS_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录