Now About Social Code
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/drv.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/drv.c b/src/drv.c
index 9733ac3..e5737e8 100644
--- a/src/drv.c
+++ b/src/drv.c
@@ -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);
}