mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-09 21:51:45 +00:00
kern: fix bug in page table mapping calculations
This commit is contained in:
parent
a4d376cc0f
commit
0af44d2875
1 changed files with 1 additions and 1 deletions
|
@ -645,7 +645,7 @@ namespace ams::kern::arch::arm64 {
|
|||
size_t alignment;
|
||||
for (alignment = ContiguousPageSize; (virt_addr & (alignment - 1)) == (phys_addr & (alignment - 1)); alignment = GetLargerAlignment(alignment)) {
|
||||
/* Check if this would be our last map. */
|
||||
const size_t pages_to_map = (alignment - (virt_addr & (alignment - 1))) & (alignment - 1);
|
||||
const size_t pages_to_map = ((alignment - (virt_addr & (alignment - 1))) & (alignment - 1)) / PageSize;
|
||||
if (pages_to_map + (alignment / PageSize) > remaining_pages) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue