diff options
Diffstat (limited to 'arch/mips/include/asm/uaccess.h')
-rw-r--r-- | arch/mips/include/asm/uaccess.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h index a10951090234..22a5624e2fd2 100644 --- a/arch/mips/include/asm/uaccess.h +++ b/arch/mips/include/asm/uaccess.h | |||
@@ -301,7 +301,8 @@ do { \ | |||
301 | __get_kernel_common((x), size, __gu_ptr); \ | 301 | __get_kernel_common((x), size, __gu_ptr); \ |
302 | else \ | 302 | else \ |
303 | __get_user_common((x), size, __gu_ptr); \ | 303 | __get_user_common((x), size, __gu_ptr); \ |
304 | } \ | 304 | } else \ |
305 | (x) = 0; \ | ||
305 | \ | 306 | \ |
306 | __gu_err; \ | 307 | __gu_err; \ |
307 | }) | 308 | }) |
@@ -316,6 +317,7 @@ do { \ | |||
316 | " .insn \n" \ | 317 | " .insn \n" \ |
317 | " .section .fixup,\"ax\" \n" \ | 318 | " .section .fixup,\"ax\" \n" \ |
318 | "3: li %0, %4 \n" \ | 319 | "3: li %0, %4 \n" \ |
320 | " move %1, $0 \n" \ | ||
319 | " j 2b \n" \ | 321 | " j 2b \n" \ |
320 | " .previous \n" \ | 322 | " .previous \n" \ |
321 | " .section __ex_table,\"a\" \n" \ | 323 | " .section __ex_table,\"a\" \n" \ |
@@ -630,6 +632,7 @@ do { \ | |||
630 | " .insn \n" \ | 632 | " .insn \n" \ |
631 | " .section .fixup,\"ax\" \n" \ | 633 | " .section .fixup,\"ax\" \n" \ |
632 | "3: li %0, %4 \n" \ | 634 | "3: li %0, %4 \n" \ |
635 | " move %1, $0 \n" \ | ||
633 | " j 2b \n" \ | 636 | " j 2b \n" \ |
634 | " .previous \n" \ | 637 | " .previous \n" \ |
635 | " .section __ex_table,\"a\" \n" \ | 638 | " .section __ex_table,\"a\" \n" \ |
@@ -773,10 +776,11 @@ extern void __put_user_unaligned_unknown(void); | |||
773 | "jal\t" #destination "\n\t" | 776 | "jal\t" #destination "\n\t" |
774 | #endif | 777 | #endif |
775 | 778 | ||
776 | #ifndef CONFIG_CPU_DADDI_WORKAROUNDS | 779 | #if defined(CONFIG_CPU_DADDI_WORKAROUNDS) || (defined(CONFIG_EVA) && \ |
777 | #define DADDI_SCRATCH "$0" | 780 | defined(CONFIG_CPU_HAS_PREFETCH)) |
778 | #else | ||
779 | #define DADDI_SCRATCH "$3" | 781 | #define DADDI_SCRATCH "$3" |
782 | #else | ||
783 | #define DADDI_SCRATCH "$0" | ||
780 | #endif | 784 | #endif |
781 | 785 | ||
782 | extern size_t __copy_user(void *__to, const void *__from, size_t __n); | 786 | extern size_t __copy_user(void *__to, const void *__from, size_t __n); |
@@ -1418,7 +1422,7 @@ static inline long __strnlen_user(const char __user *s, long n) | |||
1418 | } | 1422 | } |
1419 | 1423 | ||
1420 | /* | 1424 | /* |
1421 | * strlen_user: - Get the size of a string in user space. | 1425 | * strnlen_user: - Get the size of a string in user space. |
1422 | * @str: The string to measure. | 1426 | * @str: The string to measure. |
1423 | * | 1427 | * |
1424 | * Context: User context only. This function may sleep. | 1428 | * Context: User context only. This function may sleep. |
@@ -1427,9 +1431,7 @@ static inline long __strnlen_user(const char __user *s, long n) | |||
1427 | * | 1431 | * |
1428 | * Returns the size of the string INCLUDING the terminating NUL. | 1432 | * Returns the size of the string INCLUDING the terminating NUL. |
1429 | * On exception, returns 0. | 1433 | * On exception, returns 0. |
1430 | * | 1434 | * If the string is too long, returns a value greater than @n. |
1431 | * If there is a limit on the length of a valid string, you may wish to | ||
1432 | * consider using strnlen_user() instead. | ||
1433 | */ | 1435 | */ |
1434 | static inline long strnlen_user(const char __user *s, long n) | 1436 | static inline long strnlen_user(const char __user *s, long n) |
1435 | { | 1437 | { |