From: notaz Date: Sun, 16 Oct 2011 00:21:23 +0000 (+0300) Subject: psxmem: set fixed flag on mappings that really need it X-Git-Tag: r11~50 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e1a0c4dc569a9635344e42e2f9e973f0b9ab6d5;p=pcsx_rearmed.git psxmem: set fixed flag on mappings that really need it also fix unmap --- diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index f0a88419..498246cf 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);