Set the write permission according to the flag when allocating host cpu mem

Change-Id: I758c2b5b1799e968fa852646e1494fabb68c782d
Signed-off-by: Yong Zhao <yong.zhao@amd.com>


[ROCm/ROCR-Runtime commit: 4839882fc8]
This commit is contained in:
Yong Zhao
2018-07-03 20:36:44 -04:00
rodzic 7fc9f24d21
commit fff19d25ea
+4 -1
Wyświetl plik
@@ -1121,11 +1121,14 @@ static void *fmm_allocate_host_cpu(uint64_t MemorySizeInBytes,
{
void *mem = NULL;
vm_object_t *vm_obj;
int mmap_prot = PROT_READ | PROT_WRITE;
int mmap_prot = PROT_READ;
if (flags.ui32.ExecuteAccess)
mmap_prot |= PROT_EXEC;
if (!flags.ui32.ReadOnly)
mmap_prot |= PROT_WRITE;
/* mmap will return a pointer with alignment equal to
* sysconf(_SC_PAGESIZE).
*/