diff options
author | bunnei <bunneidev@gmail.com> | 2020-03-14 16:50:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-14 16:50:27 -0400 |
commit | 4dfd5c84ea00cb3c2d5772f6951af93779b6d70e (patch) | |
tree | 9b9235159a9ef45e5fdbfb6bc60587e370cda8b7 /src/common/page_table.h | |
parent | c51dbf80388b5d31ac6e48cceb2968c7d8226477 (diff) | |
parent | 27cbb75e7c2818c073bd65a000d7ff7f28d391d4 (diff) |
Merge pull request #3508 from FernandoS27/page-table
PageTable: move backing addresses to a children class as the CPU page table does not need them.
Diffstat (limited to 'src/common/page_table.h')
-rw-r--r-- | src/common/page_table.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/common/page_table.h b/src/common/page_table.h index 8b8ff0bb8..dbc272ab7 100644 --- a/src/common/page_table.h +++ b/src/common/page_table.h @@ -76,9 +76,20 @@ struct PageTable { */ std::vector<PageType> attributes; - std::vector<u64> backing_addr; - const std::size_t page_size_in_bits{}; }; +/** + * A more advanced Page Table with the ability to save a backing address when using it + * depends on another MMU. + */ +struct BackingPageTable : PageTable { + explicit BackingPageTable(std::size_t page_size_in_bits); + ~BackingPageTable(); + + void Resize(std::size_t address_space_width_in_bits); + + std::vector<u64> backing_addr; +}; + } // namespace Common |