diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-31 08:21:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 08:21:39 +0200 |
commit | f34176996e443cb79bd70ea2c72feeabac2b1430 (patch) | |
tree | b1c649a914bd136248782a371202ab314bf18939 /src/common | |
parent | Merge pull request #6344 from german77/update-libusb (diff) | |
parent | core/memory: Check our memory fallbacks for out-of-bound behavior. (diff) | |
download | yuzu-f34176996e443cb79bd70ea2c72feeabac2b1430.tar yuzu-f34176996e443cb79bd70ea2c72feeabac2b1430.tar.gz yuzu-f34176996e443cb79bd70ea2c72feeabac2b1430.tar.bz2 yuzu-f34176996e443cb79bd70ea2c72feeabac2b1430.tar.lz yuzu-f34176996e443cb79bd70ea2c72feeabac2b1430.tar.xz yuzu-f34176996e443cb79bd70ea2c72feeabac2b1430.tar.zst yuzu-f34176996e443cb79bd70ea2c72feeabac2b1430.zip |
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/page_table.cpp | 1 | ||||
-rw-r--r-- | src/common/page_table.h | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/common/page_table.cpp b/src/common/page_table.cpp index 8fd8620fd..9fffd816f 100644 --- a/src/common/page_table.cpp +++ b/src/common/page_table.cpp @@ -14,6 +14,7 @@ void PageTable::Resize(size_t address_space_width_in_bits, size_t page_size_in_b const size_t num_page_table_entries{1ULL << (address_space_width_in_bits - page_size_in_bits)}; pointers.resize(num_page_table_entries); backing_addr.resize(num_page_table_entries); + current_address_space_width_in_bits = address_space_width_in_bits; } } // namespace Common diff --git a/src/common/page_table.h b/src/common/page_table.h index 61c5552e0..e92b66b2b 100644 --- a/src/common/page_table.h +++ b/src/common/page_table.h @@ -98,6 +98,10 @@ struct PageTable { */ void Resize(size_t address_space_width_in_bits, size_t page_size_in_bits); + size_t GetAddressSpaceBits() const { + return current_address_space_width_in_bits; + } + /** * Vector of memory pointers backing each page. An entry can only be non-null if the * corresponding attribute element is of type `Memory`. @@ -105,6 +109,8 @@ struct PageTable { VirtualBuffer<PageInfo> pointers; VirtualBuffer<u64> backing_addr; + + size_t current_address_space_width_in_bits; }; } // namespace Common |