mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-29 14:05:29 +03:00
Handle unmapped ranges in TranslateRange
This commit is contained in:
parent
acfa58ea8c
commit
b310b99bdc
@ -113,6 +113,9 @@ namespace skyline {
|
||||
|
||||
std::pair<span<u8>, size_t> LookupBlockLocked(VaType virt, std::function<void(span<u8>)> cpuAccessCallback = {}) {
|
||||
const auto &blockEntry{this->blockSegmentTable[virt]};
|
||||
if (blockEntry.phys == nullptr)
|
||||
return {span<u8>{}, 0};
|
||||
|
||||
VaType segmentOffset{virt - blockEntry.virt};
|
||||
span<u8> blockSpan{blockEntry.phys, blockEntry.extent};
|
||||
if (cpuAccessCallback)
|
||||
|
@ -248,11 +248,15 @@ namespace skyline {
|
||||
blockPhys = sparseMap;
|
||||
}
|
||||
|
||||
if (predecessor->phys) {
|
||||
span cpuBlock{blockPhys, blockSize};
|
||||
if (cpuAccessCallback)
|
||||
cpuAccessCallback(cpuBlock);
|
||||
|
||||
ranges.push_back(cpuBlock);
|
||||
} else {
|
||||
ranges.push_back(span<u8>{static_cast<u8*>(nullptr), blockSize});
|
||||
}
|
||||
|
||||
size -= blockSize;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user