~ubuntu-branches/debian/experimental/linux-tools/experimental

« back to all changes in this revision

Viewing changes to arch/s390/include/asm/uaccess.h

  • Committer: Package Import Robot
  • Author(s): Ben Hutchings
  • Date: 2014-02-02 16:57:49 UTC
  • mfrom: (1.1.10) (0.1.21 sid)
  • Revision ID: package-import@ubuntu.com-20140202165749-tw94o9t1t0a8txk6
Tags: 3.13-1~exp2
Merge changes from sid up to 3.12.6-3

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
 
95
95
struct uaccess_ops {
96
96
        size_t (*copy_from_user)(size_t, const void __user *, void *);
97
 
        size_t (*copy_from_user_small)(size_t, const void __user *, void *);
98
97
        size_t (*copy_to_user)(size_t, void __user *, const void *);
99
 
        size_t (*copy_to_user_small)(size_t, void __user *, const void *);
100
98
        size_t (*copy_in_user)(size_t, void __user *, const void __user *);
101
99
        size_t (*clear_user)(size_t, void __user *);
102
100
        size_t (*strnlen_user)(size_t, const char __user *);
106
104
};
107
105
 
108
106
extern struct uaccess_ops uaccess;
109
 
extern struct uaccess_ops uaccess_std;
110
107
extern struct uaccess_ops uaccess_mvcos;
111
 
extern struct uaccess_ops uaccess_mvcos_switch;
112
108
extern struct uaccess_ops uaccess_pt;
113
109
 
114
110
extern int __handle_fault(unsigned long, unsigned long, int);
115
111
 
116
112
static inline int __put_user_fn(size_t size, void __user *ptr, void *x)
117
113
{
118
 
        size = uaccess.copy_to_user_small(size, ptr, x);
 
114
        size = uaccess.copy_to_user(size, ptr, x);
119
115
        return size ? -EFAULT : size;
120
116
}
121
117
 
122
118
static inline int __get_user_fn(size_t size, const void __user *ptr, void *x)
123
119
{
124
 
        size = uaccess.copy_from_user_small(size, ptr, x);
 
120
        size = uaccess.copy_from_user(size, ptr, x);
125
121
        return size ? -EFAULT : size;
126
122
}
127
123
 
226
222
static inline unsigned long __must_check
227
223
__copy_to_user(void __user *to, const void *from, unsigned long n)
228
224
{
229
 
        if (__builtin_constant_p(n) && (n <= 256))
230
 
                return uaccess.copy_to_user_small(n, to, from);
231
 
        else
232
 
                return uaccess.copy_to_user(n, to, from);
 
225
        return uaccess.copy_to_user(n, to, from);
233
226
}
234
227
 
235
228
#define __copy_to_user_inatomic __copy_to_user
275
268
static inline unsigned long __must_check
276
269
__copy_from_user(void *to, const void __user *from, unsigned long n)
277
270
{
278
 
        if (__builtin_constant_p(n) && (n <= 256))
279
 
                return uaccess.copy_from_user_small(n, from, to);
280
 
        else
281
 
                return uaccess.copy_from_user(n, from, to);
 
271
        return uaccess.copy_from_user(n, from, to);
282
272
}
283
273
 
284
274
extern void copy_from_user_overflow(void)