x86, perf: Make copy_from_user_nmi() a library function

copy_from_user_nmi() is used in oprofile and perf. Moving it to other
library functions like copy_from_user(). As this is x86 code for 32
and 64 bits, create a new file usercopy.c for unified code.

Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20110607172413.GJ20052@erda.amd.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Robert Richter 2011-06-07 11:49:55 +02:00 committed by Ingo Molnar
parent 9985c20f9e
commit 1ac2e6ca44
5 changed files with 48 additions and 74 deletions

View file

@ -555,6 +555,9 @@ struct __large_struct { unsigned long buf[100]; };
#endif /* CONFIG_X86_WP_WORKS_OK */
extern unsigned long
copy_from_user_nmi(void *to, const void __user *from, unsigned long n);
/*
* movsl can be slow when source and dest are not both 8-byte aligned
*/