Merge branches 'uaccess.alpha', 'uaccess.arc', 'uaccess.arm', 'uaccess.arm64', 'uaccess.avr32', 'uaccess.bfin', 'uaccess.c6x', 'uaccess.cris', 'uaccess.frv', 'uaccess.h8300', 'uaccess.hexagon', 'uaccess.ia64', 'uaccess.m32r', 'uaccess.m68k', 'uaccess.metag', 'uaccess.microblaze', 'uaccess.mips', 'uaccess.mn10300', 'uaccess.nios2', 'uaccess.openrisc', 'uaccess.parisc', 'uaccess.powerpc', 'uaccess.s390', 'uaccess.score', 'uaccess.sh', 'uaccess.sparc', 'uaccess.tile', 'uaccess.um', 'uaccess.unicore32', 'uaccess.x86' and 'uaccess.xtensa' into work.uaccess
这个提交包含在:

父节点
bf7af0cea8
ec022681a4
e13909a4ac
4de5b63e76
92430dab36
e5c1540030
50e9ab915a
86944ee158
0c7e9a870e
48f666c986
33ab2da801
ac4691fac8
b3622d3217
9a677341cd
29be02eb6f
840db3f938
d491afb865
2260ea86c0
19dbf70c5a
de51d6cc2c
ab89866be3
f64fd180ec
3448890c32
37096003c8
dc14253523
f98f48ee7c
31af2f36d5
23504bae7f
a668ce3a00
2ef59f2856
beba3a20bf
7d4914db8f
当前提交
eea86b637a
@@ -16,6 +16,7 @@ config NIOS2
|
||||
select SPARSE_IRQ
|
||||
select USB_ARCH_HAS_HCD if USB_SUPPORT
|
||||
select CPU_NO_EFFICIENT_FFS
|
||||
select ARCH_HAS_RAW_COPY_USER
|
||||
|
||||
config GENERIC_CSUM
|
||||
def_bool y
|
||||
|
@@ -13,6 +13,7 @@ generic-y += dma.h
|
||||
generic-y += emergency-restart.h
|
||||
generic-y += errno.h
|
||||
generic-y += exec.h
|
||||
generic-y += extable.h
|
||||
generic-y += fb.h
|
||||
generic-y += fcntl.h
|
||||
generic-y += ftrace.h
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <asm/tlbflush.h>
|
||||
|
||||
#include <asm/pgtable-bits.h>
|
||||
#define __ARCH_USE_5LEVEL_HACK
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
|
||||
#define FIRST_USER_ADDRESS 0UL
|
||||
|
@@ -13,33 +13,11 @@
|
||||
#ifndef _ASM_NIOS2_UACCESS_H
|
||||
#define _ASM_NIOS2_UACCESS_H
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <linux/thread_info.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#include <asm/page.h>
|
||||
|
||||
#define VERIFY_READ 0
|
||||
#define VERIFY_WRITE 1
|
||||
|
||||
/*
|
||||
* The exception table consists of pairs of addresses: the first is the
|
||||
* address of an instruction that is allowed to fault, and the second is
|
||||
* the address at which the program should continue. No registers are
|
||||
* modified, so it is entirely up to the continuation code to figure out
|
||||
* what to do.
|
||||
*
|
||||
* All the routines below use bits of fixup code that are out of line
|
||||
* with the main instruction path. This means when everything is well,
|
||||
* we don't even have to jump over them. Further, they do not intrude
|
||||
* on our cache or tlb entries.
|
||||
*/
|
||||
struct exception_table_entry {
|
||||
unsigned long insn;
|
||||
unsigned long fixup;
|
||||
};
|
||||
|
||||
extern int fixup_exception(struct pt_regs *regs);
|
||||
#include <asm/extable.h>
|
||||
|
||||
/*
|
||||
* Segment stuff
|
||||
@@ -95,36 +73,17 @@ static inline unsigned long __must_check clear_user(void __user *to,
|
||||
return __clear_user(to, n);
|
||||
}
|
||||
|
||||
extern long __copy_from_user(void *to, const void __user *from,
|
||||
unsigned long n);
|
||||
extern long __copy_to_user(void __user *to, const void *from, unsigned long n);
|
||||
|
||||
static inline long copy_from_user(void *to, const void __user *from,
|
||||
unsigned long n)
|
||||
{
|
||||
unsigned long res = n;
|
||||
if (access_ok(VERIFY_READ, from, n))
|
||||
res = __copy_from_user(to, from, n);
|
||||
if (unlikely(res))
|
||||
memset(to + (n - res), 0, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
static inline long copy_to_user(void __user *to, const void *from,
|
||||
unsigned long n)
|
||||
{
|
||||
if (!access_ok(VERIFY_WRITE, to, n))
|
||||
return n;
|
||||
return __copy_to_user(to, from, n);
|
||||
}
|
||||
extern unsigned long
|
||||
raw_copy_from_user(void *to, const void __user *from, unsigned long n);
|
||||
extern unsigned long
|
||||
raw_copy_to_user(void __user *to, const void *from, unsigned long n);
|
||||
#define INLINE_COPY_FROM_USER
|
||||
#define INLINE_COPY_TO_USER
|
||||
|
||||
extern long strncpy_from_user(char *__to, const char __user *__from,
|
||||
long __len);
|
||||
extern long strnlen_user(const char __user *s, long n);
|
||||
|
||||
#define __copy_from_user_inatomic __copy_from_user
|
||||
#define __copy_to_user_inatomic __copy_to_user
|
||||
|
||||
/* Optimized macros */
|
||||
#define __get_user_asm(val, insn, addr, err) \
|
||||
{ \
|
||||
|
@@ -10,9 +10,9 @@
|
||||
#include <linux/export.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
asm(".global __copy_from_user\n"
|
||||
" .type __copy_from_user, @function\n"
|
||||
"__copy_from_user:\n"
|
||||
asm(".global raw_copy_from_user\n"
|
||||
" .type raw_copy_from_user, @function\n"
|
||||
"raw_copy_from_user:\n"
|
||||
" movi r2,7\n"
|
||||
" mov r3,r4\n"
|
||||
" bge r2,r6,1f\n"
|
||||
@@ -65,12 +65,12 @@ asm(".global __copy_from_user\n"
|
||||
".word 7b,13b\n"
|
||||
".previous\n"
|
||||
);
|
||||
EXPORT_SYMBOL(__copy_from_user);
|
||||
EXPORT_SYMBOL(raw_copy_from_user);
|
||||
|
||||
asm(
|
||||
" .global __copy_to_user\n"
|
||||
" .type __copy_to_user, @function\n"
|
||||
"__copy_to_user:\n"
|
||||
" .global raw_copy_to_user\n"
|
||||
" .type raw_copy_to_user, @function\n"
|
||||
"raw_copy_to_user:\n"
|
||||
" movi r2,7\n"
|
||||
" mov r3,r4\n"
|
||||
" bge r2,r6,1f\n"
|
||||
@@ -127,7 +127,7 @@ asm(
|
||||
".word 11b,13b\n"
|
||||
".word 12b,13b\n"
|
||||
".previous\n");
|
||||
EXPORT_SYMBOL(__copy_to_user);
|
||||
EXPORT_SYMBOL(raw_copy_to_user);
|
||||
|
||||
long strncpy_from_user(char *__to, const char __user *__from, long __len)
|
||||
{
|
||||
|
在新工单中引用
屏蔽一个用户