mirror of
https://github.com/gbowne1/ClassicOS.git
synced 2025-11-16 22:35:26 -08:00
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:
25
kernel/memory.h
Normal file
25
kernel/memory.h
Normal 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 */
|
||||||
Reference in New Issue
Block a user