Make memsync() work on Apple arm64.

This commit is contained in:
Eric Warmenhoven 2024-02-23 15:20:11 -05:00 committed by m4xw
parent fce57fdfb7
commit b0c348ea55

View file

@ -131,14 +131,14 @@ int mprotect(void *addr, size_t len, int prot)
#endif
#if defined(__MACH__) && defined(__arm__)
#if defined(__MACH__) && (defined(__arm__) || defined(__arm64__))
#include <libkern/OSCacheControl.h>
#endif
int memsync(void *start, void *end)
{
size_t len = (char*)end - (char*)start;
#if defined(__MACH__) && defined(__arm__)
#if defined(__MACH__) && (defined(__arm__) || defined(__arm64__))
sys_dcache_flush(start ,len);
sys_icache_invalidate(start, len);
return 0;