--- zzzz-none-000/linux-5.4.213/arch/mips/include/asm/string.h 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/arch/mips/include/asm/string.h 2024-08-14 09:01:30.000000000 +0000 @@ -19,4 +19,42 @@ #define __HAVE_ARCH_MEMMOVE extern void *memmove(void *__dest, __const__ void *__src, size_t __n); +#ifndef __ZBOOT__ +#define memset(__s, __c, len) \ +({ \ + size_t __len = (len); \ + void *__ret; \ + if (__builtin_constant_p(len) && __len >= 64) \ + __ret = memset((__s), (__c), __len); \ + else \ + __ret = __builtin_memset((__s), (__c), __len); \ + __ret; \ +}) + +#define memcpy(dst, src, len) \ +({ \ + size_t __len = (len); \ + void *__ret; \ + if (__builtin_constant_p(len) && __len >= 64) \ + __ret = memcpy((dst), (src), __len); \ + else \ + __ret = __builtin_memcpy((dst), (src), __len); \ + __ret; \ +}) + +#define memmove(dst, src, len) \ +({ \ + size_t __len = (len); \ + void *__ret; \ + if (__builtin_constant_p(len) && __len >= 64) \ + __ret = memmove((dst), (src), __len); \ + else \ + __ret = __builtin_memmove((dst), (src), __len); \ + __ret; \ +}) + +#define __HAVE_ARCH_MEMCMP +#define memcmp(src1, src2, len) __builtin_memcmp((src1), (src2), (len)) +#endif + #endif /* _ASM_STRING_H */