aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/string_64.h4
-rw-r--r--arch/x86/lib/memcpy_64.S7
2 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/include/asm/string_64.h b/arch/x86/include/asm/string_64.h
index ca6ba3607705..90dbbd9666d4 100644
--- a/arch/x86/include/asm/string_64.h
+++ b/arch/x86/include/asm/string_64.h
@@ -87,9 +87,9 @@ int strcmp(const char *cs, const char *ct);
87 * 87 *
88 * Low level memory copy function that catches machine checks 88 * Low level memory copy function that catches machine checks
89 * 89 *
90 * Return true for success, false for fail 90 * Return 0 for success, -EFAULT for fail
91 */ 91 */
92bool memcpy_mcsafe(void *dst, const void *src, size_t cnt); 92int memcpy_mcsafe(void *dst, const void *src, size_t cnt);
93 93
94#endif /* __KERNEL__ */ 94#endif /* __KERNEL__ */
95 95
diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S
index cbb8ee5830ff..2ec0b0abbfaa 100644
--- a/arch/x86/lib/memcpy_64.S
+++ b/arch/x86/lib/memcpy_64.S
@@ -1,6 +1,7 @@
1/* Copyright 2002 Andi Kleen */ 1/* Copyright 2002 Andi Kleen */
2 2
3#include <linux/linkage.h> 3#include <linux/linkage.h>
4#include <asm/errno.h>
4#include <asm/cpufeatures.h> 5#include <asm/cpufeatures.h>
5#include <asm/alternative-asm.h> 6#include <asm/alternative-asm.h>
6 7
@@ -268,16 +269,16 @@ ENTRY(memcpy_mcsafe)
268 decl %ecx 269 decl %ecx
269 jnz .L_copy_trailing_bytes 270 jnz .L_copy_trailing_bytes
270 271
271 /* Copy successful. Return true */ 272 /* Copy successful. Return zero */
272.L_done_memcpy_trap: 273.L_done_memcpy_trap:
273 xorq %rax, %rax 274 xorq %rax, %rax
274 ret 275 ret
275ENDPROC(memcpy_mcsafe) 276ENDPROC(memcpy_mcsafe)
276 277
277 .section .fixup, "ax" 278 .section .fixup, "ax"
278 /* Return false for any failure */ 279 /* Return -EFAULT for any failure */
279.L_memcpy_mcsafe_fail: 280.L_memcpy_mcsafe_fail:
280 mov $1, %rax 281 mov $-EFAULT, %rax
281 ret 282 ret
282 283
283 .previous 284 .previous