mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-06 23:11:18 +12:00
MemMapper: Support alternative pagesizes
This commit is contained in:
parent
4700a19009
commit
3795fc07fd
1 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,12 @@ namespace MemMapper
|
||||||
|
|
||||||
void* AllocateMemory(void* baseAddr, size_t size, PAGE_PERMISSION permissionFlags, bool fromReservation)
|
void* AllocateMemory(void* baseAddr, size_t size, PAGE_PERMISSION permissionFlags, bool fromReservation)
|
||||||
{
|
{
|
||||||
|
uint64 page_size = sysconf(_SC_PAGESIZE);
|
||||||
|
if ((uint64) baseAddr % page_size != 0)
|
||||||
|
{
|
||||||
|
baseAddr = (void*) ((uint64)baseAddr & ~(page_size - 1));
|
||||||
|
}
|
||||||
|
|
||||||
void* r;
|
void* r;
|
||||||
if(fromReservation)
|
if(fromReservation)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue