boot: Add mempcpy

This commit is contained in:
Jan Janssen
2022-09-07 12:51:10 +02:00
parent 2c3794f422
commit aa23f91ed6
+7
View File
@@ -112,6 +112,13 @@ bool parse_number16(const char16_t *s, uint64_t *ret_u, const char16_t **ret_tai
# define memcmp __builtin_memcmp
# define memcpy __builtin_memcpy
# define memset __builtin_memset
static inline void *mempcpy(void * restrict dest, const void * restrict src, size_t n) {
if (!dest || !src || n == 0)
return dest;
memcpy(dest, src, n);
return (uint8_t *) dest + n;
}
#endif
/* The actual implementations of builtins with efi_ prefix so we can unit test them. */