5 #define PAGE_SIZE (16 * 1024)
7 #define PROT_CPU_READ 1
8 #define PROT_CPU_WRITE 2
9 #define PROT_CPU_EXEC 4
10 #define PROT_GPU_EXEC 8
11 #define PROT_GPU_READ 16
12 #define PROT_GPU_WRITE 32
15 #define PROT_READ PROT_CPU_READ
16 #define PROT_WRITE PROT_CPU_WRITE
17 #define PROT_EXEC PROT_CPU_EXEC
22 #define MAP_FIXED 0x10
23 #define MAP_ANONYMOUS 0x1000
24 #define MAP_32BIT 0x80000
26 #define MAP_FAILED (void *)-1
28 #define MS_SYNC 0x0000
29 #define MS_ASYNC 0x0001
30 #define MS_INVALIDATE 0x0002
32 struct memoryRegionInfo
{
35 unsigned int flags
; // 0x16
38 struct otherMemoryRegionInfo
{
41 char unknown
[0xa]; // 0x16
42 char name
[32]; // 0x20
45 void *mmap(void *addr
, size_t len
, int prot
, int flags
, int fd
, off_t offset
);
46 int munmap(void *addr
, size_t len
);
47 int mprotect(void *addr
, size_t len
, int prot
);
48 int msync(void *addr
, size_t len
, int flags
);
49 int mlock(void *addr
, size_t len
);
50 int munlock(void *addr
, size_t len
);
52 int getMemoryInfo(void *address
, struct memoryRegionInfo
*destination
);
53 int getOtherMemoryInfo(void *address
, int nextMatchIfUnmapped
, struct otherMemoryRegionInfo
*destination
);