diff --git a/core/hw/mem/_vmem.cpp b/core/hw/mem/_vmem.cpp index 9a297330c..3fbfdf6b5 100644 --- a/core/hw/mem/_vmem.cpp +++ b/core/hw/mem/_vmem.cpp @@ -478,7 +478,7 @@ bool _vmem_reserve() { {0x00800000, 0x01000000, MAP_ARAM_START_OFFSET, ARAM_SIZE, false}, // Aica, wraps too {0x20000000, 0x20000000+ARAM_SIZE, MAP_ARAM_START_OFFSET, ARAM_SIZE, true}, {0x01000000, 0x04000000, 0, 0, false}, // More unused - {0x04000000, 0x05000000, MAP_VRAM_START_OFFSET, VRAM_SIZE, true}, // Area 1 (vram, 16MB, wrapped on DC) + {0x04000000, 0x05000000, MAP_VRAM_START_OFFSET, VRAM_SIZE, true}, // Area 1 (vram, 16MB, wrapped on DC as 2x8MB) {0x05000000, 0x06000000, 0, 0, false}, // 32 bit path (unused) {0x06000000, 0x07000000, MAP_VRAM_START_OFFSET, VRAM_SIZE, true}, // VRAM mirror {0x07000000, 0x08000000, 0, 0, false}, // 32 bit path (unused) mirror diff --git a/core/linux/posix_vmem.cpp b/core/linux/posix_vmem.cpp index 8fcf57614..3601eef1b 100644 --- a/core/linux/posix_vmem.cpp +++ b/core/linux/posix_vmem.cpp @@ -141,10 +141,11 @@ void vmem_platform_reset_mem(void *ptr, unsigned size_bytes) { mprotect(ptr, size_bytes, PROT_NONE); // Tell the kernel to flush'em all (FIXME: perhaps unmap+mmap 'd be better?) madvise(ptr, size_bytes, MADV_DONTNEED); - #ifdef MADV_REMOVE + #if defined(MADV_REMOVE) madvise(ptr, size_bytes, MADV_REMOVE); - #endif - madvise(ptr, size_bytes, MADV_FREE); + #elif defined(MADV_FREE) + madvise(ptr, size_bytes, MADV_FREE); + #endif } // Allocates a bunch of memory (page aligned and page-sized)