aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/boot/string.c')
-rw-r--r--arch/x86/boot/string.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 574dedfe2890..5339040ef86e 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -14,6 +14,20 @@
14 14
15#include "boot.h" 15#include "boot.h"
16 16
17/*
18 * This file gets included in compressed/string.c which might pull in
19 * string_32.h and which in turn maps memcmp to __builtin_memcmp(). Undo
20 * that first.
21 */
22#undef memcmp
23int memcmp(const void *s1, const void *s2, size_t len)
24{
25 u8 diff;
26 asm("repe; cmpsb; setnz %0"
27 : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len));
28 return diff;
29}
30
17int strcmp(const char *str1, const char *str2) 31int strcmp(const char *str1, const char *str2)
18{ 32{
19 const unsigned char *s1 = (const unsigned char *)str1; 33 const unsigned char *s1 = (const unsigned char *)str1;