Update libc.h
[ps4-sdk.git] / libPS4 / include / memory.h
blob6d97a17a08f9e2d3ea7ea511c8caf6a7ca81922d
1 #pragma once
3 #include "types.h"
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
14 #define PROT_NONE 0
15 #define PROT_READ PROT_CPU_READ
16 #define PROT_WRITE PROT_CPU_WRITE
17 #define PROT_EXEC PROT_CPU_EXEC
19 #define MAP_SHARED 1
20 #define MAP_PRIVATE 2
21 #define MAP_TYPE 0xf
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 {
33 void *base; // 0x0
34 void *end; // 0x8
35 unsigned int flags; // 0x16
38 struct otherMemoryRegionInfo {
39 void *base; // 0x0
40 void *end; // 0x8
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);