Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix memory mapping alignment #4672

Merged
merged 1 commit into from
May 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion rpcs3/Emu/Cell/lv2/sys_mmapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,14 @@ error_code sys_mmapper_map_shared_memory(u32 addr, u32 mem_id, u64 flags)

const auto mem = idm::get<lv2_obj, lv2_memory>(mem_id, [&](lv2_memory& mem) -> CellError
{
if (addr % mem.align)
const u32 page_alignment = area->flags & SYS_MEMORY_PAGE_SIZE_1M ? 0x100000 : 0x10000;

if (mem.align < page_alignment)
{
return CELL_EINVAL;
}

if (addr % page_alignment)
{
return CELL_EALIGN;
}
Expand Down