summaryrefslogtreecommitdiff
path: root/src/core/memory.h
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-11-24 19:58:12 -0800
committerGravatar GitHub2016-11-24 19:58:12 -0800
commited2ff8df85a260767f20826313105734eea0d68b (patch)
treed050e97776a32047b432dff671303d584092d913 /src/core/memory.h
parentMerge pull request #2211 from yuriks/travis-no-upload (diff)
parentExpose page table to dynarmic for optimized reads and writes to the JIT (diff)
downloadyuzu-ed2ff8df85a260767f20826313105734eea0d68b.tar.gz
yuzu-ed2ff8df85a260767f20826313105734eea0d68b.tar.xz
yuzu-ed2ff8df85a260767f20826313105734eea0d68b.zip
Merge pull request #2210 from jroweboy/pagetables
Expose page table to dynarmic for optimized reads and writes to the JIT
Diffstat (limited to 'src/core/memory.h')
-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 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <array>
7#include <cstddef> 8#include <cstddef>
8#include <string> 9#include <string>
9#include "common/common_types.h" 10#include "common/common_types.h"
@@ -17,6 +18,7 @@ namespace Memory {
17const u32 PAGE_SIZE = 0x1000; 18const u32 PAGE_SIZE = 0x1000;
18const u32 PAGE_MASK = PAGE_SIZE - 1; 19const u32 PAGE_MASK = PAGE_SIZE - 1;
19const int PAGE_BITS = 12; 20const int PAGE_BITS = 12;
21const size_t PAGE_TABLE_NUM_ENTRIES = 1 << (32 - PAGE_BITS);
20 22
21/// Physical memory regions as seen from the ARM11 23/// Physical memory regions as seen from the ARM11
22enum : PAddr { 24enum : PAddr {
@@ -166,4 +168,11 @@ void RasterizerFlushRegion(PAddr start, u32 size);
166 * Flushes and invalidates any externally cached rasterizer resources touching the given region. 168 * Flushes and invalidates any externally cached rasterizer resources touching the given region.
167 */ 169 */
168void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size); 170void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size);
171
172/**
173 * Dynarmic has an optimization to memory accesses when the pointer to the page exists that
174 * can be used by setting up the current page table as a callback. This function is used to
175 * retrieve the current page table for that purpose.
176 */
177std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers();
169} 178}