Commit 69867f86 authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] ppc64: uninline some user copy routines

gcc 3.5 is complaining about the size of copy_from_user.  It turns out it
is rather large and putting it out of line saves us about 30kB on a default
kernel build.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3b78f5c5
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
lib-y := checksum.o dec_and_lock.o string.o strcase.o lib-y := checksum.o dec_and_lock.o string.o strcase.o
lib-y += copypage.o memcpy.o copyuser.o lib-y += copypage.o memcpy.o copyuser.o usercopy.o
# Lock primitives are defined as no-ops in include/linux/spinlock.h # Lock primitives are defined as no-ops in include/linux/spinlock.h
# for non-SMP configs. Don't build the real versions. # for non-SMP configs. Don't build the real versions.
......
/*
* Functions which are too large to be inlined.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <asm/uaccess.h>
unsigned long copy_from_user(void *to, const void __user *from, unsigned long n)
{
if (likely(access_ok(VERIFY_READ, from, n)))
n = __copy_from_user(to, from, n);
else
memset(to, 0, n);
return n;
}
unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
{
if (likely(access_ok(VERIFY_WRITE, to, n)))
n = __copy_to_user(to, from, n);
return n;
}
unsigned long copy_in_user(void __user *to, const void __user *from,
unsigned long n)
{
might_sleep();
if (likely(access_ok(VERIFY_READ, from, n) &&
access_ok(VERIFY_WRITE, to, n)))
n =__copy_tofrom_user(to, from, n);
return n;
}
...@@ -272,33 +272,12 @@ __copy_to_user(void __user *to, const void *from, unsigned long n) ...@@ -272,33 +272,12 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)
#define __copy_in_user(to, from, size) \ #define __copy_in_user(to, from, size) \
__copy_tofrom_user((to), (from), (size)) __copy_tofrom_user((to), (from), (size))
static inline unsigned long extern unsigned long copy_from_user(void *to, const void __user *from,
copy_from_user(void *to, const void __user *from, unsigned long n) unsigned long n);
{ extern unsigned long copy_to_user(void __user *to, const void *from,
if (likely(access_ok(VERIFY_READ, from, n))) unsigned long n);
n = __copy_from_user(to, from, n); extern unsigned long copy_in_user(void __user *to, const void __user *from,
else unsigned long n);
memset(to, 0, n);
return n;
}
static inline unsigned long
copy_to_user(void __user *to, const void *from, unsigned long n)
{
if (likely(access_ok(VERIFY_WRITE, to, n)))
n = __copy_to_user(to, from, n);
return n;
}
static inline unsigned long
copy_in_user(void __user *to, const void __user *from, unsigned long n)
{
might_sleep();
if (likely(access_ok(VERIFY_READ, from, n) &&
access_ok(VERIFY_WRITE, to, n)))
n =__copy_tofrom_user(to, from, n);
return n;
}
extern unsigned long __clear_user(void __user *addr, unsigned long size); extern unsigned long __clear_user(void __user *addr, unsigned long size);
......
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