mirror of
https://github.com/citra-mirror/citra.git
synced 2024-08-20 10:23:23 +02:00
Merge pull request #1463 from yuriks/non-app-region
Memory: Do correct Phys->Virt address translation for non-APP linheap
This commit is contained in:
commit
2d40891b45
@ -130,9 +130,11 @@ void Process::Run(s32 main_thread_priority, u32 stack_size) {
|
|||||||
Kernel::SetupMainThread(codeset->entrypoint, main_thread_priority);
|
Kernel::SetupMainThread(codeset->entrypoint, main_thread_priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VAddr Process::GetLinearHeapAreaAddress() const {
|
||||||
|
return kernel_version < 0x22C ? Memory::LINEAR_HEAP_VADDR : Memory::NEW_LINEAR_HEAP_VADDR;
|
||||||
|
}
|
||||||
VAddr Process::GetLinearHeapBase() const {
|
VAddr Process::GetLinearHeapBase() const {
|
||||||
return (kernel_version < 0x22C ? Memory::LINEAR_HEAP_VADDR : Memory::NEW_LINEAR_HEAP_VADDR)
|
return GetLinearHeapAreaAddress() + memory_region->base;
|
||||||
+ memory_region->base;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VAddr Process::GetLinearHeapLimit() const {
|
VAddr Process::GetLinearHeapLimit() const {
|
||||||
|
@ -143,6 +143,7 @@ public:
|
|||||||
/// Bitmask of the used TLS slots
|
/// Bitmask of the used TLS slots
|
||||||
std::bitset<300> used_tls_slots;
|
std::bitset<300> used_tls_slots;
|
||||||
|
|
||||||
|
VAddr GetLinearHeapAreaAddress() const;
|
||||||
VAddr GetLinearHeapBase() const;
|
VAddr GetLinearHeapBase() const;
|
||||||
VAddr GetLinearHeapLimit() const;
|
VAddr GetLinearHeapLimit() const;
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ VAddr PhysicalToVirtualAddress(const PAddr addr) {
|
|||||||
} else if (addr >= VRAM_PADDR && addr < VRAM_PADDR_END) {
|
} else if (addr >= VRAM_PADDR && addr < VRAM_PADDR_END) {
|
||||||
return addr - VRAM_PADDR + VRAM_VADDR;
|
return addr - VRAM_PADDR + VRAM_VADDR;
|
||||||
} else if (addr >= FCRAM_PADDR && addr < FCRAM_PADDR_END) {
|
} else if (addr >= FCRAM_PADDR && addr < FCRAM_PADDR_END) {
|
||||||
return addr - FCRAM_PADDR + Kernel::g_current_process->GetLinearHeapBase();
|
return addr - FCRAM_PADDR + Kernel::g_current_process->GetLinearHeapAreaAddress();
|
||||||
} else if (addr >= DSP_RAM_PADDR && addr < DSP_RAM_PADDR_END) {
|
} else if (addr >= DSP_RAM_PADDR && addr < DSP_RAM_PADDR_END) {
|
||||||
return addr - DSP_RAM_PADDR + DSP_RAM_VADDR;
|
return addr - DSP_RAM_PADDR + DSP_RAM_VADDR;
|
||||||
} else if (addr >= IO_AREA_PADDR && addr < IO_AREA_PADDR_END) {
|
} else if (addr >= IO_AREA_PADDR && addr < IO_AREA_PADDR_END) {
|
||||||
|
Loading…
Reference in New Issue
Block a user