mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-10-26 16:29:37 -04:00
Fixed plat_mmap regression - Win32 now uses the same plat_mmap
codepath
This commit is contained in:
parent
6f1133bce1
commit
e4455c2342
1 changed files with 0 additions and 14 deletions
|
|
@ -169,19 +169,6 @@ static void munmap(void *addr, size_t length)
|
||||||
#endif
|
#endif
|
||||||
void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed)
|
void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
|
||||||
int flags = 0;
|
|
||||||
void *ret = mmap((void*)addr,size,PROT_READ | PROT_WRITE, flags, -1, 0);
|
|
||||||
if (addr != 0 && ret != (void *)addr) {
|
|
||||||
lprintf("warning: wanted to map @%08lx, got %p\n",
|
|
||||||
addr, ret);
|
|
||||||
|
|
||||||
if (is_fixed) {
|
|
||||||
munmap(ret, size);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
int flags = MAP_PRIVATE | MAP_ANONYMOUS;
|
int flags = MAP_PRIVATE | MAP_ANONYMOUS;
|
||||||
void *req, *ret;
|
void *req, *ret;
|
||||||
|
|
||||||
|
|
@ -201,7 +188,6 @@ void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue