Commit 02fcb974 authored by Russell King's avatar Russell King Committed by Russell King

[ARM] Remove the __arch_* layer from uaccess.h

Back in the days when we had armo (26-bit) and armv (32-bit) combined,
we had an additional layer to the uaccess macros to ensure correct
typing.  Since we no longer have 26-bit in this tree, we no longer
need this layer, so eliminate it.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent a39727f2
......@@ -109,11 +109,11 @@ EXPORT_SYMBOL(memchr);
EXPORT_SYMBOL(__memzero);
/* user mem (segment) */
EXPORT_SYMBOL(__arch_copy_from_user);
EXPORT_SYMBOL(__arch_copy_to_user);
EXPORT_SYMBOL(__arch_clear_user);
EXPORT_SYMBOL(__arch_strnlen_user);
EXPORT_SYMBOL(__arch_strncpy_from_user);
EXPORT_SYMBOL(__copy_from_user);
EXPORT_SYMBOL(__copy_to_user);
EXPORT_SYMBOL(__clear_user);
EXPORT_SYMBOL(__strnlen_user);
EXPORT_SYMBOL(__strncpy_from_user);
EXPORT_SYMBOL(__get_user_1);
EXPORT_SYMBOL(__get_user_2);
......
......@@ -12,13 +12,13 @@
.text
/* Prototype: int __arch_clear_user(void *addr, size_t sz)
/* Prototype: int __clear_user(void *addr, size_t sz)
* Purpose : clear some user memory
* Params : addr - user memory address to clear
* : sz - number of bytes to clear
* Returns : number of bytes NOT cleared
*/
ENTRY(__arch_clear_user)
ENTRY(__clear_user)
stmfd sp!, {r1, lr}
mov r2, #0
cmp r1, #4
......
......@@ -16,7 +16,7 @@
/*
* Prototype:
*
* size_t __arch_copy_from_user(void *to, const void *from, size_t n)
* size_t __copy_from_user(void *to, const void *from, size_t n)
*
* Purpose:
*
......@@ -83,7 +83,7 @@
.text
ENTRY(__arch_copy_from_user)
ENTRY(__copy_from_user)
#include "copy_template.S"
......
......@@ -16,7 +16,7 @@
/*
* Prototype:
*
* size_t __arch_copy_to_user(void *to, const void *from, size_t n)
* size_t __copy_to_user(void *to, const void *from, size_t n)
*
* Purpose:
*
......@@ -86,7 +86,7 @@
.text
ENTRY(__arch_copy_to_user)
ENTRY(__copy_to_user)
#include "copy_template.S"
......
......@@ -20,7 +20,7 @@
* returns the number of characters copied (strlen of copied string),
* -EFAULT on exception, or "len" if we fill the whole buffer
*/
ENTRY(__arch_strncpy_from_user)
ENTRY(__strncpy_from_user)
mov ip, r1
1: subs r2, r2, #1
USER( ldrplbt r3, [r1], #1)
......
......@@ -14,13 +14,13 @@
.text
.align 5
/* Prototype: unsigned long __arch_strnlen_user(const char *str, long n)
/* Prototype: unsigned long __strnlen_user(const char *str, long n)
* Purpose : get length of a string in user memory
* Params : str - address of string in user memory
* Returns : length of string *including terminator*
* or zero on exception, or n + 1 if too long
*/
ENTRY(__arch_strnlen_user)
ENTRY(__strnlen_user)
mov r2, r0
1:
USER( ldrbt r3, [r0], #1)
......
......@@ -19,7 +19,7 @@
#define PAGE_SHIFT 12
/* Prototype: int __arch_copy_to_user(void *to, const char *from, size_t n)
/* Prototype: int __copy_to_user(void *to, const char *from, size_t n)
* Purpose : copy a block to user memory from kernel memory
* Params : to - user memory
* : from - kernel memory
......@@ -39,7 +39,7 @@ USER( strgtbt r3, [r0], #1) @ May fault
sub r2, r2, ip
b .Lc2u_dest_aligned
ENTRY(__arch_copy_to_user)
ENTRY(__copy_to_user)
stmfd sp!, {r2, r4 - r7, lr}
cmp r2, #4
blt .Lc2u_not_enough
......@@ -283,7 +283,7 @@ USER( strgtbt r3, [r0], #1) @ May fault
9001: ldmfd sp!, {r0, r4 - r7, pc}
.previous
/* Prototype: unsigned long __arch_copy_from_user(void *to,const void *from,unsigned long n);
/* Prototype: unsigned long __copy_from_user(void *to,const void *from,unsigned long n);
* Purpose : copy a block from user memory to kernel memory
* Params : to - kernel memory
* : from - user memory
......@@ -302,7 +302,7 @@ USER( ldrgtbt r3, [r1], #1) @ May fault
sub r2, r2, ip
b .Lcfu_dest_aligned
ENTRY(__arch_copy_from_user)
ENTRY(__copy_from_user)
stmfd sp!, {r0, r2, r4 - r7, lr}
cmp r2, #4
blt .Lcfu_not_enough
......
......@@ -353,66 +353,47 @@ do { \
: "r" (x), "i" (-EFAULT) \
: "cc")
extern unsigned long __arch_copy_from_user(void *to, const void __user *from, unsigned long n);
extern unsigned long __arch_copy_to_user(void __user *to, const void *from, unsigned long n);
extern unsigned long __arch_clear_user(void __user *addr, unsigned long n);
extern unsigned long __arch_strncpy_from_user(char *to, const char __user *from, unsigned long count);
extern unsigned long __arch_strnlen_user(const char __user *s, long n);
extern unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n);
extern unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n);
extern unsigned long __clear_user(void __user *addr, unsigned long n);
extern unsigned long __strncpy_from_user(char *to, const char __user *from, unsigned long count);
extern unsigned long __strnlen_user(const char __user *s, long n);
static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n)
{
if (access_ok(VERIFY_READ, from, n))
n = __arch_copy_from_user(to, from, n);
n = __copy_from_user(to, from, n);
else /* security hole - plug it */
memzero(to, n);
return n;
}
static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)
{
return __arch_copy_from_user(to, from, n);
}
static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
{
if (access_ok(VERIFY_WRITE, to, n))
n = __arch_copy_to_user(to, from, n);
n = __copy_to_user(to, from, n);
return n;
}
static inline unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n)
{
return __arch_copy_to_user(to, from, n);
}
#define __copy_to_user_inatomic __copy_to_user
#define __copy_from_user_inatomic __copy_from_user
static inline unsigned long clear_user (void __user *to, unsigned long n)
static inline unsigned long clear_user(void __user *to, unsigned long n)
{
if (access_ok(VERIFY_WRITE, to, n))
n = __arch_clear_user(to, n);
n = __clear_user(to, n);
return n;
}
static inline unsigned long __clear_user (void __user *to, unsigned long n)
{
return __arch_clear_user(to, n);
}
static inline long strncpy_from_user (char *dst, const char __user *src, long count)
static inline long strncpy_from_user(char *dst, const char __user *src, long count)
{
long res = -EFAULT;
if (access_ok(VERIFY_READ, src, 1))
res = __arch_strncpy_from_user(dst, src, count);
res = __strncpy_from_user(dst, src, count);
return res;
}
static inline long __strncpy_from_user (char *dst, const char __user *src, long count)
{
return __arch_strncpy_from_user(dst, src, count);
}
#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
static inline long strnlen_user(const char __user *s, long n)
......@@ -420,7 +401,7 @@ static inline long strnlen_user(const char __user *s, long n)
unsigned long res = 0;
if (__addr_ok(s))
res = __arch_strnlen_user(s, n);
res = __strnlen_user(s, n);
return res;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment