From: notaz Date: Sat, 12 Feb 2011 21:50:10 +0000 (+0200) Subject: loader: try large mmap first X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5853ddbd8b9c254176434df8df2350f926f99c2d;p=ginge.git loader: try large mmap first will need to check if this doesn't break Wiz --- 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");