mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 20:11:49 +01: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 = {}) {
|
std::pair<span<u8>, size_t> LookupBlockLocked(VaType virt, std::function<void(span<u8>)> cpuAccessCallback = {}) {
|
||||||
const auto &blockEntry{this->blockSegmentTable[virt]};
|
const auto &blockEntry{this->blockSegmentTable[virt]};
|
||||||
|
if (blockEntry.phys == nullptr)
|
||||||
|
return {span<u8>{}, 0};
|
||||||
|
|
||||||
VaType segmentOffset{virt - blockEntry.virt};
|
VaType segmentOffset{virt - blockEntry.virt};
|
||||||
span<u8> blockSpan{blockEntry.phys, blockEntry.extent};
|
span<u8> blockSpan{blockEntry.phys, blockEntry.extent};
|
||||||
if (cpuAccessCallback)
|
if (cpuAccessCallback)
|
||||||
|
@ -248,11 +248,15 @@ namespace skyline {
|
|||||||
blockPhys = sparseMap;
|
blockPhys = sparseMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
span cpuBlock{blockPhys, blockSize};
|
if (predecessor->phys) {
|
||||||
if (cpuAccessCallback)
|
span cpuBlock{blockPhys, blockSize};
|
||||||
cpuAccessCallback(cpuBlock);
|
if (cpuAccessCallback)
|
||||||
|
cpuAccessCallback(cpuBlock);
|
||||||
|
|
||||||
ranges.push_back(cpuBlock);
|
ranges.push_back(cpuBlock);
|
||||||
|
} else {
|
||||||
|
ranges.push_back(span<u8>{static_cast<u8*>(nullptr), blockSize});
|
||||||
|
}
|
||||||
|
|
||||||
size -= blockSize;
|
size -= blockSize;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user