Go to the documentation of this file.
33 #define AK_VM_PAGE_SIZE (16*1024)
34 #define AK_VM_HUGE_PAGE_SIZE (2*1024*1024)
35 #define AK_VM_DEVICE_PAGE_SIZE (16*1024)
40 const int kMemoryFlags = SCE_KERNEL_PROT_CPU_RW | SCE_KERNEL_PROT_GPU_RW | SCE_KERNEL_PROT_AMPR_ALL;
41 const int kDeviceMemoryFlags = SCE_KERNEL_PROT_CPU_RW | SCE_KERNEL_PROT_GPU_RW | SCE_KERNEL_PROT_AMPR_ALL | SCE_KERNEL_PROT_ACP_RW;
46 off_t directMemStart = 0;
52 err = sceKernelAllocateMainDirectMemory(uRoundedSize, alignment, SCE_KERNEL_MTYPE_C_SHARED, &directMemStart);
60 *out_userData = (size_t)directMemStart;
69 int32_t err = sceKernelReleaseDirectMemory((off_t)in_userData, uRoundedSize);
81 FreeSpan(address, size, in_userData);
91 SceKernelVirtualQueryInfo vqInfo;
92 int err = sceKernelVirtualQuery(address, SCE_KERNEL_VQ_FIND_NEXT, &vqInfo,
sizeof(vqInfo));
97 if ((vqInfo.protection & expectedProt) != expectedProt)
103 address = vqInfo.end;
AkForceInline void FreeDeviceSpan(void *address, size_t size, size_t in_userData)
Platform-dependent helpers.
AkForceInline void * AllocDeviceSpan(size_t size, size_t *out_userData)
AkForceInline bool CheckMemoryProtection(void *address, size_t size, int expectedProt)
uintptr_t AkUIntPtr
Integer (unsigned) type for pointers.
#define AKASSERT(Condition)
AkForceInline void FreeSpan(void *address, size_t size, size_t in_userData)
const int kDeviceMemoryFlags
uint32_t AkUInt32
Unsigned 32-bit integer.
AkForceInline void * AllocSpan(size_t size, size_t *out_userData)
Tell us about your project. We're here to help.
Register your project and we'll help you get started with no strings attached!
Get started with Wwise