summaryrefslogtreecommitdiffstats
path: root/src/common/page_table.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-04-09 04:49:51 +0200
committerbunnei <bunneidev@gmail.com>2020-04-17 06:59:34 +0200
commit4c1812ae37bef16ff9031e603bec66b31ac60692 (patch)
treec6646daef3137393e0ef27f4c7fe3ac2e33dded2 /src/common/page_table.h
parentcore: gdbstub: Updates for new VMM. (diff)
downloadyuzu-4c1812ae37bef16ff9031e603bec66b31ac60692.tar
yuzu-4c1812ae37bef16ff9031e603bec66b31ac60692.tar.gz
yuzu-4c1812ae37bef16ff9031e603bec66b31ac60692.tar.bz2
yuzu-4c1812ae37bef16ff9031e603bec66b31ac60692.tar.lz
yuzu-4c1812ae37bef16ff9031e603bec66b31ac60692.tar.xz
yuzu-4c1812ae37bef16ff9031e603bec66b31ac60692.tar.zst
yuzu-4c1812ae37bef16ff9031e603bec66b31ac60692.zip
Diffstat (limited to '')
-rw-r--r--src/common/page_table.h37
1 files changed, 9 insertions, 28 deletions
diff --git a/src/common/page_table.h b/src/common/page_table.h
index dbc272ab7..1e8bd3187 100644
--- a/src/common/page_table.h
+++ b/src/common/page_table.h
@@ -5,9 +5,12 @@
#pragma once
#include <vector>
+
#include <boost/icl/interval_map.hpp>
+
#include "common/common_types.h"
#include "common/memory_hook.h"
+#include "common/virtual_buffer.h"
namespace Common {
@@ -47,7 +50,7 @@ struct SpecialRegion {
* mimics the way a real CPU page table works.
*/
struct PageTable {
- explicit PageTable(std::size_t page_size_in_bits);
+ PageTable();
~PageTable();
/**
@@ -56,40 +59,18 @@ struct PageTable {
*
* @param address_space_width_in_bits The address size width in bits.
*/
- void Resize(std::size_t address_space_width_in_bits);
+ void Resize(std::size_t address_space_width_in_bits, std::size_t page_size_in_bits,
+ bool has_attribute);
/**
* Vector of memory pointers backing each page. An entry can only be non-null if the
* corresponding entry in the `attributes` vector is of type `Memory`.
*/
- std::vector<u8*> pointers;
-
- /**
- * Contains MMIO handlers that back memory regions whose entries in the `attribute` vector is
- * of type `Special`.
- */
- boost::icl::interval_map<u64, std::set<SpecialRegion>> special_regions;
-
- /**
- * Vector of fine grained page attributes. If it is set to any value other than `Memory`, then
- * the corresponding entry in `pointers` MUST be set to null.
- */
- std::vector<PageType> attributes;
-
- 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();
+ VirtualBuffer<u8*> pointers;
- void Resize(std::size_t address_space_width_in_bits);
+ VirtualBuffer<u64> backing_addr;
- std::vector<u64> backing_addr;
+ VirtualBuffer<PageType> attributes;
};
} // namespace Common