diff options
| author | 2021-04-23 22:04:28 -0700 | |
|---|---|---|
| committer | 2021-05-05 16:40:52 -0700 | |
| commit | 2a7eff57a8048933a89c1a8f8d6dced7b5d604f2 (patch) | |
| tree | 757a2207ab4d29b39ee8d9ddfa79966283d4d24a /src/core/memory.cpp | |
| parent | hle: kernel: Remove deprecated Object class. (diff) | |
| download | yuzu-2a7eff57a8048933a89c1a8f8d6dced7b5d604f2.tar.gz yuzu-2a7eff57a8048933a89c1a8f8d6dced7b5d604f2.tar.xz yuzu-2a7eff57a8048933a89c1a8f8d6dced7b5d604f2.zip | |
hle: kernel: Rename Process to KProcess.
Diffstat (limited to 'src/core/memory.cpp')
| -rw-r--r-- | src/core/memory.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index ee4599063..b4c56e1c1 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp | |||
| @@ -17,8 +17,8 @@ | |||
| 17 | #include "core/core.h" | 17 | #include "core/core.h" |
| 18 | #include "core/device_memory.h" | 18 | #include "core/device_memory.h" |
| 19 | #include "core/hle/kernel/k_page_table.h" | 19 | #include "core/hle/kernel/k_page_table.h" |
| 20 | #include "core/hle/kernel/k_process.h" | ||
| 20 | #include "core/hle/kernel/physical_memory.h" | 21 | #include "core/hle/kernel/physical_memory.h" |
| 21 | #include "core/hle/kernel/process.h" | ||
| 22 | #include "core/memory.h" | 22 | #include "core/memory.h" |
| 23 | #include "video_core/gpu.h" | 23 | #include "video_core/gpu.h" |
| 24 | 24 | ||
| @@ -30,7 +30,7 @@ namespace Core::Memory { | |||
| 30 | struct Memory::Impl { | 30 | 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::Process& 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.PageTable().PageTableImpl(); |
| 35 | 35 | ||
| 36 | const std::size_t address_space_width = process.PageTable().GetAddressSpaceWidth(); | 36 | const std::size_t address_space_width = process.PageTable().GetAddressSpaceWidth(); |
| @@ -50,7 +50,7 @@ struct Memory::Impl { | |||
| 50 | MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, 0, Common::PageType::Unmapped); | 50 | MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, 0, Common::PageType::Unmapped); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | bool IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) const { | 53 | bool IsValidVirtualAddress(const Kernel::KProcess& process, const VAddr vaddr) const { |
| 54 | const auto& page_table = process.PageTable().PageTableImpl(); | 54 | const auto& page_table = process.PageTable().PageTableImpl(); |
| 55 | const auto [pointer, type] = page_table.pointers[vaddr >> PAGE_BITS].PointerType(); | 55 | const auto [pointer, type] = page_table.pointers[vaddr >> PAGE_BITS].PointerType(); |
| 56 | return pointer != nullptr || type == Common::PageType::RasterizerCachedMemory; | 56 | return pointer != nullptr || type == Common::PageType::RasterizerCachedMemory; |
| @@ -194,7 +194,7 @@ struct Memory::Impl { | |||
| 194 | return string; | 194 | return string; |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | void ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_buffer, | 197 | void ReadBlock(const Kernel::KProcess& process, const VAddr src_addr, void* dest_buffer, |
| 198 | const std::size_t size) { | 198 | const std::size_t size) { |
| 199 | const auto& page_table = process.PageTable().PageTableImpl(); | 199 | const auto& page_table = process.PageTable().PageTableImpl(); |
| 200 | 200 | ||
| @@ -239,7 +239,7 @@ struct Memory::Impl { | |||
| 239 | } | 239 | } |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | void ReadBlockUnsafe(const Kernel::Process& process, const VAddr src_addr, void* dest_buffer, | 242 | void ReadBlockUnsafe(const Kernel::KProcess& process, const VAddr src_addr, void* dest_buffer, |
| 243 | const std::size_t size) { | 243 | const std::size_t size) { |
| 244 | const auto& page_table = process.PageTable().PageTableImpl(); | 244 | const auto& page_table = process.PageTable().PageTableImpl(); |
| 245 | 245 | ||
| @@ -291,7 +291,7 @@ struct Memory::Impl { | |||
| 291 | ReadBlockUnsafe(*system.CurrentProcess(), src_addr, dest_buffer, size); | 291 | ReadBlockUnsafe(*system.CurrentProcess(), src_addr, dest_buffer, size); |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | void WriteBlock(const Kernel::Process& process, const VAddr dest_addr, const void* src_buffer, | 294 | void WriteBlock(const Kernel::KProcess& process, const VAddr dest_addr, const void* src_buffer, |
| 295 | const std::size_t size) { | 295 | const std::size_t size) { |
| 296 | const auto& page_table = process.PageTable().PageTableImpl(); | 296 | const auto& page_table = process.PageTable().PageTableImpl(); |
| 297 | std::size_t remaining_size = size; | 297 | std::size_t remaining_size = size; |
| @@ -334,7 +334,7 @@ struct Memory::Impl { | |||
| 334 | } | 334 | } |
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | void WriteBlockUnsafe(const Kernel::Process& process, const VAddr dest_addr, | 337 | void WriteBlockUnsafe(const Kernel::KProcess& process, const VAddr dest_addr, |
| 338 | const void* src_buffer, const std::size_t size) { | 338 | const void* src_buffer, const std::size_t size) { |
| 339 | const auto& page_table = process.PageTable().PageTableImpl(); | 339 | const auto& page_table = process.PageTable().PageTableImpl(); |
| 340 | std::size_t remaining_size = size; | 340 | std::size_t remaining_size = size; |
| @@ -384,7 +384,7 @@ struct Memory::Impl { | |||
| 384 | WriteBlockUnsafe(*system.CurrentProcess(), dest_addr, src_buffer, size); | 384 | WriteBlockUnsafe(*system.CurrentProcess(), dest_addr, src_buffer, size); |
| 385 | } | 385 | } |
| 386 | 386 | ||
| 387 | void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const std::size_t size) { | 387 | void ZeroBlock(const Kernel::KProcess& process, const VAddr dest_addr, const std::size_t size) { |
| 388 | const auto& page_table = process.PageTable().PageTableImpl(); | 388 | const auto& page_table = process.PageTable().PageTableImpl(); |
| 389 | std::size_t remaining_size = size; | 389 | std::size_t remaining_size = size; |
| 390 | std::size_t page_index = dest_addr >> PAGE_BITS; | 390 | std::size_t page_index = dest_addr >> PAGE_BITS; |
| @@ -429,7 +429,7 @@ struct Memory::Impl { | |||
| 429 | ZeroBlock(*system.CurrentProcess(), dest_addr, size); | 429 | ZeroBlock(*system.CurrentProcess(), dest_addr, size); |
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr, | 432 | void CopyBlock(const Kernel::KProcess& process, VAddr dest_addr, VAddr src_addr, |
| 433 | const std::size_t size) { | 433 | const std::size_t size) { |
| 434 | const auto& page_table = process.PageTable().PageTableImpl(); | 434 | const auto& page_table = process.PageTable().PageTableImpl(); |
| 435 | std::size_t remaining_size = size; | 435 | std::size_t remaining_size = size; |
| @@ -741,7 +741,7 @@ void Memory::Reset() { | |||
| 741 | impl = std::make_unique<Impl>(system); | 741 | impl = std::make_unique<Impl>(system); |
| 742 | } | 742 | } |
| 743 | 743 | ||
| 744 | void Memory::SetCurrentPageTable(Kernel::Process& process, u32 core_id) { | 744 | void Memory::SetCurrentPageTable(Kernel::KProcess& process, u32 core_id) { |
| 745 | impl->SetCurrentPageTable(process, core_id); | 745 | impl->SetCurrentPageTable(process, core_id); |
| 746 | } | 746 | } |
| 747 | 747 | ||
| @@ -753,7 +753,7 @@ void Memory::UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) { | |||
| 753 | impl->UnmapRegion(page_table, base, size); | 753 | impl->UnmapRegion(page_table, base, size); |
| 754 | } | 754 | } |
| 755 | 755 | ||
| 756 | bool Memory::IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) const { | 756 | bool Memory::IsValidVirtualAddress(const Kernel::KProcess& process, const VAddr vaddr) const { |
| 757 | return impl->IsValidVirtualAddress(process, vaddr); | 757 | return impl->IsValidVirtualAddress(process, vaddr); |
| 758 | } | 758 | } |
| 759 | 759 | ||
| @@ -829,7 +829,7 @@ std::string Memory::ReadCString(VAddr vaddr, std::size_t max_length) { | |||
| 829 | return impl->ReadCString(vaddr, max_length); | 829 | return impl->ReadCString(vaddr, max_length); |
| 830 | } | 830 | } |
| 831 | 831 | ||
| 832 | void Memory::ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_buffer, | 832 | void Memory::ReadBlock(const Kernel::KProcess& process, const VAddr src_addr, void* dest_buffer, |
| 833 | const std::size_t size) { | 833 | const std::size_t size) { |
| 834 | impl->ReadBlock(process, src_addr, dest_buffer, size); | 834 | impl->ReadBlock(process, src_addr, dest_buffer, size); |
| 835 | } | 835 | } |
| @@ -838,7 +838,7 @@ void Memory::ReadBlock(const VAddr src_addr, void* dest_buffer, const std::size_ | |||
| 838 | impl->ReadBlock(src_addr, dest_buffer, size); | 838 | impl->ReadBlock(src_addr, dest_buffer, size); |
| 839 | } | 839 | } |
| 840 | 840 | ||
| 841 | void Memory::ReadBlockUnsafe(const Kernel::Process& process, const VAddr src_addr, | 841 | void Memory::ReadBlockUnsafe(const Kernel::KProcess& process, const VAddr src_addr, |
| 842 | void* dest_buffer, const std::size_t size) { | 842 | void* dest_buffer, const std::size_t size) { |
| 843 | impl->ReadBlockUnsafe(process, src_addr, dest_buffer, size); | 843 | impl->ReadBlockUnsafe(process, src_addr, dest_buffer, size); |
| 844 | } | 844 | } |
| @@ -847,7 +847,7 @@ void Memory::ReadBlockUnsafe(const VAddr src_addr, void* dest_buffer, const std: | |||
| 847 | impl->ReadBlockUnsafe(src_addr, dest_buffer, size); | 847 | impl->ReadBlockUnsafe(src_addr, dest_buffer, size); |
| 848 | } | 848 | } |
| 849 | 849 | ||
| 850 | void Memory::WriteBlock(const Kernel::Process& process, VAddr dest_addr, const void* src_buffer, | 850 | void Memory::WriteBlock(const Kernel::KProcess& process, VAddr dest_addr, const void* src_buffer, |
| 851 | std::size_t size) { | 851 | std::size_t size) { |
| 852 | impl->WriteBlock(process, dest_addr, src_buffer, size); | 852 | impl->WriteBlock(process, dest_addr, src_buffer, size); |
| 853 | } | 853 | } |
| @@ -856,7 +856,7 @@ void Memory::WriteBlock(const VAddr dest_addr, const void* src_buffer, const std | |||
| 856 | impl->WriteBlock(dest_addr, src_buffer, size); | 856 | impl->WriteBlock(dest_addr, src_buffer, size); |
| 857 | } | 857 | } |
| 858 | 858 | ||
| 859 | void Memory::WriteBlockUnsafe(const Kernel::Process& process, VAddr dest_addr, | 859 | void Memory::WriteBlockUnsafe(const Kernel::KProcess& process, VAddr dest_addr, |
| 860 | const void* src_buffer, std::size_t size) { | 860 | const void* src_buffer, std::size_t size) { |
| 861 | impl->WriteBlockUnsafe(process, dest_addr, src_buffer, size); | 861 | impl->WriteBlockUnsafe(process, dest_addr, src_buffer, size); |
| 862 | } | 862 | } |
| @@ -866,7 +866,7 @@ void Memory::WriteBlockUnsafe(const VAddr dest_addr, const void* src_buffer, | |||
| 866 | impl->WriteBlockUnsafe(dest_addr, src_buffer, size); | 866 | impl->WriteBlockUnsafe(dest_addr, src_buffer, size); |
| 867 | } | 867 | } |
| 868 | 868 | ||
| 869 | void Memory::ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size) { | 869 | void Memory::ZeroBlock(const Kernel::KProcess& process, VAddr dest_addr, std::size_t size) { |
| 870 | impl->ZeroBlock(process, dest_addr, size); | 870 | impl->ZeroBlock(process, dest_addr, size); |
| 871 | } | 871 | } |
| 872 | 872 | ||
| @@ -874,7 +874,7 @@ void Memory::ZeroBlock(VAddr dest_addr, std::size_t size) { | |||
| 874 | impl->ZeroBlock(dest_addr, size); | 874 | impl->ZeroBlock(dest_addr, size); |
| 875 | } | 875 | } |
| 876 | 876 | ||
| 877 | void Memory::CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr, | 877 | void Memory::CopyBlock(const Kernel::KProcess& process, VAddr dest_addr, VAddr src_addr, |
| 878 | const std::size_t size) { | 878 | const std::size_t size) { |
| 879 | impl->CopyBlock(process, dest_addr, src_addr, size); | 879 | impl->CopyBlock(process, dest_addr, src_addr, size); |
| 880 | } | 880 | } |