diff options
Diffstat (limited to 'include/asm-mips/uaccess.h')
-rw-r--r-- | include/asm-mips/uaccess.h | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h index b25511787ee0..c30c718994c9 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h | |||
@@ -63,7 +63,7 @@ | |||
63 | #define get_fs() (current_thread_info()->addr_limit) | 63 | #define get_fs() (current_thread_info()->addr_limit) |
64 | #define set_fs(x) (current_thread_info()->addr_limit = (x)) | 64 | #define set_fs(x) (current_thread_info()->addr_limit = (x)) |
65 | 65 | ||
66 | #define segment_eq(a,b) ((a).seg == (b).seg) | 66 | #define segment_eq(a, b) ((a).seg == (b).seg) |
67 | 67 | ||
68 | 68 | ||
69 | /* | 69 | /* |
@@ -108,7 +108,7 @@ | |||
108 | (((signed long)((mask) & ((addr) | ((addr) + (size)) | __ua_size(size)))) == 0) | 108 | (((signed long)((mask) & ((addr) | ((addr) + (size)) | __ua_size(size)))) == 0) |
109 | 109 | ||
110 | #define access_ok(type, addr, size) \ | 110 | #define access_ok(type, addr, size) \ |
111 | likely(__access_ok((unsigned long)(addr), (size),__access_mask)) | 111 | likely(__access_ok((unsigned long)(addr), (size), __access_mask)) |
112 | 112 | ||
113 | /* | 113 | /* |
114 | * put_user: - Write a simple value into user space. | 114 | * put_user: - Write a simple value into user space. |
@@ -127,7 +127,7 @@ | |||
127 | * Returns zero on success, or -EFAULT on error. | 127 | * Returns zero on success, or -EFAULT on error. |
128 | */ | 128 | */ |
129 | #define put_user(x,ptr) \ | 129 | #define put_user(x,ptr) \ |
130 | __put_user_check((x),(ptr),sizeof(*(ptr))) | 130 | __put_user_check((x), (ptr), sizeof(*(ptr))) |
131 | 131 | ||
132 | /* | 132 | /* |
133 | * get_user: - Get a simple variable from user space. | 133 | * get_user: - Get a simple variable from user space. |
@@ -147,7 +147,7 @@ | |||
147 | * On error, the variable @x is set to zero. | 147 | * On error, the variable @x is set to zero. |
148 | */ | 148 | */ |
149 | #define get_user(x,ptr) \ | 149 | #define get_user(x,ptr) \ |
150 | __get_user_check((x),(ptr),sizeof(*(ptr))) | 150 | __get_user_check((x), (ptr), sizeof(*(ptr))) |
151 | 151 | ||
152 | /* | 152 | /* |
153 | * __put_user: - Write a simple value into user space, with less checking. | 153 | * __put_user: - Write a simple value into user space, with less checking. |
@@ -169,7 +169,7 @@ | |||
169 | * Returns zero on success, or -EFAULT on error. | 169 | * Returns zero on success, or -EFAULT on error. |
170 | */ | 170 | */ |
171 | #define __put_user(x,ptr) \ | 171 | #define __put_user(x,ptr) \ |
172 | __put_user_nocheck((x),(ptr),sizeof(*(ptr))) | 172 | __put_user_nocheck((x), (ptr), sizeof(*(ptr))) |
173 | 173 | ||
174 | /* | 174 | /* |
175 | * __get_user: - Get a simple variable from user space, with less checking. | 175 | * __get_user: - Get a simple variable from user space, with less checking. |
@@ -192,7 +192,7 @@ | |||
192 | * On error, the variable @x is set to zero. | 192 | * On error, the variable @x is set to zero. |
193 | */ | 193 | */ |
194 | #define __get_user(x,ptr) \ | 194 | #define __get_user(x,ptr) \ |
195 | __get_user_nocheck((x),(ptr),sizeof(*(ptr))) | 195 | __get_user_nocheck((x), (ptr), sizeof(*(ptr))) |
196 | 196 | ||
197 | struct __large_struct { unsigned long buf[100]; }; | 197 | struct __large_struct { unsigned long buf[100]; }; |
198 | #define __m(x) (*(struct __large_struct __user *)(x)) | 198 | #define __m(x) (*(struct __large_struct __user *)(x)) |
@@ -221,7 +221,7 @@ do { \ | |||
221 | } \ | 221 | } \ |
222 | } while (0) | 222 | } while (0) |
223 | 223 | ||
224 | #define __get_user_nocheck(x,ptr,size) \ | 224 | #define __get_user_nocheck(x, ptr, size) \ |
225 | ({ \ | 225 | ({ \ |
226 | long __gu_err; \ | 226 | long __gu_err; \ |
227 | \ | 227 | \ |
@@ -229,7 +229,7 @@ do { \ | |||
229 | __gu_err; \ | 229 | __gu_err; \ |
230 | }) | 230 | }) |
231 | 231 | ||
232 | #define __get_user_check(x,ptr,size) \ | 232 | #define __get_user_check(x, ptr, size) \ |
233 | ({ \ | 233 | ({ \ |
234 | long __gu_err = -EFAULT; \ | 234 | long __gu_err = -EFAULT; \ |
235 | const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \ | 235 | const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \ |
@@ -300,7 +300,7 @@ do { \ | |||
300 | #define __PUT_USER_DW(ptr) __put_user_asm("sd", ptr) | 300 | #define __PUT_USER_DW(ptr) __put_user_asm("sd", ptr) |
301 | #endif | 301 | #endif |
302 | 302 | ||
303 | #define __put_user_nocheck(x,ptr,size) \ | 303 | #define __put_user_nocheck(x, ptr, size) \ |
304 | ({ \ | 304 | ({ \ |
305 | __typeof__(*(ptr)) __pu_val; \ | 305 | __typeof__(*(ptr)) __pu_val; \ |
306 | long __pu_err = 0; \ | 306 | long __pu_err = 0; \ |
@@ -316,7 +316,7 @@ do { \ | |||
316 | __pu_err; \ | 316 | __pu_err; \ |
317 | }) | 317 | }) |
318 | 318 | ||
319 | #define __put_user_check(x,ptr,size) \ | 319 | #define __put_user_check(x, ptr, size) \ |
320 | ({ \ | 320 | ({ \ |
321 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ | 321 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
322 | __typeof__(*(ptr)) __pu_val = (x); \ | 322 | __typeof__(*(ptr)) __pu_val = (x); \ |
@@ -389,11 +389,11 @@ extern void __put_user_unknown(void); | |||
389 | 389 | ||
390 | extern size_t __copy_user(void *__to, const void *__from, size_t __n); | 390 | extern size_t __copy_user(void *__to, const void *__from, size_t __n); |
391 | 391 | ||
392 | #define __invoke_copy_to_user(to,from,n) \ | 392 | #define __invoke_copy_to_user(to, from, n) \ |
393 | ({ \ | 393 | ({ \ |
394 | register void __user *__cu_to_r __asm__ ("$4"); \ | 394 | register void __user *__cu_to_r __asm__("$4"); \ |
395 | register const void *__cu_from_r __asm__ ("$5"); \ | 395 | register const void *__cu_from_r __asm__("$5"); \ |
396 | register long __cu_len_r __asm__ ("$6"); \ | 396 | register long __cu_len_r __asm__("$6"); \ |
397 | \ | 397 | \ |
398 | __cu_to_r = (to); \ | 398 | __cu_to_r = (to); \ |
399 | __cu_from_r = (from); \ | 399 | __cu_from_r = (from); \ |
@@ -421,7 +421,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
421 | * Returns number of bytes that could not be copied. | 421 | * Returns number of bytes that could not be copied. |
422 | * On success, this will be zero. | 422 | * On success, this will be zero. |
423 | */ | 423 | */ |
424 | #define __copy_to_user(to,from,n) \ | 424 | #define __copy_to_user(to, from, n) \ |
425 | ({ \ | 425 | ({ \ |
426 | void __user *__cu_to; \ | 426 | void __user *__cu_to; \ |
427 | const void *__cu_from; \ | 427 | const void *__cu_from; \ |
@@ -437,7 +437,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
437 | 437 | ||
438 | extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n); | 438 | extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n); |
439 | 439 | ||
440 | #define __copy_to_user_inatomic(to,from,n) \ | 440 | #define __copy_to_user_inatomic(to, from, n) \ |
441 | ({ \ | 441 | ({ \ |
442 | void __user *__cu_to; \ | 442 | void __user *__cu_to; \ |
443 | const void *__cu_from; \ | 443 | const void *__cu_from; \ |
@@ -450,7 +450,7 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n); | |||
450 | __cu_len; \ | 450 | __cu_len; \ |
451 | }) | 451 | }) |
452 | 452 | ||
453 | #define __copy_from_user_inatomic(to,from,n) \ | 453 | #define __copy_from_user_inatomic(to, from, n) \ |
454 | ({ \ | 454 | ({ \ |
455 | void *__cu_to; \ | 455 | void *__cu_to; \ |
456 | const void __user *__cu_from; \ | 456 | const void __user *__cu_from; \ |
@@ -477,7 +477,7 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n); | |||
477 | * Returns number of bytes that could not be copied. | 477 | * Returns number of bytes that could not be copied. |
478 | * On success, this will be zero. | 478 | * On success, this will be zero. |
479 | */ | 479 | */ |
480 | #define copy_to_user(to,from,n) \ | 480 | #define copy_to_user(to, from, n) \ |
481 | ({ \ | 481 | ({ \ |
482 | void __user *__cu_to; \ | 482 | void __user *__cu_to; \ |
483 | const void *__cu_from; \ | 483 | const void *__cu_from; \ |
@@ -493,11 +493,11 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n); | |||
493 | __cu_len; \ | 493 | __cu_len; \ |
494 | }) | 494 | }) |
495 | 495 | ||
496 | #define __invoke_copy_from_user(to,from,n) \ | 496 | #define __invoke_copy_from_user(to, from, n) \ |
497 | ({ \ | 497 | ({ \ |
498 | register void *__cu_to_r __asm__ ("$4"); \ | 498 | register void *__cu_to_r __asm__("$4"); \ |
499 | register const void __user *__cu_from_r __asm__ ("$5"); \ | 499 | register const void __user *__cu_from_r __asm__("$5"); \ |
500 | register long __cu_len_r __asm__ ("$6"); \ | 500 | register long __cu_len_r __asm__("$6"); \ |
501 | \ | 501 | \ |
502 | __cu_to_r = (to); \ | 502 | __cu_to_r = (to); \ |
503 | __cu_from_r = (from); \ | 503 | __cu_from_r = (from); \ |
@@ -516,11 +516,11 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n); | |||
516 | __cu_len_r; \ | 516 | __cu_len_r; \ |
517 | }) | 517 | }) |
518 | 518 | ||
519 | #define __invoke_copy_from_user_inatomic(to,from,n) \ | 519 | #define __invoke_copy_from_user_inatomic(to, from, n) \ |
520 | ({ \ | 520 | ({ \ |
521 | register void *__cu_to_r __asm__ ("$4"); \ | 521 | register void *__cu_to_r __asm__("$4"); \ |
522 | register const void __user *__cu_from_r __asm__ ("$5"); \ | 522 | register const void __user *__cu_from_r __asm__("$5"); \ |
523 | register long __cu_len_r __asm__ ("$6"); \ | 523 | register long __cu_len_r __asm__("$6"); \ |
524 | \ | 524 | \ |
525 | __cu_to_r = (to); \ | 525 | __cu_to_r = (to); \ |
526 | __cu_from_r = (from); \ | 526 | __cu_from_r = (from); \ |
@@ -556,7 +556,7 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n); | |||
556 | * If some data could not be copied, this function will pad the copied | 556 | * If some data could not be copied, this function will pad the copied |
557 | * data to the requested size using zero bytes. | 557 | * data to the requested size using zero bytes. |
558 | */ | 558 | */ |
559 | #define __copy_from_user(to,from,n) \ | 559 | #define __copy_from_user(to, from, n) \ |
560 | ({ \ | 560 | ({ \ |
561 | void *__cu_to; \ | 561 | void *__cu_to; \ |
562 | const void __user *__cu_from; \ | 562 | const void __user *__cu_from; \ |
@@ -587,7 +587,7 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n); | |||
587 | * If some data could not be copied, this function will pad the copied | 587 | * If some data could not be copied, this function will pad the copied |
588 | * data to the requested size using zero bytes. | 588 | * data to the requested size using zero bytes. |
589 | */ | 589 | */ |
590 | #define copy_from_user(to,from,n) \ | 590 | #define copy_from_user(to, from, n) \ |
591 | ({ \ | 591 | ({ \ |
592 | void *__cu_to; \ | 592 | void *__cu_to; \ |
593 | const void __user *__cu_from; \ | 593 | const void __user *__cu_from; \ |
@@ -605,7 +605,7 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n); | |||
605 | 605 | ||
606 | #define __copy_in_user(to, from, n) __copy_from_user(to, from, n) | 606 | #define __copy_in_user(to, from, n) __copy_from_user(to, from, n) |
607 | 607 | ||
608 | #define copy_in_user(to,from,n) \ | 608 | #define copy_in_user(to, from, n) \ |
609 | ({ \ | 609 | ({ \ |
610 | void __user *__cu_to; \ | 610 | void __user *__cu_to; \ |
611 | const void __user *__cu_from; \ | 611 | const void __user *__cu_from; \ |