summaryrefslogtreecommitdiff
path: root/src/core/memory.h
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-09-21 11:29:48 -0700
committerGravatar GitHub2016-09-21 11:29:48 -0700
commitd5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a (patch)
tree8a22ca73ff838f3f0090b29a548ae81087fc90ed /src/core/memory.h
parentREADME: Specify master branch for Travis CI badge (diff)
parentFix Travis clang-format check (diff)
downloadyuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.gz
yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.xz
yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.zip
Merge pull request #2086 from linkmauve/clang-format
Add clang-format as part of our {commit,travis}-time checks
Diffstat (limited to 'src/core/memory.h')
-rw-r--r--src/core/memory.h71
1 files changed, 35 insertions, 36 deletions
diff --git a/src/core/memory.h b/src/core/memory.h
index cad845385..8fd3080ff 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -6,7 +6,6 @@
6 6
7#include <cstddef> 7#include <cstddef>
8#include <string> 8#include <string>
9
10#include "common/common_types.h" 9#include "common/common_types.h"
11 10
12namespace Memory { 11namespace Memory {
@@ -22,92 +21,93 @@ const int PAGE_BITS = 12;
22/// Physical memory regions as seen from the ARM11 21/// Physical memory regions as seen from the ARM11
23enum : PAddr { 22enum : PAddr {
24 /// IO register area 23 /// IO register area
25 IO_AREA_PADDR = 0x10100000, 24 IO_AREA_PADDR = 0x10100000,
26 IO_AREA_SIZE = 0x01000000, ///< IO area size (16MB) 25 IO_AREA_SIZE = 0x01000000, ///< IO area size (16MB)
27 IO_AREA_PADDR_END = IO_AREA_PADDR + IO_AREA_SIZE, 26 IO_AREA_PADDR_END = IO_AREA_PADDR + IO_AREA_SIZE,
28 27
29 /// MPCore internal memory region 28 /// MPCore internal memory region
30 MPCORE_RAM_PADDR = 0x17E00000, 29 MPCORE_RAM_PADDR = 0x17E00000,
31 MPCORE_RAM_SIZE = 0x00002000, ///< MPCore internal memory size (8KB) 30 MPCORE_RAM_SIZE = 0x00002000, ///< MPCore internal memory size (8KB)
32 MPCORE_RAM_PADDR_END = MPCORE_RAM_PADDR + MPCORE_RAM_SIZE, 31 MPCORE_RAM_PADDR_END = MPCORE_RAM_PADDR + MPCORE_RAM_SIZE,
33 32
34 /// Video memory 33 /// Video memory
35 VRAM_PADDR = 0x18000000, 34 VRAM_PADDR = 0x18000000,
36 VRAM_SIZE = 0x00600000, ///< VRAM size (6MB) 35 VRAM_SIZE = 0x00600000, ///< VRAM size (6MB)
37 VRAM_PADDR_END = VRAM_PADDR + VRAM_SIZE, 36 VRAM_PADDR_END = VRAM_PADDR + VRAM_SIZE,
38 37
39 /// DSP memory 38 /// DSP memory
40 DSP_RAM_PADDR = 0x1FF00000, 39 DSP_RAM_PADDR = 0x1FF00000,
41 DSP_RAM_SIZE = 0x00080000, ///< DSP memory size (512KB) 40 DSP_RAM_SIZE = 0x00080000, ///< DSP memory size (512KB)
42 DSP_RAM_PADDR_END = DSP_RAM_PADDR + DSP_RAM_SIZE, 41 DSP_RAM_PADDR_END = DSP_RAM_PADDR + DSP_RAM_SIZE,
43 42
44 /// AXI WRAM 43 /// AXI WRAM
45 AXI_WRAM_PADDR = 0x1FF80000, 44 AXI_WRAM_PADDR = 0x1FF80000,
46 AXI_WRAM_SIZE = 0x00080000, ///< AXI WRAM size (512KB) 45 AXI_WRAM_SIZE = 0x00080000, ///< AXI WRAM size (512KB)
47 AXI_WRAM_PADDR_END = AXI_WRAM_PADDR + AXI_WRAM_SIZE, 46 AXI_WRAM_PADDR_END = AXI_WRAM_PADDR + AXI_WRAM_SIZE,
48 47
49 /// Main FCRAM 48 /// Main FCRAM
50 FCRAM_PADDR = 0x20000000, 49 FCRAM_PADDR = 0x20000000,
51 FCRAM_SIZE = 0x08000000, ///< FCRAM size (128MB) 50 FCRAM_SIZE = 0x08000000, ///< FCRAM size (128MB)
52 FCRAM_PADDR_END = FCRAM_PADDR + FCRAM_SIZE, 51 FCRAM_PADDR_END = FCRAM_PADDR + FCRAM_SIZE,
53}; 52};
54 53
55/// Virtual user-space memory regions 54/// Virtual user-space memory regions
56enum : VAddr { 55enum : VAddr {
57 /// Where the application text, data and bss reside. 56 /// Where the application text, data and bss reside.
58 PROCESS_IMAGE_VADDR = 0x00100000, 57 PROCESS_IMAGE_VADDR = 0x00100000,
59 PROCESS_IMAGE_MAX_SIZE = 0x03F00000, 58 PROCESS_IMAGE_MAX_SIZE = 0x03F00000,
60 PROCESS_IMAGE_VADDR_END = PROCESS_IMAGE_VADDR + PROCESS_IMAGE_MAX_SIZE, 59 PROCESS_IMAGE_VADDR_END = PROCESS_IMAGE_VADDR + PROCESS_IMAGE_MAX_SIZE,
61 60
62 /// Area where IPC buffers are mapped onto. 61 /// Area where IPC buffers are mapped onto.
63 IPC_MAPPING_VADDR = 0x04000000, 62 IPC_MAPPING_VADDR = 0x04000000,
64 IPC_MAPPING_SIZE = 0x04000000, 63 IPC_MAPPING_SIZE = 0x04000000,
65 IPC_MAPPING_VADDR_END = IPC_MAPPING_VADDR + IPC_MAPPING_SIZE, 64 IPC_MAPPING_VADDR_END = IPC_MAPPING_VADDR + IPC_MAPPING_SIZE,
66 65
67 /// Application heap (includes stack). 66 /// Application heap (includes stack).
68 HEAP_VADDR = 0x08000000, 67 HEAP_VADDR = 0x08000000,
69 HEAP_SIZE = 0x08000000, 68 HEAP_SIZE = 0x08000000,
70 HEAP_VADDR_END = HEAP_VADDR + HEAP_SIZE, 69 HEAP_VADDR_END = HEAP_VADDR + HEAP_SIZE,
71 70
72 /// Area where shared memory buffers are mapped onto. 71 /// Area where shared memory buffers are mapped onto.
73 SHARED_MEMORY_VADDR = 0x10000000, 72 SHARED_MEMORY_VADDR = 0x10000000,
74 SHARED_MEMORY_SIZE = 0x04000000, 73 SHARED_MEMORY_SIZE = 0x04000000,
75 SHARED_MEMORY_VADDR_END = SHARED_MEMORY_VADDR + SHARED_MEMORY_SIZE, 74 SHARED_MEMORY_VADDR_END = SHARED_MEMORY_VADDR + SHARED_MEMORY_SIZE,
76 75
77 /// Maps 1:1 to an offset in FCRAM. Used for HW allocations that need to be linear in physical memory. 76 /// Maps 1:1 to an offset in FCRAM. Used for HW allocations that need to be linear in physical
78 LINEAR_HEAP_VADDR = 0x14000000, 77 /// memory.
79 LINEAR_HEAP_SIZE = 0x08000000, 78 LINEAR_HEAP_VADDR = 0x14000000,
79 LINEAR_HEAP_SIZE = 0x08000000,
80 LINEAR_HEAP_VADDR_END = LINEAR_HEAP_VADDR + LINEAR_HEAP_SIZE, 80 LINEAR_HEAP_VADDR_END = LINEAR_HEAP_VADDR + LINEAR_HEAP_SIZE,
81 81
82 /// Maps 1:1 to the IO register area. 82 /// Maps 1:1 to the IO register area.
83 IO_AREA_VADDR = 0x1EC00000, 83 IO_AREA_VADDR = 0x1EC00000,
84 IO_AREA_VADDR_END = IO_AREA_VADDR + IO_AREA_SIZE, 84 IO_AREA_VADDR_END = IO_AREA_VADDR + IO_AREA_SIZE,
85 85
86 /// Maps 1:1 to VRAM. 86 /// Maps 1:1 to VRAM.
87 VRAM_VADDR = 0x1F000000, 87 VRAM_VADDR = 0x1F000000,
88 VRAM_VADDR_END = VRAM_VADDR + VRAM_SIZE, 88 VRAM_VADDR_END = VRAM_VADDR + VRAM_SIZE,
89 89
90 /// Maps 1:1 to DSP memory. 90 /// Maps 1:1 to DSP memory.
91 DSP_RAM_VADDR = 0x1FF00000, 91 DSP_RAM_VADDR = 0x1FF00000,
92 DSP_RAM_VADDR_END = DSP_RAM_VADDR + DSP_RAM_SIZE, 92 DSP_RAM_VADDR_END = DSP_RAM_VADDR + DSP_RAM_SIZE,
93 93
94 /// Read-only page containing kernel and system configuration values. 94 /// Read-only page containing kernel and system configuration values.
95 CONFIG_MEMORY_VADDR = 0x1FF80000, 95 CONFIG_MEMORY_VADDR = 0x1FF80000,
96 CONFIG_MEMORY_SIZE = 0x00001000, 96 CONFIG_MEMORY_SIZE = 0x00001000,
97 CONFIG_MEMORY_VADDR_END = CONFIG_MEMORY_VADDR + CONFIG_MEMORY_SIZE, 97 CONFIG_MEMORY_VADDR_END = CONFIG_MEMORY_VADDR + CONFIG_MEMORY_SIZE,
98 98
99 /// Usually read-only page containing mostly values read from hardware. 99 /// Usually read-only page containing mostly values read from hardware.
100 SHARED_PAGE_VADDR = 0x1FF81000, 100 SHARED_PAGE_VADDR = 0x1FF81000,
101 SHARED_PAGE_SIZE = 0x00001000, 101 SHARED_PAGE_SIZE = 0x00001000,
102 SHARED_PAGE_VADDR_END = SHARED_PAGE_VADDR + SHARED_PAGE_SIZE, 102 SHARED_PAGE_VADDR_END = SHARED_PAGE_VADDR + SHARED_PAGE_SIZE,
103 103
104 /// Area where TLS (Thread-Local Storage) buffers are allocated. 104 /// Area where TLS (Thread-Local Storage) buffers are allocated.
105 TLS_AREA_VADDR = 0x1FF82000, 105 TLS_AREA_VADDR = 0x1FF82000,
106 TLS_ENTRY_SIZE = 0x200, 106 TLS_ENTRY_SIZE = 0x200,
107 107
108 /// Equivalent to LINEAR_HEAP_VADDR, but expanded to cover the extra memory in the New 3DS. 108 /// Equivalent to LINEAR_HEAP_VADDR, but expanded to cover the extra memory in the New 3DS.
109 NEW_LINEAR_HEAP_VADDR = 0x30000000, 109 NEW_LINEAR_HEAP_VADDR = 0x30000000,
110 NEW_LINEAR_HEAP_SIZE = 0x10000000, 110 NEW_LINEAR_HEAP_SIZE = 0x10000000,
111 NEW_LINEAR_HEAP_VADDR_END = NEW_LINEAR_HEAP_VADDR + NEW_LINEAR_HEAP_SIZE, 111 NEW_LINEAR_HEAP_VADDR_END = NEW_LINEAR_HEAP_VADDR + NEW_LINEAR_HEAP_SIZE,
112}; 112};
113 113
@@ -166,5 +166,4 @@ void RasterizerFlushRegion(PAddr start, u32 size);
166 * Flushes and invalidates any externally cached rasterizer resources touching the given region. 166 * Flushes and invalidates any externally cached rasterizer resources touching the given region.
167 */ 167 */
168void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size); 168void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size);
169
170} 169}