Move solution and projects to src
This commit is contained in:
parent
cd124bda58
commit
cee7121058
3466 changed files with 55 additions and 55 deletions
13
src/ARMeilleure/Native/JitSupportDarwin.cs
Normal file
13
src/ARMeilleure/Native/JitSupportDarwin.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace ARMeilleure.Native
|
||||
{
|
||||
[SupportedOSPlatform("macos")]
|
||||
public static partial class JitSupportDarwin
|
||||
{
|
||||
[LibraryImport("libarmeilleure-jitsupport", EntryPoint = "armeilleure_jit_memcpy")]
|
||||
public static partial void Copy(IntPtr dst, IntPtr src, ulong n);
|
||||
}
|
||||
}
|
BIN
src/ARMeilleure/Native/libs/libarmeilleure-jitsupport.dylib
Normal file
BIN
src/ARMeilleure/Native/libs/libarmeilleure-jitsupport.dylib
Normal file
Binary file not shown.
8
src/ARMeilleure/Native/macos_jit_support/Makefile
Normal file
8
src/ARMeilleure/Native/macos_jit_support/Makefile
Normal file
|
@ -0,0 +1,8 @@
|
|||
NAME = libarmeilleure-jitsupport.dylib
|
||||
|
||||
all: ${NAME}
|
||||
|
||||
${NAME}:
|
||||
clang -O3 -dynamiclib support.c -o ${NAME}
|
||||
clean:
|
||||
rm -f ${NAME}
|
14
src/ARMeilleure/Native/macos_jit_support/support.c
Normal file
14
src/ARMeilleure/Native/macos_jit_support/support.c
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <libkern/OSCacheControl.h>
|
||||
|
||||
void armeilleure_jit_memcpy(void *dst, const void *src, size_t n) {
|
||||
pthread_jit_write_protect_np(0);
|
||||
memcpy(dst, src, n);
|
||||
pthread_jit_write_protect_np(1);
|
||||
|
||||
// Ensure that the instruction cache for this range is invalidated.
|
||||
sys_icache_invalidate(dst, n);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue