mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 14:45:07 +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 = {}) {
|
||||
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;
|
||||
}
|
||||
|
||||
span cpuBlock{blockPhys, blockSize};
|
||||
if (cpuAccessCallback)
|
||||
cpuAccessCallback(cpuBlock);
|
||||
if (predecessor->phys) {
|
||||
span cpuBlock{blockPhys, blockSize};
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user