sys_mmapper: Allow 0 alignment to mapping to fix Psl1ght homebrew booting

This commit is contained in:
Jake 2015-12-11 11:08:24 -06:00
parent 6f584049a2
commit 08d05e245d

View File

@ -33,6 +33,14 @@ s32 sys_mmapper_allocate_address(u64 size, u64 flags, u64 alignment, vm::ptr<u32
return CELL_ENOMEM;
}
// This is a 'hack' / workaround for psl1ght, which gives us an alignment of 0, which is technically invalid,
// but apparently is allowed on actual ps3
// https://github.com/ps3dev/PSL1GHT/blob/534e58950732c54dc6a553910b653c99ba6e9edc/ppu/librt/sbrk.c#L71
if (!alignment && size == 0x10000000)
{
alignment = 0x10000000;
}
switch (alignment)
{
case 0x10000000:
@ -317,7 +325,7 @@ s32 sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, vm::ptr<u3
*alloc_addr = addr;
return CELL_ENOMEM;
return CELL_OK;
}
s32 sys_mmapper_unmap_memory(u32 addr, vm::ptr<u32> mem_id)