Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
3170d8d2
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
3170d8d2
编写于
5月 02, 2017
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
kill {__,}{get,put}_user_unaligned()
no users left Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
468138d7
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
0 addition
and
369 deletion
+0
-369
arch/arm/include/asm/uaccess.h
arch/arm/include/asm/uaccess.h
+0
-7
arch/arm64/include/asm/uaccess.h
arch/arm64/include/asm/uaccess.h
+0
-4
arch/ia64/include/asm/uaccess.h
arch/ia64/include/asm/uaccess.h
+0
-36
arch/m68k/include/asm/uaccess.h
arch/m68k/include/asm/uaccess.h
+0
-7
arch/mips/include/asm/uaccess.h
arch/mips/include/asm/uaccess.h
+0
-277
arch/parisc/include/asm/uaccess.h
arch/parisc/include/asm/uaccess.h
+0
-1
arch/powerpc/include/asm/uaccess.h
arch/powerpc/include/asm/uaccess.h
+0
-3
arch/s390/include/asm/uaccess.h
arch/s390/include/asm/uaccess.h
+0
-3
arch/sparc/include/asm/uaccess_64.h
arch/sparc/include/asm/uaccess_64.h
+0
-1
arch/tile/include/asm/uaccess.h
arch/tile/include/asm/uaccess.h
+0
-1
arch/x86/include/asm/uaccess.h
arch/x86/include/asm/uaccess.h
+0
-3
include/asm-generic/uaccess-unaligned.h
include/asm-generic/uaccess-unaligned.h
+0
-26
未找到文件。
arch/arm/include/asm/uaccess.h
浏览文件 @
3170d8d2
...
...
@@ -17,13 +17,6 @@
#include <asm/unified.h>
#include <asm/compiler.h>
#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
#include <asm-generic/uaccess-unaligned.h>
#else
#define __get_user_unaligned __get_user
#define __put_user_unaligned __put_user
#endif
#include <asm/extable.h>
/*
...
...
arch/arm64/include/asm/uaccess.h
浏览文件 @
3170d8d2
...
...
@@ -254,8 +254,6 @@ do { \
(void)0; \
})
#define __get_user_unaligned __get_user
#define get_user(x, ptr) \
({ \
__typeof__(*(ptr)) __user *__p = (ptr); \
...
...
@@ -320,8 +318,6 @@ do { \
(void)0; \
})
#define __put_user_unaligned __put_user
#define put_user(x, ptr) \
({ \
__typeof__(*(ptr)) __user *__p = (ptr); \
...
...
arch/ia64/include/asm/uaccess.h
浏览文件 @
3170d8d2
...
...
@@ -87,42 +87,6 @@ static inline int __access_ok(const void __user *p, unsigned long size)
#define __put_user(x, ptr) __put_user_nocheck((__typeof__(*(ptr))) (x), (ptr), sizeof(*(ptr)))
#define __get_user(x, ptr) __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
extern
long
__put_user_unaligned_unknown
(
void
);
#define __put_user_unaligned(x, ptr) \
({ \
long __ret; \
switch (sizeof(*(ptr))) { \
case 1: __ret = __put_user((x), (ptr)); break; \
case 2: __ret = (__put_user((x), (u8 __user *)(ptr))) \
| (__put_user((x) >> 8, ((u8 __user *)(ptr) + 1))); break; \
case 4: __ret = (__put_user((x), (u16 __user *)(ptr))) \
| (__put_user((x) >> 16, ((u16 __user *)(ptr) + 1))); break; \
case 8: __ret = (__put_user((x), (u32 __user *)(ptr))) \
| (__put_user((x) >> 32, ((u32 __user *)(ptr) + 1))); break; \
default: __ret = __put_user_unaligned_unknown(); \
} \
__ret; \
})
extern
long
__get_user_unaligned_unknown
(
void
);
#define __get_user_unaligned(x, ptr) \
({ \
long __ret; \
switch (sizeof(*(ptr))) { \
case 1: __ret = __get_user((x), (ptr)); break; \
case 2: __ret = (__get_user((x), (u8 __user *)(ptr))) \
| (__get_user((x) >> 8, ((u8 __user *)(ptr) + 1))); break; \
case 4: __ret = (__get_user((x), (u16 __user *)(ptr))) \
| (__get_user((x) >> 16, ((u16 __user *)(ptr) + 1))); break; \
case 8: __ret = (__get_user((x), (u32 __user *)(ptr))) \
| (__get_user((x) >> 32, ((u32 __user *)(ptr) + 1))); break; \
default: __ret = __get_user_unaligned_unknown(); \
} \
__ret; \
})
#ifdef ASM_SUPPORTED
struct
__large_struct
{
unsigned
long
buf
[
100
];
};
# define __m(x) (*(struct __large_struct __user *)(x))
...
...
arch/m68k/include/asm/uaccess.h
浏览文件 @
3170d8d2
...
...
@@ -3,11 +3,4 @@
#else
#include <asm/uaccess_mm.h>
#endif
#include <asm/extable.h>
#ifdef CONFIG_CPU_HAS_NO_UNALIGNED
#include <asm-generic/uaccess-unaligned.h>
#else
#define __get_user_unaligned(x, ptr) __get_user((x), (ptr))
#define __put_user_unaligned(x, ptr) __put_user((x), (ptr))
#endif
arch/mips/include/asm/uaccess.h
浏览文件 @
3170d8d2
...
...
@@ -496,283 +496,6 @@ do { \
extern
void
__put_user_unknown
(
void
);
/*
* ul{b,h,w} are macros and there are no equivalent macros for EVA.
* EVA unaligned access is handled in the ADE exception handler.
*/
#ifndef CONFIG_EVA
/*
* put_user_unaligned: - Write a simple value into user space.
* @x: Value to copy to user space.
* @ptr: Destination address, in user space.
*
* Context: User context only. This function may sleep if pagefaults are
* enabled.
*
* This macro copies a single simple value from kernel space to user
* space. It supports simple types like char and int, but not larger
* data types like structures or arrays.
*
* @ptr must have pointer-to-simple-variable type, and @x must be assignable
* to the result of dereferencing @ptr.
*
* Returns zero on success, or -EFAULT on error.
*/
#define put_user_unaligned(x,ptr) \
__put_user_unaligned_check((x),(ptr),sizeof(*(ptr)))
/*
* get_user_unaligned: - Get a simple variable from user space.
* @x: Variable to store result.
* @ptr: Source address, in user space.
*
* Context: User context only. This function may sleep if pagefaults are
* enabled.
*
* This macro copies a single simple variable from user space to kernel
* space. It supports simple types like char and int, but not larger
* data types like structures or arrays.
*
* @ptr must have pointer-to-simple-variable type, and the result of
* dereferencing @ptr must be assignable to @x without a cast.
*
* Returns zero on success, or -EFAULT on error.
* On error, the variable @x is set to zero.
*/
#define get_user_unaligned(x,ptr) \
__get_user_unaligned_check((x),(ptr),sizeof(*(ptr)))
/*
* __put_user_unaligned: - Write a simple value into user space, with less checking.
* @x: Value to copy to user space.
* @ptr: Destination address, in user space.
*
* Context: User context only. This function may sleep if pagefaults are
* enabled.
*
* This macro copies a single simple value from kernel space to user
* space. It supports simple types like char and int, but not larger
* data types like structures or arrays.
*
* @ptr must have pointer-to-simple-variable type, and @x must be assignable
* to the result of dereferencing @ptr.
*
* Caller must check the pointer with access_ok() before calling this
* function.
*
* Returns zero on success, or -EFAULT on error.
*/
#define __put_user_unaligned(x,ptr) \
__put_user_unaligned_nocheck((x),(ptr),sizeof(*(ptr)))
/*
* __get_user_unaligned: - Get a simple variable from user space, with less checking.
* @x: Variable to store result.
* @ptr: Source address, in user space.
*
* Context: User context only. This function may sleep if pagefaults are
* enabled.
*
* This macro copies a single simple variable from user space to kernel
* space. It supports simple types like char and int, but not larger
* data types like structures or arrays.
*
* @ptr must have pointer-to-simple-variable type, and the result of
* dereferencing @ptr must be assignable to @x without a cast.
*
* Caller must check the pointer with access_ok() before calling this
* function.
*
* Returns zero on success, or -EFAULT on error.
* On error, the variable @x is set to zero.
*/
#define __get_user_unaligned(x,ptr) \
__get_user_unaligned_nocheck((x),(ptr),sizeof(*(ptr)))
/*
* Yuck. We need two variants, one for 64bit operation and one
* for 32 bit mode and old iron.
*/
#ifdef CONFIG_32BIT
#define __GET_USER_UNALIGNED_DW(val, ptr) \
__get_user_unaligned_asm_ll32(val, ptr)
#endif
#ifdef CONFIG_64BIT
#define __GET_USER_UNALIGNED_DW(val, ptr) \
__get_user_unaligned_asm(val, "uld", ptr)
#endif
extern
void
__get_user_unaligned_unknown
(
void
);
#define __get_user_unaligned_common(val, size, ptr) \
do { \
switch (size) { \
case 1: __get_data_asm(val, "lb", ptr); break; \
case 2: __get_data_unaligned_asm(val, "ulh", ptr); break; \
case 4: __get_data_unaligned_asm(val, "ulw", ptr); break; \
case 8: __GET_USER_UNALIGNED_DW(val, ptr); break; \
default: __get_user_unaligned_unknown(); break; \
} \
} while (0)
#define __get_user_unaligned_nocheck(x,ptr,size) \
({ \
int __gu_err; \
\
__get_user_unaligned_common((x), size, ptr); \
__gu_err; \
})
#define __get_user_unaligned_check(x,ptr,size) \
({ \
int __gu_err = -EFAULT; \
const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \
\
if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \
__get_user_unaligned_common((x), size, __gu_ptr); \
\
__gu_err; \
})
#define __get_data_unaligned_asm(val, insn, addr) \
{ \
long __gu_tmp; \
\
__asm__ __volatile__( \
"1: " insn " %1, %3 \n" \
"2: \n" \
" .insn \n" \
" .section .fixup,\"ax\" \n" \
"3: li %0, %4 \n" \
" move %1, $0 \n" \
" j 2b \n" \
" .previous \n" \
" .section __ex_table,\"a\" \n" \
" "__UA_ADDR "\t1b, 3b \n" \
" "__UA_ADDR "\t1b + 4, 3b \n" \
" .previous \n" \
: "=r" (__gu_err), "=r" (__gu_tmp) \
: "0" (0), "o" (__m(addr)), "i" (-EFAULT)); \
\
(val) = (__typeof__(*(addr))) __gu_tmp; \
}
/*
* Get a long long 64 using 32 bit registers.
*/
#define __get_user_unaligned_asm_ll32(val, addr) \
{ \
unsigned long long __gu_tmp; \
\
__asm__ __volatile__( \
"1: ulw %1, (%3) \n" \
"2: ulw %D1, 4(%3) \n" \
" move %0, $0 \n" \
"3: \n" \
" .insn \n" \
" .section .fixup,\"ax\" \n" \
"4: li %0, %4 \n" \
" move %1, $0 \n" \
" move %D1, $0 \n" \
" j 3b \n" \
" .previous \n" \
" .section __ex_table,\"a\" \n" \
" " __UA_ADDR " 1b, 4b \n" \
" " __UA_ADDR " 1b + 4, 4b \n" \
" " __UA_ADDR " 2b, 4b \n" \
" " __UA_ADDR " 2b + 4, 4b \n" \
" .previous \n" \
: "=r" (__gu_err), "=&r" (__gu_tmp) \
: "0" (0), "r" (addr), "i" (-EFAULT)); \
(val) = (__typeof__(*(addr))) __gu_tmp; \
}
/*
* Yuck. We need two variants, one for 64bit operation and one
* for 32 bit mode and old iron.
*/
#ifdef CONFIG_32BIT
#define __PUT_USER_UNALIGNED_DW(ptr) __put_user_unaligned_asm_ll32(ptr)
#endif
#ifdef CONFIG_64BIT
#define __PUT_USER_UNALIGNED_DW(ptr) __put_user_unaligned_asm("usd", ptr)
#endif
#define __put_user_unaligned_common(ptr, size) \
do { \
switch (size) { \
case 1: __put_data_asm("sb", ptr); break; \
case 2: __put_user_unaligned_asm("ush", ptr); break; \
case 4: __put_user_unaligned_asm("usw", ptr); break; \
case 8: __PUT_USER_UNALIGNED_DW(ptr); break; \
default: __put_user_unaligned_unknown(); break; \
} while (0)
#define __put_user_unaligned_nocheck(x,ptr,size) \
({ \
__typeof__(*(ptr)) __pu_val; \
int __pu_err = 0; \
\
__pu_val = (x); \
__put_user_unaligned_common(ptr, size); \
__pu_err; \
})
#define __put_user_unaligned_check(x,ptr,size) \
({ \
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \
__typeof__(*(ptr)) __pu_val = (x); \
int __pu_err = -EFAULT; \
\
if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) \
__put_user_unaligned_common(__pu_addr, size); \
\
__pu_err; \
})
#define __put_user_unaligned_asm(insn, ptr) \
{ \
__asm__ __volatile__( \
"1: " insn " %z2, %3 # __put_user_unaligned_asm\n" \
"2: \n" \
" .insn \n" \
" .section .fixup,\"ax\" \n" \
"3: li %0, %4 \n" \
" j 2b \n" \
" .previous \n" \
" .section __ex_table,\"a\" \n" \
" " __UA_ADDR " 1b, 3b \n" \
" .previous \n" \
: "=r" (__pu_err) \
: "0" (0), "Jr" (__pu_val), "o" (__m(ptr)), \
"i" (-EFAULT)); \
}
#define __put_user_unaligned_asm_ll32(ptr) \
{ \
__asm__ __volatile__( \
"1: sw %2, (%3) # __put_user_unaligned_asm_ll32 \n" \
"2: sw %D2, 4(%3) \n" \
"3: \n" \
" .insn \n" \
" .section .fixup,\"ax\" \n" \
"4: li %0, %4 \n" \
" j 3b \n" \
" .previous \n" \
" .section __ex_table,\"a\" \n" \
" " __UA_ADDR " 1b, 4b \n" \
" " __UA_ADDR " 1b + 4, 4b \n" \
" " __UA_ADDR " 2b, 4b \n" \
" " __UA_ADDR " 2b + 4, 4b \n" \
" .previous" \
: "=r" (__pu_err) \
: "0" (0), "r" (__pu_val), "r" (ptr), \
"i" (-EFAULT)); \
}
extern
void
__put_user_unaligned_unknown
(
void
);
#endif
/*
* We're generating jump to subroutines which will be outside the range of
* jump instructions
...
...
arch/parisc/include/asm/uaccess.h
浏览文件 @
3170d8d2
...
...
@@ -6,7 +6,6 @@
*/
#include <asm/page.h>
#include <asm/cache.h>
#include <asm-generic/uaccess-unaligned.h>
#include <linux/bug.h>
#include <linux/string.h>
...
...
arch/powerpc/include/asm/uaccess.h
浏览文件 @
3170d8d2
...
...
@@ -90,9 +90,6 @@
#define __put_user_inatomic(x, ptr) \
__put_user_nosleep((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
#define __get_user_unaligned __get_user
#define __put_user_unaligned __put_user
extern
long
__put_user_bad
(
void
);
/*
...
...
arch/s390/include/asm/uaccess.h
浏览文件 @
3170d8d2
...
...
@@ -249,9 +249,6 @@ int __put_user_bad(void) __attribute__((noreturn));
int
__get_user_bad
(
void
)
__attribute__
((
noreturn
));
#define __put_user_unaligned __put_user
#define __get_user_unaligned __get_user
unsigned
long
__must_check
raw_copy_in_user
(
void
__user
*
to
,
const
void
__user
*
from
,
unsigned
long
n
);
...
...
arch/sparc/include/asm/uaccess_64.h
浏览文件 @
3170d8d2
...
...
@@ -9,7 +9,6 @@
#include <linux/string.h>
#include <asm/asi.h>
#include <asm/spitfire.h>
#include <asm-generic/uaccess-unaligned.h>
#include <asm/extable_64.h>
#include <asm/processor.h>
...
...
arch/tile/include/asm/uaccess.h
浏览文件 @
3170d8d2
...
...
@@ -19,7 +19,6 @@
* User space memory access functions
*/
#include <linux/mm.h>
#include <asm-generic/uaccess-unaligned.h>
#include <asm/processor.h>
#include <asm/page.h>
...
...
arch/x86/include/asm/uaccess.h
浏览文件 @
3170d8d2
...
...
@@ -535,9 +535,6 @@ struct __large_struct { unsigned long buf[100]; };
#define __put_user(x, ptr) \
__put_user_nocheck((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
#define __get_user_unaligned __get_user
#define __put_user_unaligned __put_user
/*
* {get|put}_user_try and catch
*
...
...
include/asm-generic/uaccess-unaligned.h
已删除
100644 → 0
浏览文件 @
468138d7
#ifndef __ASM_GENERIC_UACCESS_UNALIGNED_H
#define __ASM_GENERIC_UACCESS_UNALIGNED_H
/*
* This macro should be used instead of __get_user() when accessing
* values at locations that are not known to be aligned.
*/
#define __get_user_unaligned(x, ptr) \
({ \
__typeof__ (*(ptr)) __x; \
__copy_from_user(&__x, (ptr), sizeof(*(ptr))) ? -EFAULT : 0; \
(x) = __x; \
})
/*
* This macro should be used instead of __put_user() when accessing
* values at locations that are not known to be aligned.
*/
#define __put_user_unaligned(x, ptr) \
({ \
__typeof__ (*(ptr)) __x = (x); \
__copy_to_user((ptr), &__x, sizeof(*(ptr))) ? -EFAULT : 0; \
})
#endif
/* __ASM_GENERIC_UACCESS_UNALIGNED_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录