xref: /openbmc/linux/arch/x86/boot/string.h (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2c041b5adSVivek Goyal #ifndef BOOT_STRING_H
3c041b5adSVivek Goyal #define BOOT_STRING_H
4c041b5adSVivek Goyal 
5c041b5adSVivek Goyal /* Undef any of these macros coming from string_32.h. */
6c041b5adSVivek Goyal #undef memcpy
7c041b5adSVivek Goyal #undef memset
8c041b5adSVivek Goyal #undef memcmp
9c041b5adSVivek Goyal 
10c041b5adSVivek Goyal void *memcpy(void *dst, const void *src, size_t len);
11*bc7aaf52SKees Cook void *memmove(void *dst, const void *src, size_t len);
12c041b5adSVivek Goyal void *memset(void *dst, int c, size_t len);
13fb4cac57SVivek Goyal int memcmp(const void *s1, const void *s2, size_t len);
14*bc7aaf52SKees Cook int bcmp(const void *s1, const void *s2, size_t len);
15c041b5adSVivek Goyal 
16394b19d6SArvind Sankar /* Access builtin version by default. */
17c041b5adSVivek Goyal #define memcpy(d,s,l) __builtin_memcpy(d,s,l)
18c041b5adSVivek Goyal #define memset(d,c,l) __builtin_memset(d,c,l)
19fb4cac57SVivek Goyal #define memcmp	__builtin_memcmp
20c041b5adSVivek Goyal 
21fac69d0eSNicholas Mc Guire extern int strcmp(const char *str1, const char *str2);
22fac69d0eSNicholas Mc Guire extern int strncmp(const char *cs, const char *ct, size_t count);
23fac69d0eSNicholas Mc Guire extern size_t strlen(const char *s);
24fac69d0eSNicholas Mc Guire extern char *strstr(const char *s1, const char *s2);
256ec829a9STommy Nguyen extern char *strchr(const char *s, int c);
26fac69d0eSNicholas Mc Guire extern size_t strnlen(const char *s, size_t maxlen);
27fac69d0eSNicholas Mc Guire extern unsigned int atou(const char *s);
28fac69d0eSNicholas Mc Guire extern unsigned long long simple_strtoull(const char *cp, char **endp,
29fac69d0eSNicholas Mc Guire 					  unsigned int base);
30*bc7aaf52SKees Cook long simple_strtol(const char *cp, char **endp, unsigned int base);
31fac69d0eSNicholas Mc Guire 
32de50ce20SChao Fan int kstrtoull(const char *s, unsigned int base, unsigned long long *res);
335fafbebcSVamshi K Sthambamkadi int boot_kstrtoul(const char *s, unsigned int base, unsigned long *res);
34c041b5adSVivek Goyal #endif /* BOOT_STRING_H */
35