diff options
author | bunnei <bunneidev@gmail.com> | 2022-02-19 09:14:27 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2022-02-19 09:14:27 +0100 |
commit | 92b2e92620a04af6d1ce2d35f55905b3a8b805fc (patch) | |
tree | c152795267b26a09564860d3369beaa857c9ca1c /src/common | |
parent | core: hle: kernel: KPageTable: Improve Un/MapPhysicalMemory. (diff) | |
download | yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar.gz yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar.bz2 yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar.lz yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar.xz yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.tar.zst yuzu-92b2e92620a04af6d1ce2d35f55905b3a8b805fc.zip |
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/page_table.cpp | 28 | ||||
-rw-r--r-- | src/common/page_table.h | 4 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/common/page_table.cpp b/src/common/page_table.cpp index 75897eeae..4817b09f9 100644 --- a/src/common/page_table.cpp +++ b/src/common/page_table.cpp @@ -10,12 +10,12 @@ PageTable::PageTable() = default; PageTable::~PageTable() noexcept = default; -bool PageTable::BeginTraversal(TraversalEntry* out_entry, TraversalContext* out_context, +bool PageTable::BeginTraversal(TraversalEntry& out_entry, TraversalContext& out_context, u64 address) const { // Setup invalid defaults. - out_entry->phys_addr = 0; - out_entry->block_size = page_size; - out_context->next_page = 0; + out_entry.phys_addr = 0; + out_entry.block_size = page_size; + out_context.next_page = 0; // Validate that we can read the actual entry. const auto page = address / page_size; @@ -30,20 +30,20 @@ bool PageTable::BeginTraversal(TraversalEntry* out_entry, TraversalContext* out_ } // Populate the results. - out_entry->phys_addr = phys_addr + address; - out_context->next_page = page + 1; - out_context->next_offset = address + page_size; + out_entry.phys_addr = phys_addr + address; + out_context.next_page = page + 1; + out_context.next_offset = address + page_size; return true; } -bool PageTable::ContinueTraversal(TraversalEntry* out_entry, TraversalContext* context) const { +bool PageTable::ContinueTraversal(TraversalEntry& out_entry, TraversalContext& context) const { // Setup invalid defaults. - out_entry->phys_addr = 0; - out_entry->block_size = page_size; + out_entry.phys_addr = 0; + out_entry.block_size = page_size; // Validate that we can read the actual entry. - const auto page = context->next_page; + const auto page = context.next_page; if (page >= backing_addr.size()) { return false; } @@ -55,9 +55,9 @@ bool PageTable::ContinueTraversal(TraversalEntry* out_entry, TraversalContext* c } // Populate the results. - out_entry->phys_addr = phys_addr + context->next_offset; - context->next_page = page + 1; - context->next_offset += page_size; + out_entry.phys_addr = phys_addr + context.next_offset; + context.next_page = page + 1; + context.next_offset += page_size; return true; } diff --git a/src/common/page_table.h b/src/common/page_table.h index fe254d7ae..82d91e9f3 100644 --- a/src/common/page_table.h +++ b/src/common/page_table.h @@ -99,9 +99,9 @@ struct PageTable { PageTable(PageTable&&) noexcept = default; PageTable& operator=(PageTable&&) noexcept = default; - bool BeginTraversal(TraversalEntry* out_entry, TraversalContext* out_context, + bool BeginTraversal(TraversalEntry& out_entry, TraversalContext& out_context, u64 address) const; - bool ContinueTraversal(TraversalEntry* out_entry, TraversalContext* context) const; + bool ContinueTraversal(TraversalEntry& out_entry, TraversalContext& context) const; /** * Resizes the page table to be able to accommodate enough pages within |