7 int (*sceKernelJitCreateSharedMemory
)(int flags
, size_t size
, int protection
, int *destinationHandle
);
8 int (*sceKernelJitCreateAliasOfSharedMemory
)(int handle
, int protection
, int *destinationHandle
);
9 int (*sceKernelJitMapSharedMemory
)(int handle
, int protection
, void **destination
);
12 RESOLVE(libKernelHandle
, sceKernelJitCreateSharedMemory
);
13 RESOLVE(libKernelHandle
, sceKernelJitCreateAliasOfSharedMemory
);
14 RESOLVE(libKernelHandle
, sceKernelJitMapSharedMemory
);
17 void allocateJIT(size_t size
, void **executableAddress
, void **writableAddress
) {
21 sceKernelJitCreateSharedMemory(0, size
, PROT_CPU_READ
| PROT_CPU_WRITE
| PROT_CPU_EXEC
, &executableHandle
);
22 sceKernelJitCreateAliasOfSharedMemory(executableHandle
, PROT_CPU_READ
| PROT_CPU_WRITE
, &writableHandle
);
24 *executableAddress
= mmap(NULL
, size
, PROT_CPU_READ
| PROT_CPU_EXEC
, MAP_SHARED
, executableHandle
, 0);
26 //sceKernelJitMapSharedMemory(writableHandle, PROT_CPU_READ | PROT_CPU_WRITE, writableAddress);
27 *writableAddress
= mmap(NULL
, size
, PROT_CPU_READ
| PROT_CPU_WRITE
, MAP_PRIVATE
| MAP_TYPE
, writableHandle
, 0);