11 #define PROT_READ 0b001
12 #define PROT_WRITE 0b010
13 #define PROT_EXEC 0b100
15 #define MAP_ANONYMOUS 0x20
17 #define MAP_FAILED ((void *)-1)
19 static inline void* mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
28 block = sceKernelAllocMemBlockForVM("code", len);
30 sceClibPrintf("could not alloc mem block @0x%08X 0x%08X \n", block, len);
35 ret = sceKernelGetMemBlockBase(block, &addr);
38 sceClibPrintf("could get address @0x%08X 0x%08X \n", block, addr);
49 static inline int mprotect(void *addr, size_t len, int prot)
57 static inline int munmap(void *addr, size_t len)
59 int uid = sceKernelFindMemBlockByAddr(addr, len);
61 return sceKernelFreeMemBlock(uid);