diff options
| author | 2016-11-24 19:58:12 -0800 | |
|---|---|---|
| committer | 2016-11-24 19:58:12 -0800 | |
| commit | ed2ff8df85a260767f20826313105734eea0d68b (patch) | |
| tree | d050e97776a32047b432dff671303d584092d913 /src/core/memory.h | |
| parent | Merge pull request #2211 from yuriks/travis-no-upload (diff) | |
| parent | Expose page table to dynarmic for optimized reads and writes to the JIT (diff) | |
| download | yuzu-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.h | 9 |
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 { | |||
| 17 | const u32 PAGE_SIZE = 0x1000; | 18 | const u32 PAGE_SIZE = 0x1000; |
| 18 | const u32 PAGE_MASK = PAGE_SIZE - 1; | 19 | const u32 PAGE_MASK = PAGE_SIZE - 1; |
| 19 | const int PAGE_BITS = 12; | 20 | const int PAGE_BITS = 12; |
| 21 | const 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 |
| 22 | enum : PAddr { | 24 | enum : 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 | */ |
| 168 | void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size); | 170 | void 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 | */ | ||
| 177 | std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers(); | ||
| 169 | } | 178 | } |