diff options
Diffstat (limited to 'src/drv.c')
-rw-r--r-- | src/drv.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -337,13 +337,12 @@ static struct mem_alloc allocate_memobj(struct driver_state *state, PVRSRV_BRIDG PPRINT(stdout, &out2, PVRSRV_BRIDGE_OUT_MHANDLE_TO_MMAP_DATA); - printf("Attempting map 0x%x, 0x%x\n", out2.uiRealByteSize, out2.uiMMapOffset); - //mem.data = mmap2(NULL, out2.uiRealByteSize, PROT_READ|PROT_WRITE, - // MAP_SHARED, state->fd, out2.uiMMapOffset); - mem.data = syscall(SYS_mmap2, NULL, out2.uiRealByteSize, - PROT_READ | PROT_WRITE, MAP_SHARED, - state->fd, out2.uiRealByteSize); + printf("Attempting map 0x%x, 0x%x\n", (uint32_t)out2.uiRealByteSize, (uint32_t)out2.uiMMapOffset); + mem.data = (void*)(uintptr_t)syscall(SYS_mmap2, NULL, out2.uiRealByteSize, + PROT_READ | PROT_WRITE, MAP_SHARED, + state->fd, out2.uiMMapOffset); + mem.data += out2.uiByteOffset; assert(mem.data != MAP_FAILED); memset(mem.data, 0x00, out.sClientMemInfo.uAllocSize); } |