From 6e1a0c4dc569a9635344e42e2f9e973f0b9ab6d5 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 16 Oct 2011 03:21:23 +0300 Subject: psxmem: set fixed flag on mappings that really need it also fix unmap --- libpcsxcore/psxmem.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index f0a8841..498246c 100644 --- a/libpcsxcore/psxmem.c +++ b/libpcsxcore/psxmem.c @@ -69,17 +69,17 @@ int psxMemInit() { memset(psxMemWLUT, 0, 0x10000 * sizeof(void *)); psxM = mmap((void *)0x80000000, 0x00210000, - PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); psxP = &psxM[0x200000]; psxH = mmap((void *)0x1f800000, 0x00010000, - PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); - psxR = mmap((void *)0x9fc00000, 0x80000, + psxR = mmap((void *)0x1fc00000, 0x80000, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (psxMemRLUT == NULL || psxMemWLUT == NULL || - psxM != (void *)0x80000000 || psxR != (void *)0x9fc00000 || + psxM != (void *)0x80000000 || psxR == MAP_FAILED || psxP == NULL || psxH != (void *)0x1f800000) { SysMessage(_("Error allocating memory!")); return -1; @@ -135,7 +135,8 @@ void psxMemReset() { } void psxMemShutdown() { - munmap(psxM, 0x00220000); + munmap(psxM, 0x00210000); + munmap(psxH, 0x1f800000); munmap(psxR, 0x80000); free(psxMemRLUT); -- cgit v1.2.3