From 0069615fdda3a28da547a191bef990256620ff69 Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 2 Apr 2013 01:29:57 +0300 Subject: avoid MAP_FIXED, log mappings MAP_FIXED overrides existing mappings, we don't want that --- libpcsxcore/psxmem.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libpcsxcore/psxmem.c') diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index 62bbe26..4da0cf4 100644 --- a/libpcsxcore/psxmem.c +++ b/libpcsxcore/psxmem.c @@ -52,8 +52,9 @@ retry: goto out; } - if (is_fixed) - flags |= MAP_FIXED; + /* avoid MAP_FIXED, it overrides existing mappings.. */ + /* if (is_fixed) + flags |= MAP_FIXED; */ req = (void *)addr; ret = mmap(req, size, PROT_READ | PROT_WRITE, flags, -1, 0); @@ -65,6 +66,11 @@ out: SysMessage("psxMap: warning: wanted to map @%08x, got %p\n", addr, ret); + if (is_fixed) { + psxUnmap(ret, size, tag); + return NULL; + } + if (ret != NULL && ((addr ^ (long)ret) & 0x00ffffff) && !tried_to_align) { -- cgit v1.2.3