summaryrefslogtreecommitdiffstats
path: root/src/core/memory.h
diff options
context:
space:
mode:
authorJames Rowe <jroweboy@gmail.com>2016-11-24 20:42:32 +0100
committerJames Rowe <jroweboy@gmail.com>2016-11-25 04:41:18 +0100
commitbbe57a66cad1b4159f351bf55f84c97040b04753 (patch)
treea2643734bf9af63e5a8f44ff7207e6f8848267f0 /src/core/memory.h
parentCache Vertices instead of Output registers (#2165) (diff)
downloadyuzu-bbe57a66cad1b4159f351bf55f84c97040b04753.tar
yuzu-bbe57a66cad1b4159f351bf55f84c97040b04753.tar.gz
yuzu-bbe57a66cad1b4159f351bf55f84c97040b04753.tar.bz2
yuzu-bbe57a66cad1b4159f351bf55f84c97040b04753.tar.lz
yuzu-bbe57a66cad1b4159f351bf55f84c97040b04753.tar.xz
yuzu-bbe57a66cad1b4159f351bf55f84c97040b04753.tar.zst
yuzu-bbe57a66cad1b4159f351bf55f84c97040b04753.zip
Diffstat (limited to '')
-rw-r--r--src/core/memory.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/memory.h b/src/core/memory.h
index 8fd3080ff..903b58a22 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -4,6 +4,7 @@
#pragma once
+#include <array>
#include <cstddef>
#include <string>
#include "common/common_types.h"
@@ -17,6 +18,7 @@ namespace Memory {
const u32 PAGE_SIZE = 0x1000;
const u32 PAGE_MASK = PAGE_SIZE - 1;
const int PAGE_BITS = 12;
+const size_t PAGE_TABLE_NUM_ENTRIES = 1 << (32 - PAGE_BITS);
/// Physical memory regions as seen from the ARM11
enum : PAddr {
@@ -166,4 +168,11 @@ void RasterizerFlushRegion(PAddr start, u32 size);
* Flushes and invalidates any externally cached rasterizer resources touching the given region.
*/
void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size);
+
+/**
+ * Dynarmic has an optimization to memory accesses when the pointer to the page exists that
+ * can be used by setting up the current page table as a callback. This function is used to
+ * retrieve the current page table for that purpose.
+ */
+std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers();
}