From 5853ddbd8b9c254176434df8df2350f926f99c2d Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 12 Feb 2011 23:50:10 +0200 Subject: [PATCH] loader: try large mmap first will need to check if this doesn't break Wiz --- loader/emu.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/loader/emu.c b/loader/emu.c index 2c64aa6..11be5ba 100644 --- a/loader/emu.c +++ b/loader/emu.c @@ -961,13 +961,15 @@ void emu_init(void *map_bottom) exit(1); } -#ifdef WIZ - // we are short on memmory on Wiz, need special handling - extern void *host_mmap_upper(void); - mmsp2.umem = host_mmap_upper(); -#else + // TODO: check if this really fails on Wiz.. mmsp2.umem = mmap(NULL, 0x2000000, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); +#ifdef WIZ + if (mmsp2.umem == MAP_FAILED) { + // we are short on memmory on Wiz, need special handling + extern void *host_mmap_upper(void); + mmsp2.umem = host_mmap_upper(); + } #endif if (mmsp2.umem == MAP_FAILED) { perror(PFX "mmap upper mem"); -- 2.39.5