diff options
| author | 2023-07-22 11:17:36 -0400 | |
|---|---|---|
| committer | 2023-07-22 11:17:36 -0400 | |
| commit | b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f (patch) | |
| tree | 14f41563aac7e5513bad341805afb164f1bf2f4f /src/core/memory.cpp | |
| parent | Merge pull request #11098 from GPUCode/texel-buffers (diff) | |
| parent | kernel: reduce page table region checking (diff) | |
| download | yuzu-b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f.tar.gz yuzu-b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f.tar.xz yuzu-b1aed2c5b79dc8c3ba858e21308312a5dc10dd2f.zip | |
Merge pull request #11094 from liamwhite/get
kernel: misc cleanup of page table accessors
Diffstat (limited to 'src/core/memory.cpp')
| -rw-r--r-- | src/core/memory.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 805963178..e1fbe8e00 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp | |||
| @@ -31,10 +31,10 @@ struct Memory::Impl { | |||
| 31 | explicit Impl(Core::System& system_) : system{system_} {} | 31 | explicit Impl(Core::System& system_) : system{system_} {} |
| 32 | 32 | ||
| 33 | void SetCurrentPageTable(Kernel::KProcess& process, u32 core_id) { | 33 | void SetCurrentPageTable(Kernel::KProcess& process, u32 core_id) { |
| 34 | current_page_table = &process.PageTable().PageTableImpl(); | 34 | current_page_table = &process.GetPageTable().PageTableImpl(); |
| 35 | current_page_table->fastmem_arena = system.DeviceMemory().buffer.VirtualBasePointer(); | 35 | current_page_table->fastmem_arena = system.DeviceMemory().buffer.VirtualBasePointer(); |
| 36 | 36 | ||
| 37 | const std::size_t address_space_width = process.PageTable().GetAddressSpaceWidth(); | 37 | const std::size_t address_space_width = process.GetPageTable().GetAddressSpaceWidth(); |
| 38 | 38 | ||
| 39 | system.ArmInterface(core_id).PageTableChanged(*current_page_table, address_space_width); | 39 | system.ArmInterface(core_id).PageTableChanged(*current_page_table, address_space_width); |
| 40 | } | 40 | } |
| @@ -186,7 +186,7 @@ struct Memory::Impl { | |||
| 186 | void WalkBlock(const Kernel::KProcess& process, const Common::ProcessAddress addr, | 186 | void WalkBlock(const Kernel::KProcess& process, const Common::ProcessAddress addr, |
| 187 | const std::size_t size, auto on_unmapped, auto on_memory, auto on_rasterizer, | 187 | const std::size_t size, auto on_unmapped, auto on_memory, auto on_rasterizer, |
| 188 | auto increment) { | 188 | auto increment) { |
| 189 | const auto& page_table = process.PageTable().PageTableImpl(); | 189 | const auto& page_table = process.GetPageTable().PageTableImpl(); |
| 190 | std::size_t remaining_size = size; | 190 | std::size_t remaining_size = size; |
| 191 | std::size_t page_index = addr >> YUZU_PAGEBITS; | 191 | std::size_t page_index = addr >> YUZU_PAGEBITS; |
| 192 | std::size_t page_offset = addr & YUZU_PAGEMASK; | 192 | std::size_t page_offset = addr & YUZU_PAGEMASK; |
| @@ -808,7 +808,7 @@ void Memory::UnmapRegion(Common::PageTable& page_table, Common::ProcessAddress b | |||
| 808 | 808 | ||
| 809 | bool Memory::IsValidVirtualAddress(const Common::ProcessAddress vaddr) const { | 809 | bool Memory::IsValidVirtualAddress(const Common::ProcessAddress vaddr) const { |
| 810 | const Kernel::KProcess& process = *system.ApplicationProcess(); | 810 | const Kernel::KProcess& process = *system.ApplicationProcess(); |
| 811 | const auto& page_table = process.PageTable().PageTableImpl(); | 811 | const auto& page_table = process.GetPageTable().PageTableImpl(); |
| 812 | const size_t page = vaddr >> YUZU_PAGEBITS; | 812 | const size_t page = vaddr >> YUZU_PAGEBITS; |
| 813 | if (page >= page_table.pointers.size()) { | 813 | if (page >= page_table.pointers.size()) { |
| 814 | return false; | 814 | return false; |