Add memory.h with memcpy and memmove declarations

Define memory management functions and include guards.

Adding a home for memory functions memset, memcpy, memcmp, memmove

This is the header
This commit is contained in:
2025-11-02 17:32:53 -08:00
committed by GitHub
parent 9aa1b85ca0
commit 8e5dff4271

25
kernel/memory.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef MEMORY_H
#define MEMORY_H
#include <stddef.h> /* size_t, NULL */
#include <stdint.h> /* uint8_t */
#ifdef __cplusplus
extern "C" {
#endif
/* C11 / POSIX-2004 signatures */
void *memcpy(void *restrict dst, const void *restrict src, size_t n);
void *memmove(void *dst, const void *src, size_t n);
/*int memcmp(const void *s1, const void *s2, size_t n); */
/* Optional fast-path using 32-bit loads (x86 only) */
#if defined(__i386__) && !defined(MEMORY_NO_OPT)
# define MEMORY_OPTIMIZED 1
#endif
#ifdef __cplusplus
}
#endif
#endif /* MEMORY_H */